changeset 3784:582edfecdb04

imported patch gradle-builders
author kcr
date Sat, 01 Jun 2013 08:00:37 -0700
parents cc621195ec3c
children c51b01afa79b
files build.gradle generator.gradle settings.gradle
diffstat 3 files changed, 59 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Sat Jun 01 08:00:27 2013 -0700
+++ b/build.gradle	Sat Jun 01 08:00:37 2013 -0700
@@ -217,30 +217,24 @@
  *                                                                            *
  *****************************************************************************/
 
-// BUILD_CLOSED is a short-hand to specify that a "closed" build should be done.
+// BUILD_CLOSED is used to specify that a "closed" build should be done.
 // It is false by default and is set by a command line property. If true then
-// SUPPLEMENTAL_BUILD_FILE and SUPPLEMENTAL_PROPERTY_FILE will be set to
+// the closed build and property files will be read from
 // ../rt-closed/closed-build.gradle and ../rt-closed/closed-properties.gradle
 // respectively
 
-defineProperty("BUILD_CLOSED", "false");
 def buildClosed = false;
-if (BUILD_CLOSED instanceof String) buildClosed = Boolean.parseBoolean(BUILD_CLOSED);
+if (hasProperty("BUILD_CLOSED")) {
+    buildClosed = Boolean.parseBoolean(BUILD_CLOSED);
+}
+ext.BUILD_CLOSED = buildClosed
 
-if (buildClosed) {
-    def closedDir = file("../rt-closed");
-    defineProperty("SUPPLEMENTAL_BUILD_FILE", "$closedDir/closed-build.gradle");
-}
+def closedDir = file("../rt-closed");
+def supplementalPropertyFile = file("$closedDir/closed-properties.gradle");
+def supplementalBuildFile = file("$closedDir/closed-build.gradle");
 
-// The IS_CLOSED property should be used for logic that needs to do something
-// conditionally based on whether or not we are doing a closed build.
-ext.IS_CLOSED = hasProperty("SUPPLEMENTAL_BUILD_FILE");
-
-if (IS_CLOSED) {
-    def closedDir = file("$SUPPLEMENTAL_BUILD_FILE").getParentFile();
-    defineProperty("SUPPLEMENTAL_PROPERTY_FILE", "$closedDir/closed-properties.gradle");
-
-    apply from: SUPPLEMENTAL_PROPERTY_FILE
+if (BUILD_CLOSED) {
+    apply from: supplementalPropertyFile
 }
 
 // These variables indicate what platform is running the build. Is
@@ -1047,6 +1041,22 @@
     }
 }
 
