Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Publish plugin on Gradle Plugin Portal #300

Closed
IRus opened this issue Nov 3, 2018 · 19 comments
Closed

Publish plugin on Gradle Plugin Portal #300

IRus opened this issue Nov 3, 2018 · 19 comments

Comments

@IRus
Copy link

IRus commented Nov 3, 2018

Plugin not available through gradle plugins block.

Existing workaround https://docs.gradle.org/current/userguide/plugins.html#example_plugin_resolution_strategy

@Petikoch
Copy link

+1 from me

Please Google Engineers add your plugin to https://plugins.gradle.org/

Benefit:

Instead of the current ceremony...

buildscript {
    repositories {
        jcenter()      
        mavenCentral()
    }
    dependencies {
        classpath("com.google.cloud.tools:appengine-gradle-plugin:2.+")
    }
}
apply(plugin = "com.google.cloud.tools.appengine")

just...

plugins {
    id("com.google.cloud.tools.appengine") version "2.+"
}

... for the user.

@arashbi
Copy link

arashbi commented Aug 9, 2019

It is really hard to get it working. I spent an our trying to make it work with kts until I found this. Funny to find my solution in a bug report!

@loosebazooka
Copy link
Contributor

yeah it might take a moment, the plugin makes some assumptions about plugin loading order than need to be worked out.

@saschpe
Copy link

saschpe commented Aug 21, 2019

If publishing to the Gradle plugin portal isn't feasible it can still go into the google() Maven repository as long as Gradle's plugin {} DSL is supported. This way the plugin could be used like:

// build.gradle.kts
plugins {
    id("com.google.cloud.tools.appengine") version "2.+"
}

// settings.gradle.kts
pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
    }
}

@rock3r
Copy link

rock3r commented Jun 22, 2020

@loosebazooka any news?

@loosebazooka
Copy link
Contributor

Slow to pull the trigger here. Sonatype/maven-central provide us with download metrics and they are useful in determining (for us) the amount of time to invest in projects, the gradle plugin portal maintainers haven't updated their download data in a while, and don't seem to have any obvious plans of offering it. We are waiting on that, however we could still update the plugin to use the right apis.

@rock3r
Copy link

rock3r commented Jun 23, 2020

That'd be a great first step for sure. You may want to reach out to the Android Studio team, they have a direct line with Gradle and may help you out there :)

@loosebazooka
Copy link
Contributor

This should be fixed in 2.4.1.

@loosebazooka
Copy link
Contributor

while 2.4.1 is the minimum required to make this work with gradle's plugin block, I think we can do a little more to avoid having to define a resolutionStrategy.

@rock3r
Copy link

rock3r commented Sep 22, 2020

Great news, thanks @loosebazooka :) I don't see it on the Gradle Plugins portal though.

Surely not having to declare a resolutionStrategy would be great, too. You may also want to update the readme to mention you can now use the 2.4.1+ version from the Gradle Plugins repo. Maybe add a badge, too:

[![Maven metadata URL](https://img.shields.io/maven-metadata/v?label=Plugin&metadataUrl=https%3A%2F%2Fplugins.gradle.org%2Fm2%2Fcom%2Fgoogle%2Fcloud%2Ftools%2Fappengine%2Fmaven-metadata.xml)](https://plugins.gradle.org/plugin/com.google.cloud.tools.appengine)

(Assuming you kept the ID com.google.cloud.tools.appengine and that the plugin was actually published on plugins.gradle.com

@loosebazooka
Copy link
Contributor

loosebazooka commented Sep 25, 2020

Yeah it's not in the gradle plugins portal. See rationale here(as much as one might disagree): #300 (comment)

I'm looking at trying to make it so that we don't HAVE to use resolution strategy, but that would involve some changes to our release process that are not ready.

Docs here for now: https://github.com/GoogleCloudPlatform/app-gradle-plugin#using-plugins-block

@rock3r
Copy link

rock3r commented Sep 25, 2020

Ah I thought when you said "it's done" you meant publishing on the plugins portal, as that's what the issue was originally about :) My bad, misunderstood the meaning.

@loosebazooka
Copy link
Contributor

Sorry, yeah, I may have missed a few details when I first commented.

@vlsi
Copy link
Contributor

vlsi commented Feb 14, 2021

@loosebazooka , I'm not sure if you aware, however, Gradle plugins can be used without "resolution strategy" in case they have a special-named artifact.

In order for com.google.cloud.tools.appengine plugin to work with plugins { id("com.google.cloud.tools.appengine") version ...} syntax you need to publish groupId=com.google.cloud.tools.appengine, artifactId=com.google.cloud.tools.appengine.gradle.plugin artifact that would include com.google.cloud.tools:appengine-gradle-plugin dependency.

Note: Gradle Plugin Portal proxies requests to jcenter/mavenCentral, so the end-users won't need to add repositories to resolve the plugin.

Here's a sample: https://search.maven.org/artifact/com.github.autostyle/com.github.autostyle.gradle.plugin/3.1/pom

Relevant documentation: https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers

@loosebazooka
Copy link
Contributor

Right, I guess we just haven't gotten to it. Updating the plugin release process is something we need to do.

If I recall correctly, gradle publishes the xyz.gradle.plugin as a simple pom with a single dependency that is the full artifact?

I think what we would do is just publish the artifact to both artifact ids? Or have some two step publish to maven central?

@vlsi
Copy link
Contributor

vlsi commented Feb 14, 2021

If I recall correctly, gradle publishes the xyz.gradle.plugin as a simple pom with a single dependency that is the full artifact?

That is right.

Or have some two step publish to maven central?

I see you use net.researchgate.release, and I am not sure if it supports pushing multiple publications from a single project.
However, adding a plugin marker subproject would probably do the trick (see https://github.com/researchgate/gradle-release#multi-project-builds )

@loosebazooka
Copy link
Contributor

What about the sonatype release? Two separate workflows? Not sure that they allow you to upload a single bundle with separate artifact ids?

@vlsi
Copy link
Contributor

vlsi commented Feb 14, 2021

@loosebazooka , as I understand you do not want to publish to Gradle Plugin Portal, so would you please close the issue?
I've filed GoogleCloudPlatform/appengine-plugins#1004 for publishing plugin markers

@diegomarquezp
Copy link

Closing as not planned.

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

No branches or pull requests

8 participants