--- NAnt.VSNet/Tasks/SolutionTask.cs	6 Sep 2003 11:20:56 -0000	1.13
+++ NAnt.VSNet/Tasks/SolutionTask.cs	12 Sep 2003 12:02:47 -0000
@@ -127,6 +127,7 @@
             _excludeProjects = new FileSet();
             _assemblyFolders = new FileSet();
             _webMaps = new WebMapCollection();
+            _arguments = new ArgumentCollection();
         }
 
         #endregion Public Instance Constructors
@@ -255,11 +256,23 @@
             }
         }
 
+        /// <summary>
+        /// Extra command-line arguments for csc compiler.
+        /// </summary>
+        [BuildElementCollection("compilerargs")]
+        public ArgumentCollection Arguments 
+        {
+            get { return _arguments; }
+        }
+
+
         #endregion Public Instance Properties
 
         #region Override implementation of Task
@@ -290,7 +303,7 @@
                             new ArrayList(ReferenceProjects.FileNames), tfc, this, WebMaps, ExcludeProjects, OutputDir);
                     }
 
-                    if (!sln.Compile(Configuration, new ArrayList(), null, Verbose, false)) {
+                    if (!sln.Compile(Configuration, GetCompilerArguments(), null, Verbose, false)) {
                         throw new BuildException("Project build failed.", Location);
                     }
                 
@@ -331,6 +344,27 @@
 
         #region Private Instance Methods
 
+        private ArrayList GetCompilerArguments() {
+            ArrayList list = new ArrayList();
+
+            foreach(Argument arg in Arguments) {
+                if (arg.IfDefined && !arg.UnlessDefined) {
+                    if (arg.Value != null || arg.File != null) {
+                        string argValue = arg.File == null ? arg.Value : arg.File;
+
+                        if(argValue.IndexOf(" ") > 0 && !(argValue.StartsWith("\"") && argValue.EndsWith("\""))) {
+                            argValue = '"' + argValue + '"';
+                        } 
+                        list.Add(argValue);
+                    } else {
+                        Log(Level.Warning, "{0} skipped arg element without value and file attribute.", Location);
+                    }
+                }
+            }
+
+            return list;
+        }
+
         private void ScanRegistryForAssemblyFolders(RegistryKey mainKey, FileSet fsFolders) {
             if (mainKey == null) {
                 return;
@@ -375,6 +409,7 @@
         private FileSet _assemblyFolders;
         private WebMapCollection _webMaps;
         private bool _includeVSFolders;
+        private ArgumentCollection _arguments;
 
 
         #endregion Private Instance Fields

