google-java-format-gradle-plugin
google-java-format-gradle-plugin copied to clipboard
VerifyGoogleJavaFormat task is not cacheable
To speed up CI builds for multi-module builds, it would help if VerifyGoogleJavaFormat was made cacheable. https://docs.gradle.org/current/userguide/build_cache.html#enable_caching_of_non_cacheable_tasks
We have an internal caching mechanism that is more efficient than what would be possible with Gradle's inputs/outputs based caching approach. Since we format source files, our inputs and outputs are the same. If we run the formatting task and something changes, Gradle would consider the task not up-to-date on a second run. We do (the task is run, but it's a no-op)!
Also have a look at UpToDateSpec.groovy.
Also see https://github.com/sherter/google-java-format-gradle-plugin/issues/18.
That is all good and well, but I was referring to CI builds (clean builds, as per Gradle recommendations), in which I believe your caching mechanism does not come into play.
That's probably right. This whole distributed build cache thing came after this plugin was conceived. I'll have to look into this...