changeset 4052:f05ef2afcc85

Automated merge with ssh://javafxsrc.us.oracle.com//javafx/8.0/scrum/graphics/jfx/rt
author David Hill
date Mon, 24 Jun 2013 21:40:29 -0400
parents 87c39dfffa54 998a064081b9
children 89c0cdee3771
files build.gradle generator.gradle
diffstat 7 files changed, 157 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/3DViewer/build.gradle	Mon Jun 24 21:40:29 2013 -0400
@@ -0,0 +1,9 @@
+
+
+apply plugin:'application'
+
+mainClassName = "com.javafx.experiments.jfx3dviewer.Jfx3dViewerApp"
+
+jar {
+    manifest.attributes("Main-Class": mainClassName)
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/ConferenceScheduleApp/build.gradle	Mon Jun 24 21:40:29 2013 -0400
@@ -0,0 +1,9 @@
+
+
+apply plugin:'application'
+
+mainClassName = "com.javafx.experiments.scheduleapp.ConferenceScheduleApp"
+
+jar {
+    manifest.attributes("Main-Class": mainClassName)
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/experiments/Modena/build.gradle	Mon Jun 24 21:40:29 2013 -0400
@@ -0,0 +1,9 @@
+
+
+apply plugin:'application'
+
+mainClassName = "modena.Modena"
+
+jar {
+    manifest.attributes("Main-Class": mainClassName)
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/samples/Ensemble8/build.gradle	Mon Jun 24 21:40:29 2013 -0400
@@ -0,0 +1,19 @@
+
+
+apply plugin:'application'
+
+def mainClassName = "ensemble.EnsembleApp"
+
+def FileCollection apachecp = files(
+   "./lib/lucene-grouping-3.2.0.jar",
+   "./lib/lucene-core-3.2.0.jar") 
+
+sourceSets {
+    main {
+        compileClasspath += apachecp
+    }
+} 
+
+jar {
+    manifest.attributes("Main-Class": mainClassName)
+}
--- a/build.gradle	Mon Jun 24 17:18:51 2013 -0700
+++ b/build.gradle	Mon Jun 24 21:40:29 2013 -0400
@@ -1546,13 +1546,13 @@
 
 task sdk()
 
+// this is empty, allowing us to depend on the task, which may have other
+// real intances added later.
+task copyAppsArtifacts() 
+
 task apps() {
     dependsOn(sdk)
-
-    // TODO: implement this
-    doLast {
-        println "rt/apps not yet built"
-    }
+    dependsOn(copyAppsArtifacts)
 }
 
 task fullTest() {
@@ -2195,6 +2195,64 @@
     }
 }
 
+/*
+ * This clause changes the way we handle a build.gradle within ./apps
+ * It does a few things:
+ *   modifies the classpath used to include the built runttime classes
+ *   provides for copying the build applications to the artifacts tree
+ *
+ * The applications to be built will be under ./apps, but also must
+ * be listed in the applications listed in the setting variable: JFXApplications 
+ */
+ext.JFXRT_CP = 
+    files(
+	project(":base").sourceSets.main.output.classesDir,
+	project(":graphics").sourceSets.main.output.classesDir,
+	project(":controls").sourceSets.main.output.classesDir,
+	project(":fxml").sourceSets.main.output.classesDir,
+	project(":swing").sourceSets.main.output.classesDir, //NOTE - used by 3Dviewer
+	//project(":swt").sourceSets.main.output.classesDir,
+	project(":builders").sourceSets.main.output.classesDir,
+	//project(":web").sourceSets.main.output.classesDir, 
+	)
+
+if (BINARY_STUB != null) {
+    JFXRT_CP += BINARY_STUB 
+}
+
+// TODO: better place for this ?
+ext.APPS_ARTIFACTS="$jfxArtifactsDir/apps"
+
+childProjects["apps"].subprojects { 
+    afterEvaluate { project ->
+	// this check is to make sure we are using a java or application plugin
+        // in our child projects of ./apps
+        if (project.hasProperty("jar") && project.hasProperty("compileJava")) {
+            // augment the classpath with our build system classpath 
+            // which will include our local jfxrt.jar
+           project.compileJava {
+               // TODO: don't know how to do this correctly
+	       //dependsOn project(":graphics").classes, project(":controls").classes, project(":base").classes
+	       doFirst {
+		   classpath = rootProject.JFXRT_CP + 
+                       sourceSets.main.compileClasspath
+	       }
+            }
+
+            def srcdir = new File ("$project.projectDir/src");
+
+            if (BUILD_CLOSED && srcdir.exists()) {
+                def cptask = project.task('copyAppsArtifacts', type: Copy ) {
+                dependsOn project.getPath() + ":jar"
+		    from project.jar.archivePath
+		    into rootProject.APPS_ARTIFACTS
+		}
+                rootProject.apps.dependsOn(cptask)
+	    }
+	}
+    }
+}
+
 /******************************************************************************
  *                                                                            *
  *                              BUILD_CLOSED                                  *
--- a/generator.gradle	Mon Jun 24 17:18:51 2013 -0700
+++ b/generator.gradle	Mon Jun 24 21:40:29 2013 -0400
@@ -56,6 +56,13 @@
     // Copy over the apps
     ["ConferenceScheduleApp", "Modena"].each { app ->
         copy {
+            from "$RTDir/apps/experiments/$app/build.gradle"
+            into "$FXDir/apps/experiments/$app"
+            eachFile { f ->
+                fileList.add(f.file);
+            }
+        }
+        copy {
             from "$RTDir/apps/experiments/$app/src"
             into "$FXDir/apps/experiments/$app/src/main/java"
             exclude excludeFromSource
@@ -77,6 +84,13 @@
 
     ["3DViewer"].each { app ->
         copy {
+            from "$RTDir/apps/experiments/$app/build.gradle"
+            into "$FXDir/apps/experiments/$app"
+            eachFile { f ->
+                fileList.add(f.file);
+            }
+        }
+        copy {
             from "$RTDir/apps/experiments/$app/src"
             into "$FXDir/apps/experiments/$app/src"
             exclude "main/java/META-INF/MANIFEST.MF"
@@ -88,6 +102,13 @@
 
     // Copy over Ensemble8. Some special care taken for the generated stuff.
     copy {
+        from "$RTDir/apps/samples/Ensemble8/build.gradle"
+        into "$FXDir/apps/samples/Ensemble8"
+        eachFile { f ->
+            fileList.add(f.file);
+        }
+    }
+    copy {
         from "$RTDir/apps/samples/Ensemble8/src"
         into "$FXDir/apps/samples/Ensemble8/src/main/java"
         exclude excludeFromSource
@@ -107,6 +128,13 @@
             fileList.add(f.file);
         }
     }
+    copy {
+        from "$RTDir/apps/samples/Ensemble8/lib"
+        into "$FXDir/apps/samples/Ensemble8/lib"
+        eachFile { f ->
+            fileList.add(f.file);
+        }
+    }
 
     // Create the buildSrc project
     copy {
--- a/settings.gradle	Mon Jun 24 17:18:51 2013 -0700
+++ b/settings.gradle	Mon Jun 24 21:40:29 2013 -0400
@@ -44,3 +44,23 @@
     File supplementalSettingsFile = new File("../rt-closed/closed-settings.gradle");
     apply from: supplementalSettingsFile
 }
+
+/*************** Applications ******************/
+
+include 'apps'
+
+// The following defines the "active" ./apps to be built
+def JFXApplications = [ 
+    "samples:Ensemble8",
+
+    "experiments:3DViewer",
+    //"experiments:ConferenceScheduleApp",
+    "experiments:Modena",
+  ]
+
+JFXApplications.each { app-> 
+   logger.info "Adding Application Project $app"
+   include ":apps:$app"
+}
+
+/***********************************************/