blob: f372840bb06935a9b868100767cd55cb16c89902 [file] [log] [blame]
Lázaro Clappe51677f2018-08-06 19:43:30 -07001/*
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 {
Lázaro Clappe51677f2018-08-06 19:43:30 -070018 id "java"
19}
20
Subarno6251c192018-08-22 15:54:54 -070021evaluationDependsOn(":jar-infer:jar-infer-cli")
22
Lázaro Clappe51677f2018-08-06 19:43:30 -070023sourceCompatibility = "1.8"
24targetCompatibility = "1.8"
25
Subarno6251c192018-08-22 15:54:54 -070026def astubxPath = "META-INF/nullaway/jarinfer.astubx"
Lázaro Clappe51677f2018-08-06 19:43:30 -070027
Lázaro Clapp073f31a2019-08-12 21:21:54 -070028jar {
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
Subarno6251c192018-08-22 15:54:54 -070039jar.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 Clappe51677f2018-08-06 19:43:30 -070049}
Raghavan Ramaneadcd3a2019-07-29 14:55:22 -070050
51dependencies {
52 implementation deps.build.jsr305Annotations
53}
54
Subarno6251c192018-08-22 15:54:54 -070055jar.dependsOn ":jar-infer:jar-infer-cli:assemble"