Skip to content
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

Fully support standard Gradle plugins block #223

Closed
bubenheimer opened this issue Apr 16, 2022 · 2 comments
Closed

Fully support standard Gradle plugins block #223

bubenheimer opened this issue Apr 16, 2022 · 2 comments

Comments

@bubenheimer
Copy link

bubenheimer commented Apr 16, 2022

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

@Goooler
Copy link

Goooler commented Sep 3, 2022

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}")
            }
        }
    }
}

@emartynov
Copy link

Great! Thank you for the workaround.

Here the plugin documentation how to publish the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants