changeset 11001:21b47529863d 11+20

8207015: jlink javafx.graphics on Windows fails: PluginException: Duplicate resources Reviewed-by: jvos, mbilla
author kcr
date Sat, 21 Jul 2018 06:14:35 -0700
parents ccdff6bcf8c1
children 504705a06aa3 87ebb26688d7
files build.gradle buildSrc/win.gradle
diffstat 2 files changed, 26 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Sat Jul 21 07:17:24 2018 -0700
+++ b/build.gradle	Sat Jul 21 06:14:35 2018 -0700
@@ -5589,6 +5589,13 @@
         def standaloneSdkDir = "${rootProject.buildDir}/${standaloneSdkDirName}"
         def standaloneLegalDir = "${standaloneSdkDir}/legal"
 
+        def excludeNativeLibs = []
+        if (IS_WINDOWS) {
+            // List of duplicate Microsoft DLLs to exclude
+            excludeNativeLibs += targetProperties.VS2017DLLNames
+            excludeNativeLibs += targetProperties.WinSDKDLLNames
+        }
+
         moduleProjList.each { project ->
             def moduleName = project.ext.moduleName
             def buildDir = project.buildDir
@@ -5613,6 +5620,13 @@
                             args("--libs")
                             args(srcLibDir)
                         }
+                        // Exclude duplicate native libs from javafx.graphics.jmod
+                        if (moduleName == "javafx.graphics") {
+                            excludeNativeLibs.each { name ->
+                                args("--exclude")
+                                args(name)
+                            }
+                        }
                         args("--legal-notices")
                         args(srcLegalDir)
                         args(jmodFile)
--- a/buildSrc/win.gradle	Sat Jul 21 07:17:24 2018 -0700
+++ b/buildSrc/win.gradle	Sat Jul 21 06:14:35 2018 -0700
@@ -196,24 +196,26 @@
 
 def vs2017DllPath = cygpath("${msvcRedstDir}/Microsoft.VC${windowsCRTVer}.CRT")
 if (file(vs2017DllPath).exists()) {
-    def VS2017DLLs = [
+    ext.WIN.VS2017DLLNames = [
         "concrt140.dll",
         "msvcp140.dll",
         "vcruntime140.dll"
     ];
     ext.WIN.VS2017DLLs = []
-        VS2017DLLs.each { vsdll->
-            ext.WIN.VS2017DLLs += "$vs2017DllPath/$vsdll"
-        }
+    ext.WIN.VS2017DLLNames.each { vsdll->
+        ext.WIN.VS2017DLLs += "$vs2017DllPath/$vsdll"
+    }
 }
 else {
+    ext.WIN.VS2017DLLNames = [
+	];
     ext.WIN.VS2017DLLs = [
 	];
 }
 
 def WinSDKDLLsPath = cygpath("${winSdkDllDir}")
 if (file(WinSDKDLLsPath).exists()) {
-    def WinSDKDLLs = [
+    ext.WIN.WinSDKDLLNames = [
         "api-ms-win-core-console-l1-1-0.dll",
         "api-ms-win-core-datetime-l1-1-0.dll",
         "api-ms-win-core-debug-l1-1-0.dll",
@@ -257,11 +259,13 @@
         "ucrtbase.dll"
     ];
     ext.WIN.WinSDKDLLs = []
-        WinSDKDLLs.each { winsdkdll->
-            ext.WIN.WinSDKDLLs += "$WinSDKDLLsPath/$winsdkdll"
-        }
+    ext.WIN.WinSDKDLLNames.each { winsdkdll->
+        ext.WIN.WinSDKDLLs += "$WinSDKDLLsPath/$winsdkdll"
+    }
 }
 else {
+    ext.WIN.WinSDKDLLNames = [
+    ];
     ext.WIN.WinSDKDLLs = [
     ];
 }