changeset 2828:86c6c588c7a7

Upated Gradle build & generation scripts
author rbair
date Thu, 07 Mar 2013 19:59:30 -0800
parents 3465e08c8a3a
children a359928812d1
files build.gradle generator.gradle
diffstat 2 files changed, 26 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Thu Mar 07 19:58:41 2013 -0800
+++ b/build.gradle	Thu Mar 07 19:59:30 2013 -0800
@@ -8,15 +8,19 @@
  *  - checkstyle
  *  - findbugs
  *  - re needs?
- *  - testing
+ *  - sqe testing
  *  - build check -- making sure the final artifact has the right bits
  *  - API change check
  *  - JavaDoc
+ *      - There is a built in task, but I need to exclude any API that doesn't start with javafx as the package name.
+ *        Also I need to link in to the Java 8 javadocs. Also need to link to public FX docs in the binary stub sdk
  *  - Pushing results to a repo?
  *  - VersionInfo needs to be parameterized so hudson can produce valid values
  *  - partial builds for compileXXX shaders isn't working (they also get compiled)
  *  - ServiceWithSecurityManagerTest fails to complete when run from gradle.
  *  - Integrate Parfait reports for C code
+ *  - Need to compile hlsl files
+ *  - FXML Project tests are not running
 // ENV has:
 //   JAVA_ARCH
 // Can also get JAVA_HOME, JDK_HOME, etc IFF the environment variables are set
@@ -256,7 +260,7 @@
     // to have sourceCompatibility set to 1.8 I have to also turn scanForClasses off
     // and manually specify the includes / excludes
     test {
-        jvmArgs '-Djava.ext.dirs='
+        jvmArgs "-Djava.ext.dirs="
         classpath = classpath + rootProject.files(JFXRT)
         enableAssertions = true
         testLogging.exceptionFormat = "full"
@@ -344,17 +348,11 @@
 // that all need to be compiled.
 project(":graphics") {
     sourceSets {
-        main {
-            java.srcDirs = ["src/main/java", "src/main/dt", "src/main/jsl-generator"]
-            resources.srcDirs = ["src/main/resources"]
-        }
-        test {
-            java.srcDirs = ["src/test/java"]
-            resources.srcDirs = ["src/test/resources"]
-        }
+        main.java.srcDirs = ["src/main/java", "src/main/dt", "src/main/jsl-generator"]
+        test
         stub {
-            java.srcDirs = ["src/test/testsWithStubToolkit"]
-            resources.srcDirs = ["src/test/resourcesWithStubToolkit"]
+            // The src/main/java is needed for some CSS related tests
+            resources.srcDirs = ["src/stub/resources", "src/main/java"]
         }
     }
 
@@ -366,28 +364,27 @@
     }
 
     tasks.replace("test")
-    task testWithoutStub(type: Test) {
-        jvmArgs '-Djava.ext.dirs='
+    task testWithoutStub(type: Test, dependsOn: ":graphics:compileJava") {
+        jvmArgs "-Djava.ext.dirs="
         classpath = sourceSets.test.runtimeClasspath + rootProject.files(JFXRT)
         enableAssertions = true
         testLogging.exceptionFormat = "full"
         scanForTestClasses = false
-        include '**/*Test.*'
-        exclude '**/*Abstract*.*'
+        include "**/*Test.*"
+        exclude "**/*Abstract*.*"
         forkEvery = 1
     }
-    task testWithStub(type: Test) {
-        jvmArgs '-Djava.ext.dirs='
-        classpath = sourceSets.stub.runtimeClasspath + sourceSets.test.runtimeClasspath + rootProject.files(JFXRT)
+    task testWithStub(type: Test, dependsOn: [":graphics:compileJava"]) {
+        jvmArgs "-Djava.ext.dirs=", "-Djavafx.toolkit=com.sun.javafx.pgstub.StubToolkit", "-DCSS_META_DATA_TEST_DIR=${file('build/classes/main/javafx')}"
+        classpath = sourceSets.stub.runtimeClasspath + sourceSets.main.runtimeClasspath + rootProject.files(JFXRT)
+        testClassesDir = file("build/classes/stub")
+        testResultsDir = file("build/stub-results")
+        testReportDir = file("build/reports/stub")
         enableAssertions = true
         testLogging.exceptionFormat = "full"
         scanForTestClasses = false
-        include '**/*Test.*'
-        exclude '**/*Abstract*.*'
-        exclude { fileTreeElement -> fileTreeElement.toString().contains("build/classes/test") }
-        jvmArgs "-Djavafx.toolkit=com.sun.javafx.pgstub.StubToolkit"
-        testResultsDir = file("build/stub-test-results")
-        testReportDir = file("build/reports/stubTests")
+        include "**/*Test.*"
+        exclude "**/*Abstract*.*"
         forkEvery = 1
     }
     test.dependsOn testWithoutStub, testWithStub
--- a/generator.gradle	Thu Mar 07 19:58:41 2013 -0800
+++ b/generator.gradle	Thu Mar 07 19:59:30 2013 -0800
@@ -236,13 +236,13 @@
     copy {
         from "${RTDir}/javafx-ui-common/test/unit",
              "${RTDir}/test-stub-toolkit/src"
-        into "${FXDir}/modules/graphics/src/test/testsWithStubToolkit"
+        into "${FXDir}/modules/graphics/src/stub/java"
         exclude excludeResources
     }
     copy {
         from "${RTDir}/javafx-ui-common/test/unit",
              "${RTDir}/test-stub-toolkit/src"
-        into "${FXDir}/modules/graphics/src/test/resourcesWithStubToolkit"
+        into "${FXDir}/modules/graphics/src/stub/resources"
         include includeResources
         exclude "**/doc-files/**.*"
     }
@@ -374,12 +374,12 @@
 
     copy {
         from "${RTDir}/javafx-fxml/test"
-        into "${FXDir}/modules/fxml/test/main/java"
+        into "${FXDir}/modules/fxml/src/test/java"
         exclude excludeResources
     }
     copy {
         from "${RTDir}/javafx-fxml/test"
-        into "${FXDir}/modules/fxml/test/main/resources"
+        into "${FXDir}/modules/fxml/src/test/resources"
         include includeResources
         exclude "**/doc-files/**.*"
     }