Print the plugin version gradle consumes with a conv
I have a convention plugin tv.twitch.gradle.plugins.android-library
that defines all of our android {}
defaults. It naturally depends on com.android.library
: tv.twitch.gradle.plugins.android-library.build.kts
:
plugins {
...
id("com.android.library")
...
}
android {
...
}
We have a similar convention plugin for com.android.application
.
We define the version for com.android.application
in our lib.versions.toml
:
[versions]
...
agp = "8.5.2"
...
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
...
I just noticed that we don’t define a version for com.android.library
anywhere. How can I find its version?
I tried using the buildEnvironment
task:
classpath
+--- com.android.test:com.android.test.gradle.plugin:8.5.2
...
+--- tv.twitch.gradle.plugins.android-app:tv.twitch.gradle.plugins.android-app.gradle.plugin:1.13
| \--- tv.twitch:plugins:1.13
| +--- org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23 -> 1.9.25 (*)
| +--- com.android.tools.build:gradle:8.5.2 (*)
| +--- org.jlleitschuh.gradle:ktlint-gradle:12.1.1
| +--- org.gradle.android.cache-fix:org.gradle.android.cache-fix.gradle.plugin:3.0
| | \--- gradle.plugin.org.gradle.android:android-cache-fix-gradle-plugin:3.0
| | \--- com.google.guava:guava:32.1.3-jre (*)
| +--- org.barfuin.texttree:text-tree:2.1.2 (*)
| \--- org.jetbrains.kotlinx:kover:0.6.1
+--- tv.twitch.gradle.plugins.android-library:tv.twitch.gradle.plugins.android-library.gradle.plugin:1.13
| \--- tv.twitch:plugins:1.13 (*)
And this makes sense because we these are the dependencies we declare in the dependencies {}
of the tv.twitch:plugins
project. How do I resolve the version of com.android.library
that tv.twitch.gradle.plugins.android-library:tv.twitch.gradle.plugins.android-library.gradle.plugin
will consume?
Source: View source