You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by sl...@apache.org on 2021/11/11 12:19:42 UTC

[daffodil] branch main updated: Append needed WiX options to default lightOptions rather than overriding

This is an automated email from the ASF dual-hosted git repository.

slawrence pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil.git


The following commit(s) were added to refs/heads/main by this push:
     new 772826c  Append needed WiX options to default lightOptions rather than overriding
772826c is described below

commit 772826c9070dea10ac4340c321f1071bda6fd2d2
Author: Steve Lawrence <sl...@apache.org>
AuthorDate: Mon Nov 8 17:23:48 2021 -0500

    Append needed WiX options to default lightOptions rather than overriding
    
    The lightOptions key in the sbt-native-packager plugin defaults to this:
    
        lightOptions := Seq(
          "-ext", "WixUIExtension",
          "-ext", "WixUtilExtension",
          "-cultures:en-us",
        )
    
    We override the lightOptions setting with these same values plus some
    additional ones for things like localization and disabling validation.
    But we accidentally didn't include the WixUtilExtesnsion option. At some
    point an update required this extension, and without it MSI builds
    started to fail.
    
    We could add the missing WixUtilExtension value to our overridden
    lightOptions setting, but to ensure we pick up any defaults that the
    sbt-native-packager plugin might add and require in the future, this
    instead just appends our custom options to the existing setting by using
    ++=. This gives us back the WixUtilExtenion that we need for builds to
    succeed.
    
    Additionally, minor fixs are made to the bat script:
    - Enable setlocal so variables used in the bat file do not pollute
      variable scope outside the bat file
    - Quote variables inside if-statements. Otherwise, variables with
      parenthesis in them (which is common in Windows (x86) path) cause
      bat-file errors.
    
    DAFFODIL-2584
---
 daffodil-cli/build.sbt                  | 4 +---
 daffodil-cli/src/templates/bat-template | 8 +++++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/daffodil-cli/build.sbt b/daffodil-cli/build.sbt
index a728eb6..07ccee8 100644
--- a/daffodil-cli/build.sbt
+++ b/daffodil-cli/build.sbt
@@ -138,11 +138,9 @@ wixProductUpgradeId := "4C966AFF-585E-4E17-8CC2-059FD70FEC77"
 // re-installation of the same version. Despite the presence of
 // specific XML to enable this, the WiX compiler and linker
 // complain about it unless you specifically suppress the warning.
-lightOptions := Seq(
+lightOptions ++= Seq(
   "-sval", // validation does not currently work under Wine, this disables that
   "-sice:ICE61",
-  "-ext", "WixUIExtension",
-  "-cultures:en-us",
   "-loc", ((Windows / sourceDirectory).value / "Product_en-us.wxl").toString
 )
 
diff --git a/daffodil-cli/src/templates/bat-template b/daffodil-cli/src/templates/bat-template
index 395ac1a..872d28a 100755
--- a/daffodil-cli/src/templates/bat-template
+++ b/daffodil-cli/src/templates/bat-template
@@ -35,6 +35,8 @@ REM DAFFODIL_JAVA_OPTS environment variable. If not specified, the JAVA_OPTS
 REM environment variable will be used. If that is not specified, reasonable
 REM defaults for Daffodil will be defined.
 
+setlocal
+
 set MAINCLASS=org.apache.daffodil.Main
 set BINDIR=%~dp0
 set LIBDIR=%BINDIR%..\lib
@@ -42,13 +44,13 @@ set CONFDIR=%BINDIR%..\conf
 set CLASSPATH=%LIBDIR%\*
 
 if defined DAFFODIL_JAVA_OPTS (
-	set JOPTS=%DAFFODIL_JAVA_OPTS%
+	set "JOPTS=%DAFFODIL_JAVA_OPTS%"
 ) else if defined JAVA_OPTS (
-	set JOPTS=%JAVA_OPTS%
+	set "JOPTS=%JAVA_OPTS%"
 )
 
 if defined DAFFODIL_CLASSPATH (
-	set CLASSPATH=%CLASSPATH%;%DAFFODIL_CLASSPATH%
+	set "CLASSPATH=%CLASSPATH%;%DAFFODIL_CLASSPATH%"
 )
 
 REM Prepend additional java options that must be provided. By prepending, a user