< prev index next >
./build.gradle
Print this page
*** 613,630 ****
}
if (!project.hasProperty("jdkRuntimeVersion")) throw new Exception("Unable to determine the version of Java in JDK_HOME at $JDK_HOME");
// Determine whether the javafx.* modules are present in the JDK. To do this,
! // we will execute "java --list-modules" and search for javafx.base
ext.HAS_JAVAFX_MODULES = false;
def inStream2 = new java.io.BufferedReader(new java.io.InputStreamReader(new java.lang.ProcessBuilder(JAVA, "--list-modules").start().getInputStream()));
try {
String v;
while ((v = inStream2.readLine()) != null) {
v = v.trim();
if (v.startsWith("javafx.base")) ext.HAS_JAVAFX_MODULES = true;
}
} finally {
inStream2.close();
}
--- 613,634 ----
}
if (!project.hasProperty("jdkRuntimeVersion")) throw new Exception("Unable to determine the version of Java in JDK_HOME at $JDK_HOME");
// Determine whether the javafx.* modules are present in the JDK. To do this,
! // we will execute "java --list-modules" and search for javafx.base.
! // Also, check if jdk.unsupported.desktop module is present in JDK to ensure
! // javafx.swing do not use internal JDK classes directly.
ext.HAS_JAVAFX_MODULES = false;
+ ext.HAS_UNSUPPORTED_DESKTOP = false;
def inStream2 = new java.io.BufferedReader(new java.io.InputStreamReader(new java.lang.ProcessBuilder(JAVA, "--list-modules").start().getInputStream()));
try {
String v;
while ((v = inStream2.readLine()) != null) {
v = v.trim();
if (v.startsWith("javafx.base")) ext.HAS_JAVAFX_MODULES = true;
+ if (v.startsWith("jdk.unsupported.desktop")) ext.HAS_UNSUPPORTED_DESKTOP = true;
}
} finally {
inStream2.close();
}
*** 1296,1305 ****
--- 1300,1310 ----
logger.quiet("jdk version: ${jdkVersion}")
logger.quiet("jdk build number: ${jdkBuildNumber}")
logger.quiet("minimum jdk version: ${jfxBuildJdkVersionMin}")
logger.quiet("minimum jdk build number: ${jfxBuildJdkBuildnumMin}")
logger.quiet("HAS_JAVAFX_MODULES: $HAS_JAVAFX_MODULES")
+ logger.quiet("HAS_UNSUPPORTED_DESKTOP: $HAS_UNSUPPORTED_DESKTOP")
logger.quiet("STUB_RUNTIME: $STUB_RUNTIME")
logger.quiet("CONF: $CONF")
logger.quiet("NUM_COMPILE_THREADS: $NUM_COMPILE_THREADS")
logger.quiet("COMPILE_TARGETS: $COMPILE_TARGETS")
logger.quiet("COMPILE_FLAGS_FILES: $COMPILE_FLAGS_FILES")
*** 2328,2337 ****
--- 2333,2357 ----
if (!HAS_JAVAFX_MODULES) {
jvmArgs += qualExportsSwing
}
}
+ sourceSets.main.java.srcDirs += "$buildDir/gensrc/java"
+ sourceSets.main.java {
+ if (!HAS_UNSUPPORTED_DESKTOP) {
+ exclude("com/sun/javafx/embed/swing/newimpl/**")
+ }
+ }
+ task checkJDKUnsupportedModule(type: Copy, description: "copy module-info file to gensrc") {
+ from "src/main/module-info/module-info.java"
+ into "$buildDir/gensrc/java/"
+ filter { line->
+ !HAS_UNSUPPORTED_DESKTOP && line.contains('jdk.unsupported.desktop') ? null : line
+ }
+ }
+ compileJava.dependsOn checkJDKUnsupportedModule
+
compileJava.options.compilerArgs.addAll(qualExportsSwing)
}
project(":swt") {
tasks.all {
*** 4775,4795 ****
// FIXME: javafx.swt sources?
def copySources = project.hasProperty("includeSources") && project.includeSources
def copySourceFilesTask = project.task("copySourceFiles$t.capital", type: Copy, dependsOn: copyLibFilesTask) {
if (copySources) {
from "${project.projectDir}/src/main/java"
! if (project.name.equals("base")) {
from "${project.projectDir}/build/gensrc/java"
}
if (project.name.equals("web")) {
from "${project.projectDir}/src/main/native/Source/WebCore/bindings/java/dom3/java"
}
} else {
from "${project.projectDir}/src/main/java/module-info.java"
}
into "${modulesSrcDir}/${moduleName}"
include "**/*.java"
if (project.hasProperty("sourceFilter")) {
filter(project.sourceFilter)
}
}
--- 4795,4819 ----
// FIXME: javafx.swt sources?
def copySources = project.hasProperty("includeSources") && project.includeSources
def copySourceFilesTask = project.task("copySourceFiles$t.capital", type: Copy, dependsOn: copyLibFilesTask) {
if (copySources) {
from "${project.projectDir}/src/main/java"
! if (project.name.equals("base") || project.name.equals("swing")) {
from "${project.projectDir}/build/gensrc/java"
}
if (project.name.equals("web")) {
from "${project.projectDir}/src/main/native/Source/WebCore/bindings/java/dom3/java"
}
} else {
from "${project.projectDir}/src/main/java/module-info.java"
}
into "${modulesSrcDir}/${moduleName}"
include "**/*.java"
+ if (!HAS_UNSUPPORTED_DESKTOP) {
+ exclude("com/sun/javafx/embed/swing/newimpl/**")
+ }
+
if (project.hasProperty("sourceFilter")) {
filter(project.sourceFilter)
}
}
< prev index next >