+project(":builders") {
+    sourceCompatibility = 1.7
+
+    dependencies {
+        compile BUILD_SRC, project(":base"), project(":graphics"),
+                project(":controls"), project(":swt"), project(":swing")
+        testCompile project(":graphics").sourceSets.stub.output
+    }
+    test {
+        // StubToolkit is not *really* needed here, but because some code inadvertently invokes performance
+        // tracker and this attempts to fire up the toolkit and this looks for native libraries and fails,
+        // we have to use the stub toolkit for now.
+        jvmArgs "-Djavafx.toolkit=com.sun.javafx.pgstub.StubToolkit"
+    }
+}
+
 project(":designTime") {
     tasks.all {
         if (!COMPILE_DESIGN_TIME) it.enabled = false
@@ -1357,7 +1367,7 @@
 
     // TODO: implement this
     doLast {
-        if (!IS_CLOSED) {
+        if (!BUILD_CLOSED) {
             println "findbugs task is not implemented"
         }
     }
@@ -1369,7 +1379,7 @@
 task publicExports() {
     dependsOn(sdk)
     doLast {
-        if (!IS_CLOSED) {
+        if (!BUILD_CLOSED) {
             println "publicExports task is only run for a closed build"
         }
     }
@@ -1378,7 +1388,7 @@
 task perf() {
     dependsOn(sdk,apps)
     doLast {
-        if (!IS_CLOSED) {
+        if (!BUILD_CLOSED) {
             println "perf task is only run for a closed build"
         }
     }
@@ -1387,7 +1397,7 @@
 task zips() {
     dependsOn(sdk,publicExports,apps,perf)
     doLast {
-        if (!IS_CLOSED) {
+        if (!BUILD_CLOSED) {
             println "zips task is only run for a closed build"
         }
     }
@@ -1417,6 +1427,7 @@
         includeEmptyDirs = false
         from("modules/base/build/classes/main",
              "modules/base/build/resources/main",
+             "modules/builders/build/classes/main",
              "modules/graphics/build/classes/main",
              "modules/graphics/build/resources/main",
              "modules/controls/build/classes/main",
@@ -1560,7 +1571,7 @@
         <name must-exist="no">build</name>
       </task-names>
       <task-args>
-        <arg>-PSUPPLEMENTAL_BUILD_FILE=../rt-closed/closed-build.gradle</arg>
+        <arg>-PBUILD_CLOSED=true</arg>
       </task-args>
       <task-jvm-args/>
     </task>
@@ -1573,7 +1584,7 @@
         <name must-exist="yes">tasks</name>
       </task-names>
       <task-args>
-        <arg>-PSUPPLEMENTAL_BUILD_FILE=../rt-closed/closed-build.gradle</arg>
+        <arg>-PBUILD_CLOSED=true</arg>
       </task-args>
       <task-jvm-args/>
     </task>
@@ -1868,7 +1879,7 @@
 
 /******************************************************************************
  *                                                                            *
- *                         SUPPLEMENTAL_BUILD_FILE                            *
+ *                              BUILD_CLOSED                                  *
  *                                                                            *
  * This next section should remain at the end of the build script. It allows  *
  * for a "supplemental" gradle file to be used to extend the normal build     *
@@ -1877,6 +1888,6 @@
  *                                                                            *
  *****************************************************************************/
 
-if (IS_CLOSED) {
-    apply from: SUPPLEMENTAL_BUILD_FILE
+if (BUILD_CLOSED) {
+    apply from: supplementalBuildFile
 }
--- a/generator.gradle	Sat Jun 01 08:00:27 2013 -0700
+++ b/generator.gradle	Sat Jun 01 08:00:37 2013 -0700
@@ -376,8 +376,6 @@
         exclude excludeFromResources
     }
 
-    // Create the web module
-
     // Create the swing module
     copy {
         from "${RTDir}/javafx-embed-swing/src"
@@ -541,7 +539,19 @@
         from "${RTDir}/webview/native"
         into "${FXDir}/modules/web/src/main/native"
     }
-    
+
+    // Create the builders module
+    copy {
+        from "${RTDir}/javafx-builders/src"
+        into "${FXDir}/modules/builders/src/main/java"
+        exclude excludeFromSource
+    }
+    copy {
+        from "${RTDir}/javafx-builders/test/unit"
+        into "${FXDir}/modules/builders/src/test/java"
+        exclude excludeFromSource
+    }
+
     // Find every empty directory and nuke it
     def empty = []
     fileTree("$FXDir").visit {
--- a/settings.gradle	Sat Jun 01 08:00:27 2013 -0700
+++ b/settings.gradle	Sat Jun 01 08:00:37 2013 -0700
@@ -23,7 +23,7 @@
  * questions.
  */
 
-include "base", "graphics", "controls", "swing", "swt", "fxml", "designTime", "fxpackager"
+include "base", "graphics", "controls", "swing", "swt", "fxml", "builders", "designTime", "fxpackager"
 
 project(":base").projectDir = file("modules/base")
 project(":graphics").projectDir = file("modules/graphics")
@@ -31,13 +31,16 @@
 project(":swing").projectDir = file("modules/swing")
 project(":swt").projectDir = file("modules/swt")
 project(":fxml").projectDir = file("modules/fxml")
+project(":builders").projectDir = file("modules/builders")
 project(":designTime").projectDir = file("modules/designTime")
 project(":fxpackager").projectDir = file("modules/fxpackager")
 
-// TODO: this needs to be updated to also recognize -PBUILD_CLOSED=true (ideally
-// without duplicating the logic)
-if (hasProperty("SUPPLEMENTAL_BUILD_FILE")) {
-    File supplementalBuildFile = file(SUPPLEMENTAL_BUILD_FILE)
-    File supplementalSettingsFile = new File(supplementalBuildFile.getParentFile(), "closed-settings.gradle");
+def buildClosed = false;
+if (hasProperty("BUILD_CLOSED")) {
+    buildClosed = Boolean.parseBoolean(BUILD_CLOSED);
+}
+
+if (buildClosed) {
+    File supplementalSettingsFile = new File("../rt-closed/closed-settings.gradle");
     apply from: supplementalSettingsFile
 }