ruler icon indicating copy to clipboard operation
ruler copied to clipboard

Please publish to Gradle Plugin Repository

Open chrisjenx opened this issue 2 years ago • 3 comments

Feature description

Please publish to Gradle plugin repo so we can use id correctly. Or correct the plugin name so it can be resolved correctly: com.spotify.ruler:com.spotify.ruler:version

Thanks!

Reasoning

Work around:

settings.gradle.kts

pluginManagement {
    resolutionStrategy {
        eachPlugin {
            //https://github.com/spotify/ruler/issues/85
            if (requested.id.id == "com.spotify.ruler") {
                useModule("com.spotify.ruler:ruler-gradle-plugin:1.3.0")
            }
        }
    }
}

chrisjenx avatar Aug 09 '22 00:08 chrisjenx

Thanks for opening this issue! IIRC the reason why we didn't do this in the first place was that the Gradle plugin portal didn't allow us to publish artifacts in additon to the plugin (which we need to - see ruler-models). Maybe we didn't look hard enough or maybe this is possible now, do you know?

Another practical reason was that Spotify already has an account on Maven central and uses that for all OSS projects, so it was nice to keep everything in a central place (and using it from there is totally possible). Not sure if that's a strong reason, but we'd need to set up a corporate account for the plugin portal before we can publish it and I'm not sure how high of a priority this would have (since I'm no longer at Spotify - maybe @ViktorPetrovski or @botronic can check that if it's deemed important enough).

simonschiller avatar Aug 09 '22 17:08 simonschiller

Another way to fix (Which is what we do internally) is correct the group and package name, for example we have internal plugins (obviously not published Gradle Repo).

Example:

create("lintPlugin") {
  id = "com.instacart.shopper.tooling.lint"
  //...
}

We set the groups to match the base id name:

allprojects {
    it.group = "com.instacart.shopper.tooling"

When you upload this it looks a bit weird but it means gradle can resolve this correctly: image

Now in our main repo we can consume them correctly:

id("com.instacart.shopper.tooling.lint).version(...)

Hope that helps :)

chrisjenx avatar Aug 09 '22 17:08 chrisjenx

Hey @chrisjenx , thanks for bringing this up. Feel free to open a PR with your suggested changes and we will review it.

botronic avatar Sep 07 '22 13:09 botronic