changeset 5866:2c9f866b6e0f

RT-34083: fixing sample apps building when Swing not present (Ensemble8, Modena, 3DViewer) Reviewed-by: kcr
author ddhill
date Mon, 02 Dec 2013 13:15:35 -0500
parents 7624bc25c49e
children 446894e7355b
files apps/experiments/3DViewer/build.xml apps/experiments/build.xml apps/samples/Ensemble8/build.xml build.gradle
diffstat 4 files changed, 27 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/apps/experiments/3DViewer/build.xml	Mon Dec 02 12:43:45 2013 -0500
+++ b/apps/experiments/3DViewer/build.xml	Mon Dec 02 13:15:35 2013 -0500
@@ -72,6 +72,13 @@
 
     -->
 
+    <target name="-pre-init">
+        <!-- exclude samples that are not part of the base JavaFX -->
+        <condition property="excludes" value="com/javafx/experiments/height2normal/Height2NormalApp.java">
+            <isset property="JFX_CORE_ONLY"/>
+        </condition>
+    </target>
+
     <target name="install-to-maven-repo" depends="jar">
         <property name="maven.home" location="${ant.home}\..\maven"/>
         <macrodef name="maven">
--- a/apps/experiments/build.xml	Mon Dec 02 12:43:45 2013 -0500
+++ b/apps/experiments/build.xml	Mon Dec 02 13:15:35 2013 -0500
@@ -1,9 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project default="jar" basedir=".">
 
-    <target name="jar">
+    <target name="swingJar" unless="JFX_CORE_ONLY">
+         <!-- 
+          these apps have dependencies on Swing which is not part of the 
+          JFX_CORE, so we should not try to build them
+          -->
+        <ant dir="Modena" target="jar" inheritAll="true"/>
+    </target>
+
+    <target name="jar" depends="swingJar">
         <ant dir="3DViewer" target="jar" inheritAll="true"/>
-        <ant dir="Modena" target="jar" inheritAll="true"/>
     </target>
 
     <target name="clean">
--- a/apps/samples/Ensemble8/build.xml	Mon Dec 02 12:43:45 2013 -0500
+++ b/apps/samples/Ensemble8/build.xml	Mon Dec 02 13:15:35 2013 -0500
@@ -71,6 +71,12 @@
     nbproject/build-impl.xml file. 
 
     -->
+    <target name="-pre-init">
+        <!-- exclude samples that are not part of the base JavaFX -->
+        <condition property="excludes" value="ensemble/samples/swing/**">
+            <isset property="JFX_CORE_ONLY"/>
+        </condition>
+    </target>
     
     <!-- COPY SAMPLE SRC TO BUILD DIR -->
     <target name="-pre-compile">
--- a/build.gradle	Mon Dec 02 12:43:45 2013 -0500
+++ b/build.gradle	Mon Dec 02 13:15:35 2013 -0500
@@ -2349,7 +2349,7 @@
 
 task appsjar() {
     dependsOn(sdk)
-    // Note: the jar dependacies get added elsewhere see project(":apps")
+    // Note: the jar dependencies get added elsewhere see project(":apps")
 }
 
 // these are empty tasks, allowing us to depend on the task, which may have other
@@ -2730,22 +2730,18 @@
     ant.importBuild 'build.xml'
 
     compileTargets { t ->
-        // The apps build is Ant based, and gradle lets us "import" ant build.xml
+        // The apps build is Ant based, and gradle lets us "import" ant apps/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"
+              if (!rootProject.ext[t.upper].compileSwing) {
+                ant.properties['JFX_CORE_ONLY'] = 'true'
+              }
               ant.properties['file.reference.jfxrt.jar'] = jfxrtJar
               ant.properties['platforms.JDK_1.8.home'] = "${rootProject.ext.JDK_HOME}"
               ant.project.executeTarget("sampleAppsJar")