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

Gradle #177

Closed
Lewik opened this Issue Jan 1, 2016 · 25 comments

Comments

Projects
None yet
4 participants
@Lewik
Copy link

Lewik commented Jan 1, 2016

This is a question not an issue =)
I know that this plugin for maven, but I need (want) build javafx on gradle. Previously I used https://bitbucket.org/shemnon/javafx-gradle but it's old and I fouond that this project is "continuator".

So can I use this for gradle somehow?
Or may be you know javafx plugin for gradle? I can't google it.

@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 6, 2016

As this is a maven-only-plugin I'm afraid to not being able to anwes this. I myself am not using gradle, it doesn't feel like a good replacement for me. The gradle-plugin you mentioned might be a bit dead because it's contributer doesnt find time to develop it any further, even the github-hosted one seems dead.

Maybe you could call this using the Exec-part of this stackoverflow-answer: http://stackoverflow.com/a/19656234/1961102

@FibreFoX FibreFoX closed this Jan 6, 2016

@JustGregory-zz

This comment has been minimized.

Copy link

JustGregory-zz commented Jan 6, 2016

Actually, @FibreFoX I would have to answer in favor of Gradle, if only in that over the last year or so I have moved all my NetBeans projects over to using a Gradle buildscript system. I know next to nothing about this "maven" whereof you speak, and I don't have to, except in that Gradle supports the maven build structure quite well.

True, that bitbucket repo is a bit "stale"; but I guess the main reason I keep watching your repository here, is in hoping you would "upgrade" from pure-maven, to a Gradle buildscript....

@FibreFoX FibreFoX added the enhancement label Jan 7, 2016

@FibreFoX FibreFoX self-assigned this Jan 7, 2016

@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 7, 2016

@JustGregory the build structure might be supported/equal, but not the maven-plugin-support ;)

I'll reconsider re-creating the current plugin to have a working gradle-extension, but don't keep your hopes too high. I've never got quite green with gradle, but might be a nice project to try it again.

@FibreFoX FibreFoX reopened this Jan 7, 2016

@purringpigeon

This comment has been minimized.

Copy link

purringpigeon commented Jan 7, 2016

I am using this maven plug in (it works great), and would really like to move my projects to Gradle (seems to have huge following now)- so if I can add my vote to this enhancement. Thanks!

@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 10, 2016

To have everyone informed: I'm trying to get used to Gradle-plugin-writing, but I am not make good progress on that. 👍 But I'll try to give my best.

@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 10, 2016

The original author of the gradle-plugin (shemnon) isn't supporting that plugin anymore, so I'm going to try a re-implementation of that gradle-plugin which recycles more code from this maven-plugin. Could take a while, but I'm encouraged even more now 😄

@Lewik

This comment has been minimized.

Copy link
Author

Lewik commented Jan 10, 2016

@FibreFoX http://speling.shemnon.com/blog/2014/09/12/maven-javafx-plugin-8-dot-1-released/ I thought he with you

Anyway, after complete gradle plugin you should (even must =) ) tell about it to shenmon. And he'll post info about your plugin.

I am developing javafx application with gradle right now, so I'd like to test beta version of this plugin =)

I wrote gradle plugin for javafx already (it's too dirty code - not for public). So you can ask me about troubles.

@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 10, 2016

@Lewik This maven-plugin was developed by @zonski and a bit later maintained by @shemnon , but he didn't find any further time, so @zonski handed this project over to me. And because the gradle-plugin suffers from sparetime, that project is dead too.

My strugles about gradle are just that I really like maven. I do know that gradle has it's power, especially through groovy, and I don't want to start a maven-vs-gradle-fight, thats the reason I'm trying to make one myself.

Please let me some time to tinker that little gradle-thing ;)

@purringpigeon

This comment has been minimized.

Copy link

purringpigeon commented Jan 10, 2016

I think your maven plugin is excellent! Having a unified maven/gradle plugin would be great. That way we can rely on common feature sets across both. I hope your efforts go well. Thanks for giving it a shot.

@JustGregory-zz

This comment has been minimized.

Copy link

JustGregory-zz commented Jan 10, 2016

Yes, I will echo that sentiment, @FibreFoX . Most important to let you know our gratitude for your efforts, if -- no, even when so -- just outside your normal comfort zone. I am hoping for good things in this regard.

As far as that "My strugles about gradle are just that I really like maven", doesn't mean that you have to consider them diametrically opposed goals and solutions. I would hope they can be done in as synergistic a manner as may be possible.

