Skip to content

spotlessIdeHook and configuration cache #1082

Closed

Description

@nedtwigg

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.

Activity

  1. nedtwigg commented on Jan 18, 2022

    @nedtwigg
    MemberAuthor

    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.

  2. lehmanju commented on May 6, 2024

    @lehmanju

    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.

  3. nedtwigg commented on May 23, 2024

    @nedtwigg
    MemberAuthor

    Yes, #1274 will fix this.

  4. lehmanju commented on Sep 19, 2024

    @lehmanju

    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.
    
  5. added a commit that references this issue on Oct 24, 2024
    236f480
  6. nedtwigg commented on Oct 24, 2024

    @nedtwigg
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions