Skip to content

Commit

Permalink
Begin to move javafx ant tasks into Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
netdance committed Aug 25, 2012
1 parent a8df4b3 commit ea9a2e2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
28 changes: 15 additions & 13 deletions build.gradle
@@ -1,8 +1,6 @@
apply plugin: 'groovy'

//ant.importBuild 'build.xml'


defaultTasks 'clean', 'run'

buildscript {

Expand Down Expand Up @@ -48,8 +46,6 @@ buildscript {
ant.properties['app.vendor'] = appVendor
ant.properties['app.version'] = appVersion

//apply from: 'gradle.properties', to: ant.properties

}

repositories {
Expand All @@ -69,9 +65,6 @@ sourceSets {
}
}

ant.properties['build.classes.dir'] = sourceSets.main.output.asPath


task wrap(type: Wrapper, description: "create a gradlew") {
gradleVersion = '1.1'
}
Expand Down Expand Up @@ -106,13 +99,22 @@ task bundleFX(dependsOn: '_dist-native') {
/* <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath=".:path/to/sdk/lib/ant-javafx.jar"/> */
//ant.taskdef(resource: "com/sun/javafx/tools/ant/antlib.xml",
// uri: "javafx:com.sun.javafx.tools.ant",
// classpath: ".:${project.ext.javafxAntJar}" )

ant.taskdef(resource: "com/sun/javafx/tools/ant/antlib.xml",
uri: "javafx:com.sun.javafx.tools.ant",
classpath: ".:${project.ext.javafxAntJar}" )
// javafx:com.sun.javafx.tools.ant:resources
ant.importBuild 'fx-extras.xml'

}
def javafxAnt = groovy.xml.NamespaceBuilder.newInstance(ant, 'javafx:com.sun.javafx.tools.ant')

def libRes = javafxAnt.resources(id: 'libRes') {
javafxAnt.fileset(dir: 'dist', includes: 'libs/*.jar', type: 'jar', requiredFor: 'startup')
}

def app = javafxAnt.application(id: "NapiliApp", name: "Napili Turtle Graphics", mainClass: appMainClass)



}

task dist(dependsOn: 'bundleFX') {}
11 changes: 6 additions & 5 deletions fx-extras.xml
Expand Up @@ -27,18 +27,19 @@

<target name="_dist-native" depends="classes, libcopy"
description="Builds native distributions via JavaFX">
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
<!-- <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="${javafxAntJar}"/>

classpath="${javafxAntJar}"/> -->
<!--
<fx:application id="NapiliApp"
name="Napili Turtle Graphics"
mainClass="${app.main.class}" />

-->
<!--
<fx:resources id="libRes">
<fx:fileset dir="dist" includes="libs/*.jar" type="jar" requiredFor="startup"/>
</fx:resources>

-->

<fx:jar destfile="dist/Napili.jar">
<!-- Define what to launch -->
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -5,4 +5,4 @@ appHeight = 600
appTitle = Napili
appMainClass = org.netdance.napili.Napili
appVendor = Jim Driscoll
appVersion = .1
appVersion = 0.1

0 comments on commit ea9a2e2

Please sign in to comment.