Add an option to use lit.exe from the WiX toolset instead of light.exe.  PR 47254.  Submitted by zhihengz

git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/dotnet/trunk@1061898 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/changes.xml b/changes.xml
index 6d40db6..7cdbf61 100644
--- a/changes.xml
+++ b/changes.xml
@@ -38,6 +38,10 @@
     </properties>
 
     <release version="SVN trunk" date="unpublished">
+      <action type="add" issue="47254">
+        The wix task has an option to run lit.exe rather than
+        light.exe now.
+      </action>
       <action type="update" breaks-bwc="true">
         The C# compiler uses gmcs on Mono by default now.
       </action>
diff --git a/contributors.xml b/contributors.xml
index daa6220..028a8db 100644
--- a/contributors.xml
+++ b/contributors.xml
@@ -90,4 +90,7 @@
     <first>Steve</first>
     <last>Loughran</last>
   </name>
+  <name>
+    <first>zhihengz</first>
+  </name>
 </contributors>
diff --git a/docs/wix.html b/docs/wix.html
index d823f65..9526111 100644
--- a/docs/wix.html
+++ b/docs/wix.html
@@ -28,9 +28,9 @@
 
     <h3>Description</h3>
 
-    <p>Runs candle or light from the <a
-    href="http://sourceforge.net/projects/wix">Wix</a> toolset - or
-    both of them in sequence.</p>
+    <p>Runs candle or light/lit from the
+      <a href="http://wixtoolset.org/">Wix</a> toolset - or
+      both of them in sequence.</p>
 
     <h3>Parameters</h3>
     <table border="1" cellpadding="2" cellspacing="0">
@@ -77,6 +77,12 @@
         <td align="center">No - Ant will candle have its way and use
           the current working directory if omitted.</td>
       </tr>
+      <tr>
+        <td valign="top">useLit</td>
+        <td valign="top">Whether to use lit.exe rather than
+          light.exe.  <em>since .NET Antlib 1.1</em></td>
+        <td align="center">No, default is &quot;false&quot;.</td>
+      </tr>
     </table>
 
     <h3>Parameters specified as nested elements</h3>
diff --git a/src/main/org/apache/ant/dotnet/wix/WixTask.java b/src/main/org/apache/ant/dotnet/wix/WixTask.java
index 5bbd406..9dcdcaf 100644
--- a/src/main/org/apache/ant/dotnet/wix/WixTask.java
+++ b/src/main/org/apache/ant/dotnet/wix/WixTask.java
@@ -104,6 +104,11 @@
      */
     private ArrayList lightParameters = new ArrayList();
 
+    /**
+     * Whether to use lit.exe rather than light.exe.
+     */
+    private boolean useLit = false;
+
     public WixTask() {
         super();
     }
@@ -216,6 +221,15 @@
         return candleCmdl.createArgument();
     }
 
+    /**
+     * Instructs the task to use lit.exe rather than light.exe as "compiler".
+     *
+     * @since .NET Antlib 1.1
+     */
+    public void setUseLit(boolean b) {
+        useLit = b;
+    }
+
     public void execute() {
         if (source == null && sources.size() == 0) {
             throw new BuildException("You must specify at least one source"
@@ -319,7 +333,7 @@
      * Run light passing all files of the collection on the command line.
      */
     private void runLight(Collection s) {
-        run(wixExecutable("light.exe"), s, target, null,
+        run(wixExecutable(useLit ? "lit.exe" : "light.exe"), s, target, null,
             lightParameters, lightCmdl);
     }