From a0dc17c9eed0a7fdc501767e57222ebc4ef01904 Mon Sep 17 00:00:00 2001
From: douph1 <45632394+douph1@users.noreply.github.com>
Date: Thu, 15 Apr 2021 10:31:05 +0200
Subject: [PATCH] fix concurent build and merge template
---
wix/Build.OpenJDK_generic.cmd | 32 ++-
wix/Includes/OpenJDK.Variables.wxi.template | 42 ++--
wix/Main.dragonwell.wxs.template | 228 -----------------
wix/Main.openj9.wxs.template | 232 ------------------
...hotspot.wxs.template => Main.wxs.template} | 2 +-
5 files changed, 43 insertions(+), 493 deletions(-)
delete mode 100644 wix/Main.dragonwell.wxs.template
delete mode 100644 wix/Main.openj9.wxs.template
rename wix/{Main.hotspot.wxs.template => Main.wxs.template} (99%)
diff --git a/wix/Build.OpenJDK_generic.cmd b/wix/Build.OpenJDK_generic.cmd
index 7dafb74cd..4288f634c 100644
--- a/wix/Build.OpenJDK_generic.cmd
+++ b/wix/Build.OpenJDK_generic.cmd
@@ -100,16 +100,6 @@ REM See folder e.g. "C:\Program Files (x86)\Windows Kits\[10]\bin\[10.0.16299.0]
SET WIN_SDK_MAJOR_VERSION=10
SET WIN_SDK_FULL_VERSION=10.0.17763.0
-REM find all *.wxi.template,*.wxl.template,*.wxs.template files and replace text with configurations
-SETLOCAL ENABLEDELAYEDEXPANSION
-FOR /f %%i IN ('dir /s /b *.wxi.template,*.wxl.template,*.wxs.template') DO (
- SET INPUT_FILE=%%i
- SET OUTPUT_FILE=!INPUT_FILE:.template=%!
- ECHO string replacement input !INPUT_FILE! output !OUTPUT_FILE!
- powershell -Command "(gc -Raw -encoding utf8 %%i) -replace '{vendor}', '!VENDOR!' -replace '{vendor_branding_logo}', '!VENDOR_BRANDING_LOGO!' -replace '{vendor_branding_banner}', '!VENDOR_BRANDING_BANNER!' -replace '{vendor_branding_dialog}', '!VENDOR_BRANDING_DIALOG!' -replace '{vendor_branding}', '!VENDOR_BRANDING!' -replace '{product_help_link}', '!PRODUCT_HELP_LINK!' -replace '{product_support_link}', '!PRODUCT_SUPPORT_LINK!' -replace '{product_update_info_link}', '!PRODUCT_UPDATE_INFO_LINK!' | Out-File -encoding utf8 !OUTPUT_FILE!"
-)
-ENDLOCAL
-
REM
REM Nothing below this line need to be changed normally.
REM
@@ -180,6 +170,15 @@ FOR %%A IN (%ARCH%) DO (
ECHO Source dir used : !REPRO_DIR!
SET OUTPUT_BASE_FILENAME=!PRODUCT_SKU!!PRODUCT_MAJOR_VERSION!-!PRODUCT_CATEGORY!_!FOLDER_PLATFORM!_windows_!PACKAGE_TYPE!-!PRODUCT_FULL_VERSION!
+ REM find all *.wxi.template,*.wxl.template,*.wxs.template files and replace text with configurations
+ FOR /f %%i IN ('dir /s /b *.wxi.template,*.wxl.template,*.wxs.template') DO (
+ SET INPUT_FILE=%%i
+ REM Prevent concurrency issues if multiple builds are running in parallel.
+ SET OUTPUT_FILE=!OUTPUT_BASE_FILENAME!-!INPUT_FILE:.template=%!
+ ECHO string replacement input !INPUT_FILE! output !OUTPUT_FILE!
+ powershell -Command "(gc -Raw -encoding utf8 %%i) -replace '{vendor}', '!VENDOR!' -replace '{vendor_branding_logo}', '!VENDOR_BRANDING_LOGO!' -replace '{vendor_branding_banner}', '!VENDOR_BRANDING_BANNER!' -replace '{vendor_branding_dialog}', '!VENDOR_BRANDING_DIALOG!' -replace '{vendor_branding}', '!VENDOR_BRANDING!' -replace '{product_help_link}', '!PRODUCT_HELP_LINK!' -replace '{product_support_link}', '!PRODUCT_SUPPORT_LINK!' -replace '{product_update_info_link}', '!PRODUCT_UPDATE_INFO_LINK!' | Out-File -encoding utf8 !OUTPUT_FILE!"
+ )
+
SET CACHE_BASE_FOLDER=Cache
REM Each build his own cache for concurrent build
SET CACHE_FOLDER=!CACHE_BASE_FOLDER!\!OUTPUT_BASE_FILENAME!
@@ -210,15 +209,12 @@ FOR %%A IN (%ARCH%) DO (
)
)
- REM Prevent concurrency issues if multiple builds are running in parallel.
- ECHO copy "Main.!PACKAGE_TYPE!.wxs"
- COPY /Y "Main.!PACKAGE_TYPE!.wxs" "Main-!OUTPUT_BASE_FILENAME!.wxs"
REM Build with extra Source Code feature (needs work)
REM "!WIX!bin\heat.exe" file "!REPRO_DIR!\lib\src.zip" -out Src-!OUTPUT_BASE_FILENAME!.wxs -gg -srd -cg "SrcFiles" -var var.ReproDir -dr INSTALLDIR -platform !PLATFORM!
REM "!WIX!bin\heat.exe" dir "!REPRO_DIR!" -out Files-!OUTPUT_BASE_FILENAME!.wxs -t "!SETUP_RESOURCES_DIR!\heat.tools.xslt" -gg -sfrag -scom -sreg -srd -ke -cg "AppFiles" -var var.ProductMajorVersion -var var.ProductMinorVersion -var var.ProductVersionString -var var.MSIProductVersion -var var.ReproDir -dr INSTALLDIR -platform !PLATFORM!
- REM "!WIX!bin\candle.exe" -arch !PLATFORM! Main-!OUTPUT_BASE_FILENAME!.wxs Files-!OUTPUT_BASE_FILENAME!.wxs Src-!OUTPUT_BASE_FILENAME!.wxs -ext WixUIExtension -ext WixUtilExtension -dProductSku="!PRODUCT_SKU!" -dProductMajorVersion="!PRODUCT_MAJOR_VERSION!" -dProductMinorVersion="!PRODUCT_MINOR_VERSION!" -dProductVersionString="!PRODUCT_SHORT_VERSION!" -dMSIProductVersion="!MSI_PRODUCT_VERSION!" -dProductId="!PRODUCT_ID!" -dReproDir="!REPRO_DIR!" -dSetupResourcesDir="!SETUP_RESOURCES_DIR!" -dCulture="!CULTURE!"
- REM "!WIX!bin\light.exe" !MSI_VALIDATION_OPTION! Main-!OUTPUT_BASE_FILENAME!.wixobj Files-!OUTPUT_BASE_FILENAME!.wixobj Src-!OUTPUT_BASE_FILENAME!.wixobj -cc !CACHE_FOLDER! -ext WixUIExtension -ext WixUtilExtension -spdb -out "ReleaseDir\!OUTPUT_BASE_FILENAME!.msi" -loc "Lang\!PRODUCT_SKU!.Base.!CULTURE!.wxl" -loc "Lang\!PRODUCT_SKU!.!PACKAGE_TYPE!.!CULTURE!.wxl" -cultures:!CULTURE!
+ REM "!WIX!bin\candle.exe" -arch !PLATFORM! !OUTPUT_BASE_FILENAME!-Main.wxs Files-!OUTPUT_BASE_FILENAME!.wxs Src-!OUTPUT_BASE_FILENAME!.wxs -ext WixUIExtension -ext WixUtilExtension -dProductSku="!PRODUCT_SKU!" -dProductMajorVersion="!PRODUCT_MAJOR_VERSION!" -dProductMinorVersion="!PRODUCT_MINOR_VERSION!" -dProductVersionString="!PRODUCT_SHORT_VERSION!" -dMSIProductVersion="!MSI_PRODUCT_VERSION!" -dProductId="!PRODUCT_ID!" -dReproDir="!REPRO_DIR!" -dSetupResourcesDir="!SETUP_RESOURCES_DIR!" -dCulture="!CULTURE!"
+ REM "!WIX!bin\light.exe" !MSI_VALIDATION_OPTION! Main-!OUTPUT_BASE_FILENAME!.wixobj Files-!OUTPUT_BASE_FILENAME!.wixobj Src-!OUTPUT_BASE_FILENAME!.wixobj -cc !CACHE_FOLDER! -ext WixUIExtension -ext WixUtilExtension -spdb -out "ReleaseDir\!OUTPUT_BASE_FILENAME!.msi" -loc "Lang\!OUTPUT_BASE_FILENAME!-!PRODUCT_SKU!.Base.!CULTURE!.wxl" -loc "Lang\!OUTPUT_BASE_FILENAME!-!PRODUCT_SKU!.!PACKAGE_TYPE!.!CULTURE!.wxl" -cultures:!CULTURE!
REM Clean .cab cache for each run .. Cache is only used inside BuildSetupTranslationTransform.cmd to speed up MST generation
IF EXIST !CACHE_FOLDER! rmdir /S /Q !CACHE_FOLDER!
@@ -263,7 +259,7 @@ FOR %%A IN (%ARCH%) DO (
ECHO CANDLE
@ECHO ON
- "!WIX!bin\candle.exe" -arch !PLATFORM! Main-!OUTPUT_BASE_FILENAME!.wxs Files-!OUTPUT_BASE_FILENAME!.wxs !ITW_WXS! -ext WixUIExtension -ext WixUtilExtension -dIcedTeaWebDir="!ICEDTEAWEB_DIR!" -dProductSku="!PRODUCT_SKU!" -dProductMajorVersion="!PRODUCT_MAJOR_VERSION!" -dProductMinorVersion="!PRODUCT_MINOR_VERSION!" -dProductVersionString="!PRODUCT_SHORT_VERSION!" -dMSIProductVersion="!MSI_PRODUCT_VERSION!" -dProductId="!PRODUCT_ID!" -dProductUpgradeCode="!PRODUCT_UPGRADE_CODE!" -dReproDir="!REPRO_DIR!" -dSetupResourcesDir="!SETUP_RESOURCES_DIR!" -dCulture="!CULTURE!" -dJVM="!PACKAGE_TYPE!"
+ "!WIX!bin\candle.exe" -arch !PLATFORM! !OUTPUT_BASE_FILENAME!-Main.wxs Files-!OUTPUT_BASE_FILENAME!.wxs !ITW_WXS! -ext WixUIExtension -ext WixUtilExtension -dIcedTeaWebDir="!ICEDTEAWEB_DIR!" -dProductSku="!PRODUCT_SKU!" -dProductMajorVersion="!PRODUCT_MAJOR_VERSION!" -dProductMinorVersion="!PRODUCT_MINOR_VERSION!" -dProductVersionString="!PRODUCT_SHORT_VERSION!" -dMSIProductVersion="!MSI_PRODUCT_VERSION!" -dProductId="!PRODUCT_ID!" -dProductUpgradeCode="!PRODUCT_UPGRADE_CODE!" -dReproDir="!REPRO_DIR!" -dSetupResourcesDir="!SETUP_RESOURCES_DIR!" -dCulture="!CULTURE!" -dJVM="!PACKAGE_TYPE!"
IF ERRORLEVEL 1 (
ECHO Failed to preprocesses and compiles WiX source files into object files ^(.wixobj^)
GOTO FAILED
@@ -272,7 +268,7 @@ FOR %%A IN (%ARCH%) DO (
ECHO LIGHT
@ECHO ON
- "!WIX!bin\light.exe" Main-!OUTPUT_BASE_FILENAME!.wixobj Files-!OUTPUT_BASE_FILENAME!.wixobj !ITW_WIXOBJ! !MSI_VALIDATION_OPTION! -cc !CACHE_FOLDER! -ext WixUIExtension -ext WixUtilExtension -spdb -out "ReleaseDir\!OUTPUT_BASE_FILENAME!.msi" -loc "Lang\!PRODUCT_SKU!.Base.!CULTURE!.wxl" -loc "Lang\!PRODUCT_SKU!.!PACKAGE_TYPE!.!CULTURE!.wxl" -cultures:!CULTURE!
+ "!WIX!bin\light.exe" Main-!OUTPUT_BASE_FILENAME!.wixobj Files-!OUTPUT_BASE_FILENAME!.wixobj !ITW_WIXOBJ! !MSI_VALIDATION_OPTION! -cc !CACHE_FOLDER! -ext WixUIExtension -ext WixUtilExtension -spdb -out "ReleaseDir\!OUTPUT_BASE_FILENAME!.msi" -loc "Lang\!OUTPUT_BASE_FILENAME!-!PRODUCT_SKU!.Base.!CULTURE!.wxl" -loc "Lang\!OUTPUT_BASE_FILENAME!-!PRODUCT_SKU!.!PACKAGE_TYPE!.!CULTURE!.wxl" -cultures:!CULTURE!
IF ERRORLEVEL 1 (
ECHO Failed to links and binds one or more .wixobj files and creates a Windows Installer database ^(.msi or .msm^)
GOTO FAILED
@@ -352,7 +348,7 @@ FOR %%A IN (%ARCH%) DO (
REM Remove files we do not need any longer.
DEL "Files-!OUTPUT_BASE_FILENAME!.wxs"
DEL "Files-!OUTPUT_BASE_FILENAME!.wixobj"
- DEL "Main-!OUTPUT_BASE_FILENAME!.wxs"
+ DEL "!OUTPUT_BASE_FILENAME!-Main.wxs"
DEL "Main-!OUTPUT_BASE_FILENAME!.wixobj"
IF DEFINED ITW_WXS (
DEL !ITW_WXS!
diff --git a/wix/Includes/OpenJDK.Variables.wxi.template b/wix/Includes/OpenJDK.Variables.wxi.template
index d306c9de4..7485424c3 100644
--- a/wix/Includes/OpenJDK.Variables.wxi.template
+++ b/wix/Includes/OpenJDK.Variables.wxi.template
@@ -56,23 +56,37 @@
-
-
- =9?>
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ =9?>
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/wix/Main.dragonwell.wxs.template b/wix/Main.dragonwell.wxs.template
deleted file mode 100644
index d8e180fba..000000000
--- a/wix/Main.dragonwell.wxs.template
+++ /dev/null
@@ -1,228 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- = 601]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)
- ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)
-
-
-
-
- ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))
-
-
-
-
-
-
-
- ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)
-
-
-
-
- ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- "1.8" AND JAVASOFT_CURRENTVERSION > $(var.ProductMajorVersion)]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/wix/Main.openj9.wxs.template b/wix/Main.openj9.wxs.template
deleted file mode 100644
index df6b26f1f..000000000
--- a/wix/Main.openj9.wxs.template
+++ /dev/null
@@ -1,232 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- = 601]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)
- ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)
-
-
-
-
- ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))
-
-
-
-
-
-
-
- ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)
-
-
-
-
- ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- "1.8" AND JAVASOFT_CURRENTVERSION > $(var.ProductMajorVersion)]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/wix/Main.hotspot.wxs.template b/wix/Main.wxs.template
similarity index 99%
rename from wix/Main.hotspot.wxs.template
rename to wix/Main.wxs.template
index 0ee6a8bdb..96bd2ebb7 100644
--- a/wix/Main.hotspot.wxs.template
+++ b/wix/Main.wxs.template
@@ -222,7 +222,7 @@
-->
-
+