New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incremental Java compile fails when empty source folders are removed #8197
Comments
It seems like this issue is already in 4.10.1 and 5.0. Allowing to remove the underlying directory without changing the configuration should be fixed by #8200. Do you need to be able to do such a workaround if the original issue is fixed? |
I was hoping that the above quick fix would work but I'm running into yet another issue: Gradle sees an added empty directory (without any source files) and assumes that the directory is a resource and then disables incremental compile with this message: "Full recompilation is required because A resource changed." (I'm working on a reproducible project, but it's not too easy...) I will see if we can work around that issue too, otherwise we'll need to wait for 5.1.1. When do you think 5.1.1 will be available? |
5.1.1 should go out this week. |
Great, it may be better to wait for it then. |
FYI, I managed to reproduce the issue with |
I'll close this issue, given that the original problem has been fixed and the code you show in the plugin above should not be something we require users to do. |
The fact that Gradle looks for a previously deleted file in the current source folders looks incorrect to me and I feel it may hide some latent issues. But I agree that the setup in the sample project is not common. |
Environment
Gradle 5.1
Steps to Reproduce
The project has this custom Java compile task:
./gradlew customJavaCompileTask
, it should succeed.src/main/java2/GradleBug/Library2.java
../gradlew customJavaCompileTask -s
, it fails with:Expected Behavior
Incremental build should succeed.
Context
To work around #8194, in the Android Gradle plugin, we had to remove empty source folders from the inputs of the Java compile task. However, we now run into the above issue.
One way to work around both issues for us is to still register all source folders with Gradle, but create directories at non-existent paths before registering.
The text was updated successfully, but these errors were encountered: