< prev index next >

./build.gradle

Print this page
rev 9808 : 8131888: Need to deliver javafx.swt as a modular jar in JDK 9

@@ -1817,10 +1817,14 @@
 
 project(":swt") {
     tasks.all {
         if (!COMPILE_SWT) it.enabled = false
     }
+
+    // javafx.swt is an automatic module
+    project.ext.buildModule = false
+
     dependencies {
         compile BUILD_SRC, project(":base"), project(":graphics")
         compile name: SWT_FILE_NAME
     }
     classes << {

@@ -1858,11 +1862,11 @@
         project.projectDir.path + "/src/test/addExports"
     )
 
     dependencies {
         compile BUILD_SRC, project(":base"), project(":graphics"),
-                project(":controls"), project(":swt"), project(":swing")
+                project(":controls")
         testCompile project(":graphics").sourceSets.test.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,

@@ -3178,33 +3182,31 @@
             ant.jar (update: true, index: true, destfile: jfxrtTask.archiveName)
         }
     }
     jfxrt.dependsOn(jfxrtIndexTask)
 
-    // FIXME: JIGSAW -- update this for modules
-    def jfxswtTask = task("jfxswt$t.capital", type: Jar) {
+    def javafxSwtTask = task("javafxSwt$t.capital", type: Jar) {
         enabled = COMPILE_SWT
         group = "Basic"
-        description = "Creates the jfxswt.jar for the $t.name target"
-        archiveName = "build/${sdkDirName}/lib/jfxswt.jar";
+        description = "Creates the javafx-swt.jar for the $t.name target"
+        archiveName = "modules/swt/build/libs/javafx-swt.jar";
         includeEmptyDirs = false
         from("modules/swt/build/classes/main");
         include("**/javafx/embed/swt/**")
-        exclude("**/*.java");  // Builder java files are in build/classes and should be excluded
 
         dependsOn(subprojects.collect { project -> project.getTasksByName("assemble", true)});
     }
 
-    def jfxswtIndexTask = task("jfxswtIndex$t.capital") {
+    def javafxSwtIndexTask = task("javafxSwtIndex$t.capital") {
         //the following is a workaround for the lack of indexing in gradle 1.4 through 1.7
-        dependsOn(jfxswtTask)
+        dependsOn(javafxSwtTask)
 
         doLast() {
-            ant.jar (update: true, index: true, destfile: jfxswtTask.archiveName)
+            ant.jar (update: true, index: true, destfile: javafxSwtTask.archiveName)
         }
     }
-    jfxrt.dependsOn(jfxswtIndexTask)
+    jfxrt.dependsOn(javafxSwtIndexTask)
 
     def jmxTask = task ("jmx${t.capital}", type: Jar) {
         group = "Basic"
         description = "Creates the javafx-mx.jar"
         archiveName = "build/${sdkDirName}/lib/javafx-mx.jar";

@@ -3262,11 +3264,11 @@
                 into "build/${sdkDirName}/man"
             }
         }
         dependsOn(jmxTask);
         dependsOn(jfxrtIndexTask)
-        dependsOn(jfxswtIndexTask)
+        dependsOn(javafxSwtIndexTask)
         dependsOn(javadoc)
         dependsOn(src)
     }
 
     def generateSymbols = targetProperties.containsKey('generateSymbols') ? targetProperties.generateSymbols : false

@@ -3622,10 +3624,16 @@
         dependsOn(mediaProject.assemble)
 
         def webProject = project(":web");
         dependsOn(webProject.assemble)
 
+        def swtProject = project(":swt");
+        if (COMPILE_SWT) {
+            def javafxSwtIndexTask = tasks.getByName("javafxSwtIndex${t.capital}");
+            dependsOn(javafxSwtIndexTask)
+        }
+
         def packagerProject = project(":fxpackager");
         //dependsOn(packagerProject.assemble)
         dependsOn(packagerProject.jar)
         dependsOn(project(":fxpackagerservices").jar)
 

@@ -3741,10 +3749,20 @@
                         from ("$LIBRARY_STUB/${library('jfxwebkit')}")
                     }
                 }
             }
 
+            // FIXME: the following is a hack to workaround the fact that there
+            // is no way to deliver javafx-swt.jar other than in one of the
+            // existing runtime modules.
+            if (COMPILE_SWT) {
+                // Copy javafx-swt.jar to the javafx-graphics module lib dir
+                copy {
+                    from "${swtProject.buildDir}/libs/javafx-swt.jar"
+                    into "${graphicsProject.buildDir}/${platformPrefix}module-lib"
+                }
+            }
 
             // javafx.packager libraries and executable
 
             // Copy over the javapackager libs
             copy {
< prev index next >