The point of notCompatibleWithConfigurationCache("Uses Project at execution time") is to tell Gradle that, if a user tries to run this task with the flag org.gradle.unsafe.configuration-cache=true set, then that flag should be ignored. Without that method call, then Gradle would instead fail the build. This lets users say they want CC on by default, while gracefully falling back to having it off for tasks that aren't compatible. Otherwise, they'd have to remember it doesn't work for tasks X, Y, and Z, and manually use --no-configuration-cache, which is annoying.
As an aside, something weird is happening with this project's .gitignore files. I had to manually add both files in the utils package.
git add dependency-guard/src/main/kotlin/com/dropbox/gradle/plugins/dependencyguard/internal/utils/GradleVersion.kt
The following paths are ignored by one of your .gitignore files:
dependency-guard/src/main/kotlin/com/dropbox/gradle
hint: Use -f if you really want to add them.
hint: Turn this message off by running
hint: "git config advice.addIgnoredFile false"
I think it's the gitignore rule to ignore simply gradle.
Resolves https://github.com/dropbox/dependency-guard/issues/4.
See https://docs.gradle.org/current/userguide/configuration_cache.html for more information.
The point of
notCompatibleWithConfigurationCache("Uses Project at execution time")
is to tell Gradle that, if a user tries to run this task with the flagorg.gradle.unsafe.configuration-cache=true
set, then that flag should be ignored. Without that method call, then Gradle would instead fail the build. This lets users say they want CC on by default, while gracefully falling back to having it off for tasks that aren't compatible. Otherwise, they'd have to remember it doesn't work for tasks X, Y, and Z, and manually use--no-configuration-cache
, which is annoying.As an aside, something weird is happening with this project's .gitignore files. I had to manually add both files in the
utils
package.I think it's the gitignore rule to ignore simply
gradle
.