I've been trying forever to find a way to contribute to this project.
Perhaps on the WiX.sourceforge.net page we can have some sort of link that
outlines the contribution process.  Here is where someone responds with a
simple link outlining the full procedure to make me feel silly.  At any-rate
I digress.

I have created a patch file from SVN (which I'm sure won't work with CVS but
at least you can see the changes) that allows for you to pass light some
variables.  Which was available for candle already in the NAnt build tasks.
So I just copied over the same process into light.  If there is some sort of
agreement I have to sign or adhere to for this contribution thats fine.
Just let me know how and where and I will.  Below is the SVN patch and
attached is the actual patch file I created.

Cheers,
Ryan

Index: LightTask.cs
===================================================================
--- LightTask.cs    (revision 279)
+++ LightTask.cs    (working copy)
@@ -10,12 +10,16 @@

namespace Microsoft.Tools.WindowsInstallerXml.NAntTasks
{
-    using System;
-    using System.IO;
+    using System;
+    using System.Collections.Specialized;
+    using System.Diagnostics;
+    using System.IO;
+    using System.Globalization;

    using NAnt.Core;
    using NAnt.Core.Attributes;
    using NAnt.Core.Types;
+    using NAnt.Core.Util;

    /// <summary>
    /// Represents the NAnt task for the &lt;light&gt; element in a NAnt
script.
@@ -31,6 +35,7 @@
        private string cultures;
        private FileSet localizations;
        private string suppressICEs;
+        private OptionCollection defines = new OptionCollection();
        #endregion

        #region Constructors
@@ -52,6 +57,14 @@
        // Properties

//==========================================================================================

+        /// <summary>
+        /// Gets the preprocessor variable definitions.
+        /// </summary>
+        [BuildElementCollection("defines", "define")]
+        public OptionCollection Defines {
+            get { return this.defines; }
+        }
+
        /// <summary>
        /// Gets or sets the cultures to use.
        /// </summary>
@@ -113,6 +126,12 @@
                    writer.WriteLine("-sice:{0}", suppressICE);
                }
            }
+
+            // Write out the definitions
+            foreach (Option define in this.Defines) {
+                string commandLine = String.Format(
CultureInfo.InvariantCulture, "-d{0}=\"{1}\"", define.OptionName,
define.Value);
+                writer.WriteLine(commandLine);
+            }
        }
        #endregion
    }

Attachment: light.patch
Description: Binary data

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs

Reply via email to