Skip to content

Commit 8004828

Browse files
committed
JavaScript: Remove build cache from npmBuild/npmFixturesBuild
Caching npmBuild caused version.txt to retain stale timestamps from previous builds, which could result in the release JAR referencing a non-existent npm version at runtime. The onlyIf guard on npmPublish also prevented snapshot publishing in CI's two-invocation flow since npmBuild was always UP-TO-DATE in the second invocation. Keep build cache enabled only for npmTest, which is the expensive task and has no versioning side effects.
1 parent 0cee243 commit 8004828

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

rewrite-javascript/build.gradle.kts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ val npmBuild = tasks.register<NpmTask>("npmBuild") {
124124
inputs.files(fileTree("rewrite/src"))
125125
.withPathSensitivity(PathSensitivity.RELATIVE)
126126
outputs.dir(file("rewrite/dist/"))
127-
outputs.cacheIf { true }
128127

129128
val versionTxt = file("src/main/resources/META-INF/version.txt")
130129
outputs.file(versionTxt)
@@ -174,7 +173,6 @@ val npmFixturesBuild = tasks.register<NpmTask>("npmFixturesBuild") {
174173
inputs.files(fileTree("rewrite/fixtures"))
175174
.withPathSensitivity(PathSensitivity.RELATIVE)
176175
outputs.dir(file("rewrite/dist-fixtures/"))
177-
outputs.cacheIf { true }
178176

179177
args = listOf("run", "build:fixtures")
180178
}
@@ -227,11 +225,6 @@ val npmPublish = tasks.register<NpmTask>("npmPublish") {
227225
args = provider { listOf("publish", npmPack.get().archiveFile.get().asFile.absolutePath) }
228226
if (!project.hasProperty("releasing")) {
229227
args.addAll("--tag", "next")
230-
// Skip publishing when nothing changed in the JavaScript implementation.
231-
// When npmBuild is restored from the build cache, version.txt retains the
232-
// timestamp from the original build, causing a conflict with the previously
233-
// published version on npmjs.
234-
onlyIf { npmBuild.get().state.didWork }
235228
}
236229

237230
workingDir.set(file("rewrite"))

0 commit comments

Comments
 (0)