-
Notifications
You must be signed in to change notification settings - Fork 461
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
Undeclared build service deprecation when enabling stable configuration cache #1260
Comments
Fixed in |
I have complained a fair bit about the design of the configuration-cache And I've also had to ask a lot of questions about how to correctly use For one thing, you can't just register "this class is my one-per-build BuildService", and then ask for that using the class as the key anywhere in Gradle. You instead have to imperatively register the service, and pass the handle to that registered service around. spotless/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/RegisterDependenciesTask.java Lines 65 to 66 in 3878d36
And, you can't pass it as just a regular field. Any task that uses it must declare a magically-generated "property getter", as such: @Internal
public abstract Property<GitRatchetGradle> getGitRatchet(); The service then has to explicitly passed from spotless/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessTaskImpl.java Line 51 in 3878d36
Now, it turns out that is not enough boilerplate, you also have to call A SOoooooo, we had to add even more boilerplate
so that we have the magical I continue to love Gradle, and I continue to be super-duper flummoxed by the design of BuildServices and of ConfigurationCache. For each of these pieces, it would be good to be really clear about "what are the invariants", and "what is the key". IMO, for |
If you are submitting a bug, please include the following:
gradlew spotless[Apply/Check] --stacktrace
If you're just submitting a feature request or question, no need for the above.
Gradle 7.5 adds a new feature preview flag for stable configuration cache. When enabled, warnings appear due to Spotless' undeclared usage of
SpotlessTaskService
:https://docs.gradle.org/7.5/release-notes.html#new-stable_configuration_cache-feature-flag
You can see the warnings with a plugin I maintain. Specific Spotless configuration here: https://github.com/ciscoo/cxf-codegen-gradle/blob/master/buildSrc/src/main/kotlin/code-style-conventions.gradle.kts
The text was updated successfully, but these errors were encountered: