import groovy.xml.NamespaceBuilder assert project.plugins.findPlugin(JavaPlugin): "The Java plugin must be applied before using javafx7.gradle." assert project.plugins.findPlugin(ApplicationPlugin): "The Application plugin must be applied before using javafx7.gradle." def javafxJar = searchFile([{System.env['JFXRT_HOME']}, {System.env['JAVA_HOME']}, {System.properties['java.home']}], ['jfxrt.jar', 'lib/jfxrt.jar', 'lib/ext/jfxrt.jar', 'jre/lib/jfxrt.jar', 'jre/lib/ext/jfxrt.jar']) def antJavafxJar = searchFile([{System.env['JFXRT_HOME']}, {System.env['JAVA_HOME']}, {System.properties['java.home']}], ['ant-javafx.jar', 'lib/ant-javafx.jar', '../lib/ant-javafx.jar']) if (!javafxJar) { throw new GradleException("Unable to locate JavaFX jar (jfxrt.jar), JAVA_HOME may need to be set.") } if (!antJavafxJar) { throw new GradleException("Unable to locate JavaFX Ant jar (ant-javafx.jar), JAVA_HOME may need to be set.") } configurations { jfxrt jfxant sourceSets { main { compileClasspath += configurations.jfxrt } } } dependencies { jfxrt files(javafxJar) jfxant files(antJavafxJar) } run.classpath.add(configurations.jfxrt) jar { actions = [] def antfx = NamespaceBuilder.newInstance( ant, 'javafx:com.sun.javafx.tools.ant') ant.taskdef( resource: 'com/sun/javafx/tools/ant/antlib.xml', uri: 'javafx:com.sun.javafx.tools.ant', classpath: configurations.jfxant.asPath) doLast { antfx.application( id: 'IceGridGUI', name: 'IceGrid Admin', mainClass: 'IceGridGUI.Main', fallbackClass: 'IceGridGUI.Fallback', toolkit: 'swing') antfx.resources(id: 'IceGridGUI.resources') { } antfx.jar(destfile: archivePath) { application(refid: 'IceGridGUI') resources(refid: 'IceGridGUI.resources') fileset(dir: sourceSets.main.output.classesDir) fileset(dir: sourceSets.main.output.resourcesDir) } } } startScripts { enabled = false } installDist { enabled = false }