Skip to content

Instantly share code, notes, and snippets.

@deanriverson
Last active May 12, 2018 12:55
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save deanriverson/2712927 to your computer and use it in GitHub Desktop.
Save deanriverson/2712927 to your computer and use it in GitHub Desktop.
Basic Gradle build file for a project using GroovyFX 0.2
apply plugin:'groovy'
project.ext.set('javafxHome', System.env['JAVAFX_HOME']
repositories { mavenCentral() }
dependencies {
groovy 'org.codehaus.groovy:groovy-all:1.8.6'
compile 'org.codehaus.groovyfx:groovyfx:0.4.0'
compile files("${javafxHome}/rt/lib/jfxrt.jar")
}
task run(type: JavaExec) {
main = 'helloGroovyFX'
classpath sourceSets.main.runtimeClasspath
}
task makeDirs(description:'make all dirs for project setup') << {
def sources = [sourceSets.main, sourceSets.test]
sources*.allSource*.srcDirs.flatten().each { File srcDir ->
println "making $srcDir"
srcDir.mkdirs()
}
}
task wrap(type:Wrapper, description:"create a gradlew") {
gradleVersion = '1.0-rc-3'
}
@bpow
Copy link

bpow commented Feb 16, 2013

newer versions of gradle (since 1.0-milestone-9) prefer the syntax project.ext.set('javafxHome', System.env['JAVAFX_HOME']) instead of setting a dynamic property (line 3).

@bitsnaps
Copy link

if javafx lib is already on the path you don't need javafxHome, as the version groovyfx:8.0.0 this is working for me:

apply plugin: 'groovy'
repositories {
    jcenter()
}
dependencies {
    compile 'org.groovyfx:groovyfx:8.0.0'
}
task run(type: JavaExec) {
    main = 'helloGroovyFX'
    classpath sourceSets.main.runtimeClasspath
}

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