Skip to content

Commit 8400f89

Browse files
authored
Fix javac task inputs so that they include modular dependencies #12742 (#12745)
Fix javac task inputs so that they include modular dependencies #12742
1 parent 66324f7 commit 8400f89

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

gradle/java/modules.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ allprojects {
6767
tasks.named(sourceSet.getCompileJavaTaskName()).configure({ JavaCompile task ->
6868
task.dependsOn modularPaths.compileModulePathConfiguration
6969

70+
// GH-12742: add the modular path as inputs so that if anything changes, the task
71+
// is not up to date and is re-run. I [dw] believe this should be a @Classpath parameter
72+
// on the task itself... but I don't know how to implement this on an existing class.
73+
// this is a workaround but should work just fine though.
74+
task.inputs.files(modularPaths.compileModulePathConfiguration)
75+
7076
// LUCENE-10327: don't allow gradle to emit an empty sourcepath as it would break
7177
// compilation of modules.
7278
task.options.setSourcepath(sourceSet.java.sourceDirectories)

lucene/CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,11 @@ Bug Fixes
278278
Build
279279
---------------------
280280

281+
* GITHUB#12742: JavaCompile tasks may be in up-to-date state when modular dependencies have changed
282+
leading to odd runtime errors (Chris Hostetter, Dawid Weiss)
283+
281284
* GITHUB#12612: Upgrade forbiddenapis to version 3.6 and ASM for APIJAR extraction to 9.6. (Uwe Schindler)
285+
282286
* GITHUB#12655: Upgrade to Gradle 8.4 (Kevin Risden)
283287

284288
Other

0 commit comments

Comments
 (0)