javafx-gradle-plugin icon indicating copy to clipboard operation
javafx-gradle-plugin copied to clipboard

Publish Plugin on Gradle Plugins Portal

Open Nava2 opened this issue 8 years ago • 13 comments

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.

Nava2 avatar Jun 05 '17 21:06 Nava2

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.

FibreFoX avatar Jun 08 '17 14:06 FibreFoX

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.

JLLeitschuh avatar Aug 06 '17 21:08 JLLeitschuh

@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.

FibreFoX avatar Sep 07 '17 07:09 FibreFoX

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

JLLeitschuh avatar Sep 07 '17 13:09 JLLeitschuh

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

FibreFoX avatar Sep 07 '17 15:09 FibreFoX

@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.

Nava2 avatar Sep 07 '17 15:09 Nava2

@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.

FibreFoX avatar Sep 07 '17 17:09 FibreFoX

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.

Nava2 avatar Sep 07 '17 18:09 Nava2

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

JLLeitschuh avatar Sep 07 '17 18:09 JLLeitschuh

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.

renatoathaydes avatar Oct 05 '17 21:10 renatoathaydes

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.

FibreFoX avatar Oct 05 '17 21:10 FibreFoX

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

aalmiray avatar Mar 22 '18 16:03 aalmiray

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

kb-1000 avatar Aug 14 '18 13:08 kb-1000