aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManu Sridharan <msridhar@gmail.com>2021-12-23 17:03:30 -0800
committerGitHub <noreply@github.com>2021-12-23 20:03:30 -0500
commit5826c00c3efee0be3c2d00f0f5c8978835e0d87a (patch)
tree9992dee95a8798e1d8d6d434452a7f80579c4127
parent04e029aacbecaa713d9ae380af6e5b6036a042e0 (diff)
downloadnullaway-5826c00c3efee0be3c2d00f0f5c8978835e0d87a.tar.gz
Changes to avoid re-running Gradle tasks unnecessarily (#528)
Two changes here: * Add an `archiveClassifier` for the `:jar-infer:jar-infer-cli:jar` task, so that its output isn't the exact same file as the `shadowJar` task. Before, the tasks would overwrite each other's outputs, forcing the tasks to re-run. * Remove the `Build-Timestamp` from the `:jar-infer:test-java-lib-jarinfer:jar` output, as it forced the jar to be re-generated every time. With these changes, many fewer JarInfer-related Gradle tasks are re-run unnecessarily.
-rw-r--r--jar-infer/jar-infer-cli/build.gradle4
-rw-r--r--jar-infer/test-java-lib-jarinfer/build.gradle1
2 files changed, 4 insertions, 1 deletions
diff --git a/jar-infer/jar-infer-cli/build.gradle b/jar-infer/jar-infer-cli/build.gradle
index d4f04e1..fb0252a 100644
--- a/jar-infer/jar-infer-cli/build.gradle
+++ b/jar-infer/jar-infer-cli/build.gradle
@@ -30,6 +30,10 @@ jar {
'Main-Class': 'com.uber.nullaway.jarinfer.JarInfer'
)
}
+ // add this classifier so that the output file for the jar task differs from
+ // the output file for the shadowJar task (otherwise they overwrite each other's
+ // outputs, forcing the tasks to always re-run)
+ archiveClassifier = "nonshadow"
}
shadowJar {
diff --git a/jar-infer/test-java-lib-jarinfer/build.gradle b/jar-infer/test-java-lib-jarinfer/build.gradle
index 18afee4..0ed2865 100644
--- a/jar-infer/test-java-lib-jarinfer/build.gradle
+++ b/jar-infer/test-java-lib-jarinfer/build.gradle
@@ -28,7 +28,6 @@ def astubxPath = "META-INF/nullaway/jarinfer.astubx"
jar {
manifest {
attributes(
- 'Build-Timestamp': new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
'Created-By' : "Gradle ${gradle.gradleVersion}",
'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}"