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
Configuration Cache support #666
Comments
Compatibility would require a rewrite to use per-project tasks and a root-level accumulator task (similar to jacoco). PRs are appreciated if someone wants to work on that. Instead we mark the task as not compatible so that the configuration cache ignores our task and lets you get the benefits in other builds. |
Technically I think, that ignoring these plugin tasks until I call it is entirely enough. Because the most important is build speed during development and nobody actually needs to call this plugin as often as build&run operation. When you really want to check version updates, it is not so important that it will take a little bit longer. Currently, last released version has this in the changelog
So why does Android studio still display the warning that this plugin is blocking to use of compilation cache? And there is also one possible workaround. It is possible detect that gradle is invoked from Android Studio IDE by this function
So you can apply the plugin only when the project is not invoked from IDE. |
We would have to rewrite parts of this plugin to not pass |
Testing upgrade to Gradle 8.1 RC1:
One oddity here, without Reproducer with |
Testing with Gradle 8.1 RC2:
It would be nice to be able to set Reproducer: https://github.com/sdkotlin/sd-kotlin-talks/tree/929b0ccfd607bb41019cce34accd4abf94f35408. Should I file a separate issue for it, since it's not the same thing as full support for the configuration cache? |
I don't think there is any problem here? The task is correctly declaring that it does not support the configuration cache, which violates the idiom by spamming the logs regardless (gradle/gradle#24435). You can suppress this noise using A rewrite to support the configuration cache is more invasive. As a ten year old weekend project, I don't think myself or others are really up for that, especially since the Gradle/Github folks are discussing improvements for use by dependabot. I'd like to see if the Gradle team adds direct support or engineers a preferred solution. If not, then I think they would not break compatibility due to the need for this type of plugin, so it becomes hard to really justify the work involved given everyone contributes in their limited free time. If someone feels really passionate and sends a PR then I am always happy to review and add another wonderful contributor & maintainer. |
I'd expect the plugin to still print available updates even if |
Then that sounds like a Gradle bug if it broke between 8.0 and 8.1? I upgraded and ran it on Caffeine where the report came out as expected. I'll try yours when I get some downtime, but I think you should report your findings for the Gradle team to hopefully fix during the RC process. |
Running your reproducer and I think you should open a Gradle issue. I see that passing I am still trying to reproduce it outside of the plugin to understand where it deviates. I will likely have to build a custom version with logging to see where it breaks down, since it is very obscure. Can you start a conversation with the Gradle folks? |
subprojects {
tasks {
register("allConfigurationDependencies") {
notCompatibleWithConfigurationCache("incompatible")
doLast {
project.configurations
.forEach { conf ->
conf
.allDependencies
.forEach { dep ->
System.out.println(conf.name + ":\t" + dep.name)
}
}
}
}
}
} That will print out the dependencies when the configuration cache is disabled or if performed within an The This is a regression in the build tool. |
Hacking up your build, and I believe the configuration cache is buggy when crossing the includeBuild boundary. If I add a dependency in
hope that helps. |
Thanks for looking into the "No dependencies" issue! Initial comment posted to gradle/gradle#24411 (comment). |
Filed gradle/gradle#24636. |
Stacktrace
This is the error I get |
Got this warning in Android Studio's build analyzer:
Is it possible to use configuration cache with this plugin?
The text was updated successfully, but these errors were encountered: