-
-
Notifications
You must be signed in to change notification settings - Fork 884
Apply cache-fix plugin from convention plugins #1262
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, I just did the same thing locally. Thanks!
gradle/libs.versions.toml
Outdated
@@ -28,7 +29,7 @@ android-application = { id = "com.android.application", version.ref = "agp" } | |||
android-library = { id = "com.android.library", version.ref = "agp" } | |||
android-lint = { id = "com.android.lint", version.ref = "agp" } | |||
android-test = { id = "com.android.test", version.ref = "agp" } | |||
cacheFixPlugin = { id = "org.gradle.android.cache-fix", version = "2.7.1" } | |||
cacheFixPlugin = { id = "org.gradle.android.cache-fix", version.ref = "cache-fix-plugin" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a bit of duplication here, the convention plugins use this same ID. I can also use the version catalog in the convention plugins to read its ID, but I think eventually we should be able to remove these plugins from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, or maybe I'm wrong. Let me clean this up a bit, I actually don't need that compileOnly
dependency on this plugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I removed the dependency on the plugin. I still have the plugin id duplication, I think it's fine for now, we do it for the android application, library and multiplatform plugins as well. I want to play around with it a bit more to find a more elegant way, but otherwise I'll send a separate PR to use the version catalog. Will look something like this
with(target) {
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
with(pluginManager) {
apply(libs.findPlugin("android-application").get().get().pluginId)
apply(libs.findPlugin("cacheFixPlugin").get().get().pluginId)
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think I found a way to avoid the plugin ID duplication 🙂 But we can go ahead and merge this PR, I'm waiting for some answers on that solution, I'll follow up with another PR
Heh, sorry that I couldn't send this earlier 🙂 |
Head branch was pushed to by a user without write access
1eedf97
to
5204df1
Compare
No description provided.