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

Allow user-supplied plugin resolution rewriting rules #293

Open
grodin opened this issue Nov 20, 2020 · 0 comments
Open

Allow user-supplied plugin resolution rewriting rules #293

grodin opened this issue Nov 20, 2020 · 0 comments

Comments

@grodin
Copy link

grodin commented Nov 20, 2020

This isn't quite a bug report but could be a feature request.

I have a settings.gradle.kts looking like this:


pluginManagement {
    resolutionStrategy {
        val pluginIdToCoordinates = mapOf(
            "com.google.gms.google-services" to "com.google.gms:google-services"
        )
        eachPlugin {
            pluginIdToCoordinates[requested.id.id]?.also { useModule(it) }
        }
    }
    repositories {
        gradlePluginPortal()
        google()
    }
}
buildscript {
    repositories {
        gradlePluginPortal()
    }
    dependencies {
        classpath("de.fayard.refreshVersions:refreshVersions:0.9.7")
    }
}

bootstrapRefreshVersions()

which enables applying the Google services Gradle plugin from a plugins block, e.g.:

plugins {
         id("com.google.gms.google-services").apply(false).version("4.3.3")
}

to workaround the fact that Google refuses to correctly publish their Gradle plugins.

Unfortunately, this requires me to request a version, negating the use of refreshVersions for only the Google services plugin.

Digging into the bootstrapRefreshVersionsCore() function and then into setupRefreshVersions() I can see some special casing for the Android plugins which achieves the same thing as what I've done in pluginManagement above.

I'd like to request some mechanism whereby a similar thing to the Android special casing could be done when calling bootstrapRefreshVersions, or else some suggestion to solve the problem I'm having. I know I can workaround it by just declaring a buildscript dependency, and that's what I will probably do, but it's slightly annoying that I can't get this one plugin to work with refreshVersions!

The root problem is, as I said, Google seems to not be interested in publishing plugin marker artifacts, even on their own repository, and it's quite stupid that we all have to work around it, but I suppose that's what Google does!

Thanks for the work on this plugin, BTW. It's the best solution for managing versions I've seen yet, and is really useful.

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

1 participant