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

Publish Plugin on Gradle Plugins Portal #69

Open
Nava2 opened this issue Jun 5, 2017 · 13 comments
Open

Publish Plugin on Gradle Plugins Portal #69

Nava2 opened this issue Jun 5, 2017 · 13 comments

Comments

@Nava2
Copy link

Nava2 commented Jun 5, 2017

Could the plugin be published to the Gradle Plugin Portal?

I apologize if this has been asked before, I could not find reference to it.

@FibreFoX
Copy link
Owner

FibreFoX commented Jun 8, 2017

Will have to look into the up2date documentation from gradle. Last time I checked I didn't understood the IDs and such stuff ;) meanwhile just use the maven-central way.

@JLLeitschuh
Copy link

I did this for my plugin and it's pretty straight forward. You just need to create an account and the rest of the docs are pretty straight forward from there.

@FibreFoX FibreFoX added this to the v9.0.0 milestone Aug 15, 2017
@FibreFoX
Copy link
Owner

FibreFoX commented Sep 7, 2017

@JLLeitschuh Maybe some gradle-experts here could help me a bit: as far as I understood this correctly, I have to add something like this so my build.gradle-file, dont I?

pluginBundle {
    website = 'https://github.com/FibreFoX/javafx-gradle-plugin'
    vcsUrl = 'https://github.com/FibreFoX/javafx-gradle-plugin'
    description = 'The JavaFX Gradle Plugin provides a way to to assemble distributable bundles for JavaFX applications from within Gradle. It provides a wrapper around the JavaFX packaging tools which are provided as part of the JavaFX installation.'
    tags = ['javafx', 'javapackager', 'native', 'distribution']
    
    plugins {
        javafxGradlePlugin {
            id = 'de.dynamicfiles.projects.gradle.plugins.javafx-gradle-plugin'
            displayName = 'JavaFX Gradle Plugin'
        }
    }
    
    mavenCoordinates {
        groupId = 'de.dynamicfiles.projects.gradle.plugins'
        artifactId = 'javafx-gradle-plugin'
    }
}

So when publishing to gradle, I need to have the file src/main/resources/META-INF/gradle-plugins/javafx-gradle-plugin.properties being renamed to src/main/resources/META-INF/gradle-plugins/de.dynamicfiles.projects.gradle.plugins.javafx-gradle-plugin.properties, which will need all build-scripts having to apply a different plugin-name:

apply plugin: 'de.dynamicfiles.projects.gradle.plugins.javafx-gradle-plugin'

Did I miss something? As the gradle-plugin-mechanism wasn't stable/was incubating, there was no intention of me to put any afford into this, but as this now got mostly stable, there is some documentation missing from the Gradle-team themselves.

@JLLeitschuh
Copy link

This is all the code that I needed (this is using Gradle Kotlin script, not groovy)
https://github.com/JLLeitschuh/ktlint-gradle/blob/master/build.gradle.kts#L37-L49

@FibreFoX
Copy link
Owner

FibreFoX commented Sep 7, 2017

Thats the source I got some inspiration already, thanks. Next Release will be prepared for Gradle plugin Portal

@Nava2
Copy link
Author

Nava2 commented Sep 7, 2017

@FibreFoX here is how I do it in my plugin.

I use this block to publish to the portal via Travis on a tagged release.

Hope that is helpful, albeit late.

@FibreFoX
Copy link
Owner

FibreFoX commented Sep 7, 2017

@Nava2 seems pretty equal to my stuff posted above, thanks for verifying 👍 what bugs me a bit, is that I'm loosing that short and fancy javafx-gradle-plugin plugin id for the more ugly looking thing with package name etc, but I understand that naming-convention (to be honest, this was one of the reasons I didn't adapt to their plugin portal at first).

Even when being possible, I don't want to have my secret data being present anywhere else (private keys belong on two positions, on my system and on a secure backup position). Another thing might be that I need to compile this with Java 9, which isn't available on the CI-systems right now, mostly due to testing and that modules-info.java-file.

@Nava2
Copy link
Author

Nava2 commented Sep 7, 2017

For the secrets, the secrets are only for gradle. So it should be okay to leave it in the env vars on Travis. You could also just forgo the whole thing and publish yourself.

@JLLeitschuh
Copy link

You can test on travis under JDK 9.
Example:
https://github.com/gradle/kotlin-dsl/pull/455/files#diff-354f30a63fb0907d4ad57269548329e3R13

@renatoathaydes
Copy link

Hi, just wanted to say that while publishing the plugin on the Gradle portal might be nice, from a plugin's owner point-of-view it makes no sense as you lose statistics about downloads of your plugin, and it's not even very reliable and badly documented.

The only advantage would be that users don't need the buildScript block in their scripts.

@FibreFoX
Copy link
Owner

FibreFoX commented Oct 5, 2017

To be honest, I don't care about download-statistics, and to be honest too, even my own plugin is not well documented ;) maybe this plugin deserves to be on the gradle portal. Some developers just search for "javafx" and might find this very useful, so in terms of internet-visibility this might be something, but I only see the benefit of "just another place" for distribution.

@aalmiray
Copy link

I'll be happy to send a PR with the updates needed for this to happen 😄

@FibreFoX FibreFoX removed this from the v9.0.0 milestone Mar 30, 2018
@kb-1000
Copy link

kb-1000 commented Aug 14, 2018

@aalmiray please actually do so that I'm able to reference the plugin from there.

@FibreFoX FibreFoX added this to the project rework milestone Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants