diffplug / spotless

Keep your code spotless
Apache License 2.0
4.49k stars 455 forks source link

spotlessIdeHook and configuration cache #1082

Open nedtwigg opened 2 years ago

nedtwigg commented 2 years ago

The spotless IDE hook is incompatible with the configuration cache, see https://github.com/ragurney/spotless-intellij-gradle/issues/18 for an example and stacktrace. Workaround for now is to specify --no-configuration-cache when using spotlessIdeHook.

nedtwigg commented 2 years ago

Initially, both the vscode and intelliJ plugins fixed this by adding --no-configuration-cache to their command lines:

Unfortunately, for Gradle < 6.6, this flag is unrecognized and throws an exception

The VSCode plugin is trying to fix this by parsing and detecting the version, another way is to test it on first run, detect the error, then try again without that flag.

lehmanju commented 5 months ago

Would #1274 resolve this issue, if the configuration cache is natively supported and the current workaround with JvmLocalCache is removed?

We have several large projects which require a few minutes in the configuration phase. A fast IDE hook which makes use of the cache and doesn't invalidate it would be nice.

nedtwigg commented 4 months ago

Yes, #1274 will fix this.

lehmanju commented 2 weeks ago

With 7.0.0.BETA2 I get following error (running spotlessIdeHook with configuration cache enabled):

spotlessApply` of type `org.gradle.api.DefaultTask`: cannot serialize object of type 'com.diffplug.gradle.spotless.SpotlessTaskImpl', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.