Skip to content

[Bug]: spotlessInstallGitPrePushHook task fails if configuration cache is enabled. #2585

@jsoberg

Description

@jsoberg

The spotlessInstallGitPrePushHook task fails when configuration cache is enabled for a project, showing something similar to the following error message:

1 problem was found storing the configuration cache.
- Task `:app:spotlessInstallGitPrePushHook` of type `com.diffplug.gradle.spotless.SpotlessInstallPrePushHookTask`: invocation of 'Task.project' at execution time is unsupported with the configuration cache.
  See https://docs.gradle.org/9.0.0/userguide/configuration_cache_requirements.html#config_cache:requirements:use_project_during_execution
  
  ...
  
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:spotlessInstallGitPrePushHook'.
> Invocation of 'Task.project' by task ':app:spotlessInstallGitPrePushHook' at execution time is unsupported with the configuration cache.

This is from referencing project during the install task's execution step. I have a fix that I'll be putting a PR up for, just wanted to track it here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions