changeset 5858:207d6d1ca9a3

RT-34083: fixing rework building apps and installed samples for ARM. Disabling non-hosted APPS
author ddhill
date Sun, 01 Dec 2013 17:01:55 -0500
parents 2c0a00f8de4a
children 75fc25092d2e
files apps/build.xml build.gradle
diffstat 2 files changed, 46 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/apps/build.xml	Sun Dec 01 10:25:59 2013 -0800
+++ b/apps/build.xml	Sun Dec 01 17:01:55 2013 -0500
@@ -1,14 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project default="jar" basedir=".">
+<project default="sampleAppsJar" basedir=".">
 
-    <target name="jar">
+    <!-- 
+       Note: this build.xml will be pulled into the
+       Gradle namespace, so lets use long names...
+    -->
+
+    <target name="sampleAppsJar">
+        <condition property="jfxrt.jar.exists">
+            <available file="${file.reference.jfxrt.jar}" type="file"/>
+        </condition>
+        <fail unless="jfxrt.jar.exists"/>
+
         <ant dir="samples" target="jar" inheritAll="true"/>
         <ant dir="experiments" target="jar" inheritAll="true"/>
         <ant dir="performance" target="jar" inheritAll="true"/>
         <ant dir="toys" target="jar" inheritAll="true"/>
     </target>
 
-    <target name="clean">
+    <target name="sampleAppsClean">
         <ant dir="samples" target="clean" inheritAll="true"/>
         <ant dir="experiments" target="clean" inheritAll="true"/>
         <ant dir="performance" target="clean" inheritAll="true"/>
--- a/build.gradle	Sun Dec 01 10:25:59 2013 -0800
+++ b/build.gradle	Sun Dec 01 17:01:55 2013 -0500
@@ -2673,18 +2673,41 @@
     // The apps build is Ant based, and gradle lets us "import" ant build.xml
     // into our configuration.
 
-    // override the apps build.xml with an explicit pointer to our jar.
-    def jfxrt = "${rootProject.buildDir}/${defaultHostTarget}-sdk/rt/lib/ext/jfxrt.jar"
-
-    // set properties the Ant build will need
-    ant.properties['file.reference.jfxrt.jar'] = "${jfxrt}"
-    ant.properties['platforms.JDK_1.8.home'] = "${rootProject.ext.JDK_HOME}"
-
     ant.importBuild 'build.xml'
 
-    // wire the ant targets to gradle tasks
-    rootProject.appsjar.dependsOn("${path}:jar")
-    rootProject.clean.dependsOn("${path}:clean")
+    compileTargets { t ->
+        // The apps build is Ant based, and gradle lets us "import" ant build.xml
+        // into our configuration.
+
+        //THIS IS A HACK until we figure out how to fix Ensemble which
+        //relies on elements outside the core JFX.
+        if ("${defaultHostTarget}" != "${t.name}") {
+            println "Warning not building APPS as is a non-hosted build"
+            return // Currently non-hosted builds fail in Ensmble.
+        }
+
+        // override the apps build.xml with an explicit pointer to our jar.
+        def jfxrtJar = "${rootProject.buildDir}/${t.name}-sdk/rt/lib/ext/jfxrt.jar"
+
+        def appsJar = project.task("appsJar${t.capital}") {
+            doLast() {
+              ant.properties['targetBld'] = "$t.name"
+              ant.properties['file.reference.jfxrt.jar'] = jfxrtJar
+              ant.properties['platforms.JDK_1.8.home'] = "${rootProject.ext.JDK_HOME}"
+              ant.project.executeTarget("sampleAppsJar")
+            }
+        }
+        rootProject.appsjar.dependsOn(appsJar)
+
+        def appsClean = project.task("appsClean${t.capital}") {
+            doLast() {
+              ant.properties['targetBld'] = "$t.name"
+              ant.properties['platforms.JDK_1.8.home'] = "${rootProject.ext.JDK_HOME}"
+              ant.project.executeTarget("sampleAppsClean")
+            }
+        }
+        rootProject.clean.dependsOn(appsClean)
+    }
 }
 
 /******************************************************************************