changeset 10891:b956f9ea2553 jdk-11+8

8200277: Compiling native media code fails when using OpenJDK build as boot JDK Reviewed-by: jvos, prr
author kcr
date Thu, 29 Mar 2018 13:04:25 -0700
parents 0dee1dc31222
children 4fc4c393fdc6 cc511fcfe940 4107477ed6e5
files build.gradle
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Thu Mar 22 10:35:02 2018 +0100
+++ b/build.gradle	Thu Mar 29 13:04:25 2018 -0700
@@ -2944,8 +2944,10 @@
 
     compileToolsJava {
         enabled = IS_COMPILE_MEDIA
-        options.compilerArgs.addAll(project.modulePathArgs)
+        def modulePath = "${project.sourceSets.main.java.outputDir}"
         options.compilerArgs.addAll([
+            "--module-path=$modulePath",
+            "--add-modules=javafx.media",
             '--add-exports', 'javafx.media/com.sun.media.jfxmedia=ALL-UNNAMED',
             ])
     }
@@ -2956,7 +2958,7 @@
     def nativeSrcDir = file("${projectDir}/src/main/native")
     def generatedHeadersDir = file("${buildDir}/gensrc/headers/${project.moduleName}")
 
-    task generateMediaErrorHeader(dependsOn: [compileToolsJava, compileJava]) {
+    task generateMediaErrorHeader(dependsOn: [compileJava, compileToolsJava]) {
         enabled = IS_COMPILE_MEDIA
         def headerpath = file("$generatedHeadersDir/jfxmedia_errors.h");
         doLast {
@@ -2966,9 +2968,15 @@
 
             mkdir generatedHeadersDir;
 
+            def modulePath = "${project.sourceSets.main.java.outputDir}"
+            modulePath += File.pathSeparator + "${rootProject.projectDir}/modules/javafx.graphics/build/classes/java/main"
+            modulePath += File.pathSeparator + "${rootProject.projectDir}/modules/javafx.base/build/classes/java/main"
+
             exec {
                 commandLine("$JAVA");
                 args += patchModuleArgs
+                args += [ "--module-path=$modulePath" ]
+                args += [ "--add-modules=javafx.media" ]
                 args +=  [ '--add-exports=javafx.media/com.sun.media.jfxmedia=ALL-UNNAMED' ]
                 args +=  [ '-classpath', "${classpath.asPath}" ]
                 args += [ "headergen.HeaderGen", "$headerpath", "$srcRoot" ]