Incremental java compilation is successful when classname with $ is renamed (as it is with Gradle 7.2 and earlier versions)
After changing java class name with $ character and running incremental build we get the error:
> Task :compileJava FAILED
Caching disabled for task ':compileJava' because:
Build cache is disabled
Task ':compileJava' is not up-to-date because:
Input property 'stableSources' file .../src/main/java/issue/Class$Name.java has been removed.
Input property 'stableSources' file .../src/main/java/issue/Main.java has changed.
Input property 'stableSources' file .../src/main/java/issue/Class$NameChanged.java has been added.
Created classpath snapshot for incremental compilation in 0.0 secs.
Compiling with toolchain '/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home'.
Compiling with JDK Java compiler API.
.../src/main/java/issue/Main.java:5: error: cannot find symbol
symbol: class Class$NameChanged
location: class Main
Incremental compilation of 3 classes completed in 0.012 secs.
:compileJava (Thread[Execution worker for ':',5,main]) completed. Took 0.02 secs.
FAILURE: Build failed with an exception.
On our real world Android-project we had a very harmful impact from this issue when upgrading Gradle version to 7.3.1.
Incremental annotation processor in our project generates some files with dollar sign and this issue silently led us to ClassNotFoundException at runtime in some cases.
It's very serious blocker for us to upgrade from 7.2.
@asodja, thanks for fixing this issue so quickly!
On real project we faced this issue with annotation processor from Toothpick library.
I also have a more complex reproducer with annotation processor from Toothpick. It's very close to our real project issue. See README from this sample for details.
Thank you for that info. Note that the fix is already on the latest nightly. Can you maybe try it and confirm that that fixes the issue? Here is the info on how you can update the wrapper: https://gradle.org/nightly/