Skip to content

Commit 210ef84

Browse files
committed
build(rollbar-java): declare inputs so Gradle knows when to rerun the task
1 parent c0da9ca commit 210ef84

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

rollbar-java/build.gradle.kts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import java.io.File
2+
import org.gradle.api.tasks.testing.Test
23

34
plugins {
45
id("com.netflix.nebula.integtest") version "10.0.1"
@@ -36,6 +37,8 @@ val createVersionClass by tasks.registering {
3637
val outputDir = layout.buildDirectory.dir("generated/sources/version/java/main")
3738
outputs.dir(outputDir)
3839

40+
inputs.property("versionName", versionName)
41+
3942
doLast {
4043
val pkg = listOf("com", "rollbar", "notifier", "provider", "notifier")
4144
val pkgName = pkg.joinToString(".")
@@ -63,22 +66,21 @@ sourceSets {
6366
}
6467
}
6568

66-
tasks.withType<JavaCompile>().configureEach {
69+
tasks.named("compileJava") {
6770
dependsOn(createVersionClass)
6871
}
6972

7073
tasks.named("checkstyleMain") {
7174
dependsOn(createVersionClass)
7275
}
7376

74-
// Ensure sourcesJar runs after version class is created
7577
tasks.withType<Jar>().configureEach {
7678
if (name == "sourcesJar") {
7779
dependsOn(createVersionClass)
7880
}
7981
}
8082

81-
tasks.test {
83+
tasks.named<Test>("test") {
8284
dependsOn(createVersionClass)
8385
// This helps us test the VersionHelper class since there's no jar manifest available when
8486
// running tests.

0 commit comments

Comments
 (0)