@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 13, 2016

Just to ask you guys ... something like this build.gradle-file ... would this something you would suspect of a javafx-gradle-plugin?

buildscript {
    repositories {
        maven {
            url uri('../repo')
        }
    }
    dependencies {
        classpath group: 'not-yet-defined', name: 'javafx-gradle-plugin', version: '1.0-SNAPSHOT'
    }
}
apply plugin: 'java'
apply plugin: 'javafx-gradle-plugin'

jfx {
    verbose = true
    mainClass = 'com.something.notexisting'
    vendor = 'Not you'
}

I'm half way finished with the jfx:jar-goal inside that gradle-plugin.

@Lewik

This comment has been minimized.

Copy link
Author

Lewik commented Jan 13, 2016

@FibreFoX All ok for me

There are some way to minimize buildscript - "incubating, plugin mechanism introduced in Gradle 2.1" - it's necessary at the moment

@Lewik

This comment has been minimized.

Copy link
Author

Lewik commented Jan 13, 2016

It's better to have more options in jfx task. As much as possible %)

@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 13, 2016

@Lewik This was just a (for me working) sample, there will be full list of options like in javafx-maven-plugin.

👍 it's my very first thing I'm doing for production with Gradle, so you guys know, what you want a bit more than me :D

@purringpigeon

This comment has been minimized.

Copy link

purringpigeon commented Jan 13, 2016

I am not real sure on what all needs to be there but it's looking good to me.

On Jan 13, 2016, at 7:46 AM, Danny Althoff notifications@github.com wrote:

@Lewik This was just a (for me working) sample, there will be full list of options like in javafx-maven-plugin.

it's my very first thing I'm doing for production with Gradle, so you guys know, what you want a bit more than me :D


Reply to this email directly or view it on GitHub.

@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 13, 2016

I'm having good efforts right now .. if everything works as it does now, there should be a testable beta-version of the javafx-gradle-plugin on upcoming sunday. Configuration would work like with this maven-plugin. There will be no need to add the ant-javafx-dependency, as this would be done for you.

I'm nearly finished with the jfx:jar-goal ... the next bigger thing will be the jfx:native-goal.

😄 so stay tuned ;)

@JustGregory-zz

This comment has been minimized.

Copy link

JustGregory-zz commented Jan 14, 2016

Sounds good; I've got several uses for this plugin already waiting.

Edit:
To be fair, I haven't yet written a Gradle plugin, just tinkered with the typical buildscripts, so I'm at a loss too as to what writing a plugin itself entails. But as you are taking it a step at a time, I am certain you will be able to do it.

@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 14, 2016

@JustGregory no worries ;) I've never done buildscripts myself either 😄 currently I'm "fighting" with getting the dependency-jars for putting them into the lib-folder (and passing them to the javapackager). When I'm having something new for you, I'll comment that here!

@Lewik

This comment has been minimized.

Copy link
Author

Lewik commented Jan 14, 2016

@FibreFoX
I think you need some kind of fat jar or uber jar
Here is fragment of real build.gradle

repositories {
    flatDir {
        dirs 'libs' //aka path to jars folder
    }
}

// any code
dependencies {
    // any code
    compile name: 'sqljdbc4'  //jar-dependency. This is working example for sql driver
    // any code
}

//some king of fat jar
jar {
    from {
        (configurations.runtime).collect {
            it.isDirectory() ? it : zipTree(it)
        }
    }

    exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'

    manifest {
        attributes(
                'Main-Class': mainClassName
                 //and other attrs
        )
    }
}
@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 14, 2016

@Lewik I'll never do that kind of stuff ... this maven-plugin went that way long time before me by creating fat-jars ... and it failed. I don't tend to change the behaviour of the upcoming javafx-gradle-plugin from this maven-plugin. Everything will be created below the build/jfx/-folder.

In the meantime I found a nice way to have the dependencies working ;) but this is my spare-time project, not getting paid for.

Usable plugin will be provided in the next days, then you can beta-test that plugin and give further feedback. There will be its own github-repository so that every feedback doesn't go into the maven-plugin-thread.

@purringpigeon

This comment has been minimized.

Copy link

purringpigeon commented Jan 14, 2016

That sounds great. The way your maven plugin build it is perfect for my needs so having gradle do the same thing will make the tradition smoother.

Thank you for your efforts.

On Jan 14, 2016, at 6:04 AM, Danny Althoff notifications@github.com wrote:

