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 17plugins { 18 id "java-library" 19} 20 21evaluationDependsOn(":jar-infer:jar-infer-cli") 22 23sourceCompatibility = "1.8" 24targetCompatibility = "1.8" 25 26def astubxPath = "com/uber/nullaway/jarinfer/provider/jarinfer.astubx" 27 28jar { 29 manifest { 30 attributes( 31 'Created-By' : "Gradle ${gradle.gradleVersion}", 32 'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})", 33 'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}" 34 ) 35 } 36} 37 38jar.doLast { 39 javaexec { 40 classpath = files("${rootProject.projectDir}/jar-infer/jar-infer-cli/build/libs/jar-infer-cli-${VERSION_NAME}.jar") 41 main = "com.uber.nullaway.jarinfer.JarInfer" 42 args = ["-i", jar.archivePath, "-o", "${jar.destinationDir}/${astubxPath}"] 43 } 44 exec { 45 workingDir "./build/libs" 46 commandLine "jar", "uf", "test-java-lib-jarinfer.jar", astubxPath 47 } 48} 49 50dependencies { 51 compileOnly deps.apt.autoService 52 annotationProcessor deps.apt.autoService 53 compileOnly project(":nullaway") 54 implementation deps.build.jsr305Annotations 55} 56 57jar.dependsOn ":jar-infer:jar-infer-cli:assemble" 58