Skip to content
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

spotlessIdeHook and configuration cache #1082

Closed
nedtwigg opened this issue Jan 10, 2022 · 5 comments
Closed

spotlessIdeHook and configuration cache #1082

nedtwigg opened this issue Jan 10, 2022 · 5 comments
Labels

Comments

@nedtwigg
Copy link
Member

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

@nedtwigg
Copy link
Member Author

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

  • this is only needed if the user has enabled configuration cache with org.gradle.unsafe.configuration-cache=true in a gradle.properties somewhere
  • if the user has not enabled that flag there is no effect

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
Copy link

lehmanju commented May 6, 2024

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
Copy link
Member Author

Yes, #1274 will fix this.

@lehmanju
Copy link

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.

@nedtwigg
Copy link
Member Author

Should be fixed in 7.0.0.BETA4, let me know if you have any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants