Gradle - recompile single file options
Hi
I think i'm seeing an issue when using gradle as build tool with the gradle build cache turned on.
When I'm debugging the application and change a single file I can choose Build | Recompile <file>, this works fine and the class gets hotswapped into the application. However, if I revert the change and again choose Build | Recompile <file>, gradle will (understandably) use the build cache and just extract the cache entry for that prroject. This leads to several class files being updated and the hotswap will try to load these, but fails due to some of the classes can't be hotswapped.
Is it possible to configure the Build | Recompile <file> option with the gradle switch --no-build-cache so the reuse og the build cache can be avoided? Or is there perhaps a better way?
Thanks,
-Aske
Please sign in to leave a comment.
Looks like the same report here https://youtrack.jetbrains.com/issue/IDEA-260587
Does it help to disable Gradle cache via the
in gradle.properties file?
Also could you please tell - will the hotswap work if you switch to IntelliJ IDEA for the Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Gradle | Build and run using: option?
Yeah, disabling the cache works, but file is checked into version control, and somebody will probably commit it with the 'false' setting, so this seems like a poor workaround.
IntelliJ can't build our gradle project as it can't import the different subprojects with correct classpaths.