@Lewik I'll never do that kind of stuff ... this maven-plugin went that way long time before me by creating fat-jars ... and it failed. I don't tend to change the behaviour of the upcoming javafx-gradle-plugin from this maven-plugin. Everything will be created below the build/jfx/-folder.

In the meantime I found a nice way to have the dependencies working ;) but this is my spare-time project, not getting paid for.

Usable plugin will be provided in the next days, then you can beta-test that plugin and give further feedback. There will be its own github-repository so that every feedback doesn't go into the maven-plugin-thread.


Reply to this email directly or view it on GitHub.

@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 15, 2016

Just some short update:

apply plugin: 'javafx-gradle-plugin'

jfx {
    verbose = true
    mainClass = 'com.something.notexisting'
    appName = 'project'
    manifestAttributes = [
        someElement: "hello world"
    ]
    jfxMainAppJarName = 'bla.jar'
    vendor = "not you"
    bundleArguments = [
        runtime: null
    ]
    bundler= "windows.app"
    secondaryLaunchers = [[appName:"somethingDifferent"], [appName:"somethingDifferent2"]]
}

This is already working for me, the maven-goals mvn jfx:jar and mvn jfx:native are now usable via gradle-tasks gradle jfxJar and gradle jfxNative.
These maven-goals are not on my todo-list right now (and might not being there ever): mvn jfx:list-bundlers, mvn:generate-key-store, mvn:run (the last one is deprecated)

I just need to cleanup some parts, but it already works (for me).

@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 15, 2016

All you brave heroes out there 😺 there is a SNAPSHOT-version available:

buildscript-excerpt:

buildscript {
    repositories {
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
    dependencies {
        classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '1.0-SNAPSHOT'
    }
}

Example of full build.gradle-file:

buildscript {
    repositories {
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
    dependencies {
        classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '1.0-SNAPSHOT'
    }
}
apply plugin: 'java'
repositories {
    mavenCentral()
}
dependencies{
    compile group: 'some.group.of.your.dep', name: 'yourDependency', version: '1.2'
    compile files("${System.properties['java.home']}/../lib/packager.jar")
}

apply plugin: 'javafx-gradle-plugin'

jfx {
    verbose = true
    mainClass = 'com.something.notexisting'
    appName = 'project'
    manifestAttributes = [
        someElement: "hello world"
    ]
    jfxMainAppJarName = 'bla.jar'
    vendor = "not you"
    bundleArguments = [
        runtime: null
    ]
    bundler= "windows.app"
    secondaryLaunchers = [[appName:"somethingDifferent"], [appName:"somethingDifferent2"]]
}

Please be aware of the upcoming new repository for that gradle-plugin. Sources and some other stuff will be published as soon there is a polished version (which should be next sunday).

@purringpigeon

This comment has been minimized.

Copy link

purringpigeon commented Jan 15, 2016

Thank you!! I will give it a shot Tuesday (long weekend here). Really appreciate your time and help on this.

On Jan 15, 2016, at 10:14 AM, Danny Althoff notifications@github.com wrote:

All you brave heroes out there there is a SNAPSHOT-version available:

buildscript-excerpt:

buildscript {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '1.0-SNAPSHOT'
}
}
Example of full build.gradle-file:

buildscript {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '1.0-SNAPSHOT'
}
}
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies{
compile group: 'some.group.of.your.dep', name: 'yourDependency', version: '1.2'
compile files("${System.properties['java.home']}/../lib/packager.jar")
}

apply plugin: 'javafx-gradle-plugin'

jfx {
verbose = true
mainClass = 'com.something.notexisting'
appName = 'project'
manifestAttributes = [
someElement: "hello world"
]
jfxMainAppJarName = 'bla.jar'
vendor = "not you"
bundleArguments = [
runtime: null
]
bundler= "windows.app"
secondaryLaunchers = [[appName:"somethingDifferent"], [appName:"somethingDifferent2"]]
}
Please be aware of the upcoming new repository for that gradle-plugin. Sources and some other stuff will be published as soon there is a polished version (which should be next sunday).


Reply to this email directly or view it on GitHub.

@FibreFoX

This comment has been minimized.

Copy link
Member

FibreFoX commented Jan 15, 2016

For those that haven seen it already, the new javafx-gradle-plugin has landed at github, it's available as sonatype-SNAPSHOT version and will be tweaked the next days (mostly some cleanup and bring file associations to it).

So this was it, it's done ;)

@FibreFoX FibreFoX closed this Jan 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment