Lázaro Clapp | e51677f | 2018-08-06 19:43:30 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017. Uber Technologies |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | plugins { |
Lázaro Clapp | e51677f | 2018-08-06 19:43:30 -0700 | [diff] [blame] | 18 | id "java" |
| 19 | } |
| 20 | |
Subarno | 6251c19 | 2018-08-22 15:54:54 -0700 | [diff] [blame] | 21 | evaluationDependsOn(":jar-infer:jar-infer-cli") |
| 22 | |
Lázaro Clapp | e51677f | 2018-08-06 19:43:30 -0700 | [diff] [blame] | 23 | sourceCompatibility = "1.8" |
| 24 | targetCompatibility = "1.8" |
| 25 | |
Subarno | 6251c19 | 2018-08-22 15:54:54 -0700 | [diff] [blame] | 26 | def astubxPath = "META-INF/nullaway/jarinfer.astubx" |
Lázaro Clapp | e51677f | 2018-08-06 19:43:30 -0700 | [diff] [blame] | 27 | |
Lázaro Clapp | 073f31a | 2019-08-12 21:21:54 -0700 | [diff] [blame^] | 28 | jar { |
| 29 | manifest { |
| 30 | attributes( |
| 31 | 'Build-Timestamp': new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()), |
| 32 | 'Created-By' : "Gradle ${gradle.gradleVersion}", |
| 33 | 'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})", |
| 34 | 'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}" |
| 35 | ) |
| 36 | } |
| 37 | } |
| 38 | |
Subarno | 6251c19 | 2018-08-22 15:54:54 -0700 | [diff] [blame] | 39 | jar.doLast { |
| 40 | javaexec { |
| 41 | classpath = files("${rootProject.projectDir}/jar-infer/jar-infer-cli/build/libs/jar-infer-cli-${VERSION_NAME}.jar") |
| 42 | main = "com.uber.nullaway.jarinfer.JarInfer" |
| 43 | args = ["-i", jar.archivePath, "-o", "${jar.destinationDir}/${astubxPath}"] |
| 44 | } |
| 45 | exec { |
| 46 | workingDir "./build/libs" |
| 47 | commandLine "jar", "uf", "test-java-lib-jarinfer.jar", astubxPath |
| 48 | } |
Lázaro Clapp | e51677f | 2018-08-06 19:43:30 -0700 | [diff] [blame] | 49 | } |
Raghavan Raman | eadcd3a | 2019-07-29 14:55:22 -0700 | [diff] [blame] | 50 | |
| 51 | dependencies { |
| 52 | implementation deps.build.jsr305Annotations |
| 53 | } |
| 54 | |
Subarno | 6251c19 | 2018-08-22 15:54:54 -0700 | [diff] [blame] | 55 | jar.dependsOn ":jar-infer:jar-infer-cli:assemble" |