play-services-plugins
play-services-plugins copied to clipboard
Fully support standard Gradle plugins block
Describe the bug It appears that it is still necessary to use the antiquated style of loading oss-licenses-plugin via a buildscript classpath definition in the project root build.gradle, instead of the standard plugins block.
This is what I'd expect to use in project root build.gradle, similar to how I'd apply the plugin at the module level as described here: https://developers.google.com/android/guides/opensource#add-gradle-plugin
buildscript {
repositories {
google()
}
}
plugins {
id("com.google.android.gms.oss-licenses-plugin") version("0.10.5") apply(false)
}
However this produces an error:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.google.android.gms.oss-licenses-plugin', version: '0.10.5', apply: false] was not found in any of the following sources:
Instead I still have to use
buildscript {
repositories {
google()
}
dependencies {
classpath("com.google.android.gms:oss-licenses-plugin:0.10.5")
}
}
Gradle 7.4.2 Android Gradle plugin 7.1.3
Link #50, still blocking on #222, provide a workaround, you can configure a resolutionStrategy in settings.gradle like:
pluginManagement {
repositories {
google()
}
resolutionStrategy {
eachPlugin {
if (requested.id.id == "com.google.android.gms.oss-licenses-plugin") {
useModule("com.google.android.gms:oss-licenses-plugin:${requested.version}")
}
}
}
}