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

diktat-gradle-plugin is not compatible with Gradle Configuration Cache #1732

Open
Tracked by #1806
illarionov opened this issue Sep 15, 2023 · 3 comments
Open
Tracked by #1806
Assignees
Labels
bug Something isn't working

Comments

@illarionov
Copy link

It would be nice to have Gradle Configuration Cache Support in diktat-gradle-plugin.
Now I get this error when running the :diktatCheck task wih Gradle Configuration Cache enabled:

2 problems were found storing the configuration cache, 1 of which seems unique.
- Task `:diktatCheck` of type `org.cqfn.diktat.plugin.gradle.DiktatJavaExecTaskBase`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.3/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

Diktat version: 1.2.5

@illarionov illarionov added the bug Something isn't working label Sep 15, 2023
@nulls nulls added this to the 2.0.0 milestone Sep 15, 2023
@nulls
Copy link
Member

nulls commented Sep 15, 2023

hi @illarionov, we will look into it in scope of diktat 2.0

@nulls nulls mentioned this issue Nov 16, 2023
3 tasks
@nulls nulls modified the milestones: 2.0.0, 2.0.1 Nov 17, 2023
@nulls nulls removed this from the 2.1.0 milestone Dec 19, 2023
@ForsHant
Copy link

ForsHant commented Jan 12, 2024

For the time being, it is possible to add:

tasks.named("diktatFix") {
    notCompatibleWithConfigurationCache("https://github.com/saveourtool/diktat/issues/1732")
}

to your build.gradle. Which obviously doesn't provide support for configuration cache. But at least, allows gradle to run it

@nulls maybe you should consider this adding this as workaround for people with configuration cache enabled. As it stops from using diktat in some configurations. For example, in mine, I run formatter on every build

@nulls
Copy link
Member

nulls commented Jan 15, 2024

For the time being, it is possible to add:

tasks.named("diktatFix") {
    notCompatibleWithConfigurationCache("https://github.com/saveourtool/diktat/issues/1732")
}

to your build.gradle. Which obviously doesn't provide support for configuration cache. But at least, allows gradle to run it

@nulls maybe you should consider this adding this as workaround for people with configuration cache enabled. As it stops from using diktat in some configurations. For example, in mine, I run formatter on every build

@ForsHant thanks for a tip. Will add it to README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants