[GRADLE-3428] Incremental Java compilation changing static final field does not always trigger re-compilation of dependent classes Created: 05/Apr/16 Updated: 10/May/16 Resolved: 10/May/16 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 2.11 |
Fix Version/s: | 2.14-rc-1 |
Type: | Bug | ||
Reporter: | Eric Wendelin | Assignee: | Eric Wendelin |
Resolution: | Fixed | Votes: | 0 |
Attachments: | IncrementalJava.jar SimpleIncrementalIssue.jar | ||||||||
Issue Links: |
|
Description |
From Jerome Dochez @ Google:
|
Comments |
Comment by Eric Wendelin [ 07/Apr/16 ] |
I found a small problem with the example that causes the problematic behavior. I’ve highlighted the mismatch that, when corrected, allows Java incremental compilation to behave “correctly”. If one removes the extra java/ dir or changes the sourceSet sourceDir to ‘src/java/java’, then only changing the static final field in DepTwo correctly updates the Main.class put in build/libs/IncrementalJava-1.0-SNAPSHOT.jar and the new value is output when running Main. File tree contained in the IncrementalJavaCompile.jar build.gradle } |
Comment by Eric Wendelin [ 07/Apr/16 ] |
I consider this behavior of Gradle unexpected, so I have opened a new issue that suggests we warn users given a scenario like this: https://issues.gradle.org/browse/GRADLE-3431 |
Comment by Eric Wendelin [ 07/Apr/16 ] |
Based on my comments on this issue. I'm told there is a more complicated case where incremental java compilation fails. I'd love to hear more and have a complete example to look into there. If we get that, then we should reopen this issue. |
Comment by Eric Wendelin [ 20/Apr/16 ] |
Jerome provided a new example that does not work as intended |