Beispiel #1
0
        /// <summary>
        /// Determines if the specified warning should be treated as an error.
        /// </summary>
        /// <param name="warningEvent">A <see cref="BuildWarningEventArgs"/> that specifies the warning.</param>
        /// <returns><code>true</code> if the warning should be treated as an error, otherwise <code>false</code>.</returns>
        private bool ShouldTreatWarningAsError(BuildWarningEventArgs warningEvent)
        {
            // This only applies if the user specified /warnaserror from the command-line or added an empty set through the object model
            //
            if (WarningsAsErrors != null)
            {
                // Global warnings as errors apply to all projects.  If the list is empty or contains the code, the warning should be treated as an error
                //
                if (WarningsAsErrors.Count == 0 || WarningsAsErrors.Contains(warningEvent.Code))
                {
                    return(true);
                }
            }

            // This only applies if the user specified <MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors or <MSBuildWarningsAsErrors />
            // and there is a valid ProjectInstanceId for the warning.
            //
            if (WarningsAsErrorsByProject != null && warningEvent.BuildEventContext != null && warningEvent.BuildEventContext.ProjectInstanceId != BuildEventContext.InvalidProjectInstanceId)
            {
                ISet <string> codesByProject;

                // Attempt to get the list of warnings to treat as errors for the current project
                //
                if (WarningsAsErrorsByProject.TryGetValue(warningEvent.BuildEventContext.ProjectInstanceId, out codesByProject) && codesByProject != null)
                {
                    // We create an empty set if all warnings should be treated as errors so that should be checked first.
                    // If the set is not empty, check the specific code.
                    //
                    return(codesByProject.Count == 0 || codesByProject.Contains(warningEvent.Code));
                }
            }

            return(false);
        }
Beispiel #2
0
        public override int GetHashCode()
        {
            var hashCode = new HashCodeCombiner();

            hashCode.AddObject(AllWarningsAsErrors);
            hashCode.AddSequence(WarningsAsErrors.OrderBy(e => e));
            hashCode.AddSequence(NoWarn.OrderBy(e => e));

            return(hashCode.CombinedHash);
        }
        public bool Equals(WarningProperties other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(AllWarningsAsErrors == other.AllWarningsAsErrors &&
                   WarningsAsErrors.SetEquals(other.WarningsAsErrors) &&
                   NoWarn.SetEquals(other.NoWarn));
        }
Beispiel #4
0
        protected override void ExecuteTask()
        {
            //if (DebugTask && !System.Diagnostics.Debugger.IsAttached) System.Diagnostics.Debugger.Launch();

            Log(Level.Info, "Set Up");

            try
            {
                if (string.IsNullOrEmpty(base.FileName))
                {
                    base.FileName = "melt.exe";
                }

                const string boolFormat   = @" {0}";
                const string stringFormat = @" {0} {1}";

                string arguments = string.Empty;

                if (NoLogo)
                {
                    arguments += string.Format(boolFormat, @"-nologo");
                }

                if (AllWarningsAsErrors)
                {
                    arguments += string.Format(boolFormat, @"-wxall");
                }
                else if (!string.IsNullOrEmpty(WarningsAsErrors))
                {
                    string[] warnings = WarningsAsErrors.Split(',');
                    foreach (string s in warnings)
                    {
                        arguments += string.Format(@" -wx{0}", s);
                    }
                }

                if (SupressAllWarnings)
                {
                    arguments += string.Format(boolFormat, @"-swall");
                }
                else if (!string.IsNullOrEmpty(SupressWarning))
                {
                    string[] warnings = WarningsAsErrors.Split(',');
                    foreach (string s in warnings)
                    {
                        arguments += string.Format(@" -sw{0}", s);
                    }
                }

                if (NoTidy)
                {
                    arguments += string.Format(@" -notidy");
                }

                if (!string.IsNullOrEmpty(ExtractedBinariesPath))
                {
                    arguments += string.Format(@" -x ""{0}""", ExtractedBinariesPath);
                }

                if (!string.IsNullOrEmpty(ExtensionClassAssemblyFullyQualifiedClassName))
                {
                    arguments += string.Format(stringFormat, @"-ext", ExtensionClassAssemblyFullyQualifiedClassName);
                }

                if (base.Verbose)
                {
                    arguments += string.Format(boolFormat, @"-v");
                }

                FileInfo inputFile = new FileInfo(InputInstallerFilename);

                if (!inputFile.Exists)
                {
                    throw new Exception(string.Format("Could not find input file {0}.", inputFile.FullName));
                }

                if (!string.IsNullOrEmpty(MergeModuleWXSOutputFilename) && !string.IsNullOrEmpty(MSIPDBOutputFilename))
                {
                    throw new Exception("attributes, 'msmWXSOutputFilename' AND 'msiPDBOutputFilename' can not BOTH be chosen.");
                }

                if (!string.IsNullOrEmpty(MergeModuleWXSOutputFilename))
                {
                    if (".msm" != inputFile.Extension.ToLower())
                    {
                        throw new Exception("You need to specify a windows installer merge module (.msm extension) in order to get WXS output.");
                    }

                    Log(Level.Info, "Doing MergeModule Melt.");

                    arguments += string.Format(@" ""{0}"" ""{1}""", inputFile.FullName, MergeModuleWXSOutputFilename);
                }
                else if (!string.IsNullOrEmpty(MSIPDBOutputFilename))
                {
                    if (".msi" != inputFile.Extension.ToLower())
                    {
                        throw new Exception("You need to specify a windows installer (.msi extension) in order to get PDB output.");
                    }

                    if (!File.Exists(MSIPDBInputFilename))
                    {
                        throw new Exception(string.Format("Could not find msiPDBInputFilename at {0}", MSIPDBInputFilename));
                    }

                    Log(Level.Info, "Doing MSI Melt.");

                    arguments += string.Format(@" ""{0}"" ""{1}"" -pdb ""{2}""", inputFile.FullName, MSIPDBOutputFilename, MSIPDBInputFilename);
                }

                base.CommandLineArguments = string.Format(@"{0}", arguments);

                Log(Level.Info, base.CommandLineArguments);

                base.ExecuteTask();
                Log(Level.Info, "Done!");
            }
            catch (Exception ex)
            {
                Log(Level.Info, "Exception handled");

                Exception e = ex;
                while (null != e)
                {
                    Log(Level.Error, ex.Message);
                    Log(Level.Error, ex.StackTrace);

                    e = e.InnerException;
                }

                throw;
            }
        }
Beispiel #5
0
        /// <summary>
        /// Raises the given event to all registered loggers. This method up-cast the events
        /// extracted from the queue.
        /// </summary>
        public void Consume(BuildEventArgs buildEvent)
        {
            // FXCop may complain that there are unecessary casts here, and there are, but
            // using "as" and allocating another variable for each event is extremely costly
            // and is much slower then this approach even with the additional casts
            if (buildEvent is BuildMessageEventArgs)
            {
                this.RaiseMessageEvent(null, (BuildMessageEventArgs)buildEvent);
            }
            else if (buildEvent is TaskStartedEventArgs)
            {
                this.RaiseTaskStartedEvent(null, (TaskStartedEventArgs)buildEvent);
            }
            else if (buildEvent is TaskFinishedEventArgs)
            {
                this.RaiseTaskFinishedEvent(null, (TaskFinishedEventArgs)buildEvent);
            }
            else if (buildEvent is TargetStartedEventArgs)
            {
                this.RaiseTargetStartedEvent(null, (TargetStartedEventArgs)buildEvent);
            }
            else if (buildEvent is TargetFinishedEventArgs)
            {
                this.RaiseTargetFinishedEvent(null, (TargetFinishedEventArgs)buildEvent);
            }
            else if (buildEvent is ProjectStartedEventArgs)
            {
                this.RaiseProjectStartedEvent(null, (ProjectStartedEventArgs)buildEvent);
            }
            else if (buildEvent is ProjectFinishedEventArgs)
            {
                this.RaiseProjectFinishedEvent(null, (ProjectFinishedEventArgs)buildEvent);
            }
            else if (buildEvent is BuildStartedEventArgs)
            {
                HaveLoggedBuildStartedEvent = true;
                this.RaiseBuildStartedEvent(null, (BuildStartedEventArgs)buildEvent);
            }
            else if (buildEvent is BuildFinishedEventArgs)
            {
                HaveLoggedBuildFinishedEvent = true;
                this.RaiseBuildFinishedEvent(null, (BuildFinishedEventArgs)buildEvent);
            }
            else if (buildEvent is CustomBuildEventArgs)
            {
                this.RaiseCustomEvent(null, (CustomBuildEventArgs)buildEvent);
            }
            else if (buildEvent is BuildStatusEventArgs)
            {
                this.RaiseStatusEvent(null, (BuildStatusEventArgs)buildEvent);
            }
            else if (buildEvent is BuildWarningEventArgs)
            {
                BuildWarningEventArgs warningEvent = (BuildWarningEventArgs)buildEvent;

                if (WarningsAsMessages != null && WarningsAsMessages.Contains(warningEvent.Code))
                {
                    // Treat this warning as a message with low importance if its in the list
                    BuildMessageEventArgs errorEvent = new BuildMessageEventArgs(
                        warningEvent.Subcategory,
                        warningEvent.Code,
                        warningEvent.File,
                        warningEvent.LineNumber,
                        warningEvent.ColumnNumber,
                        warningEvent.EndLineNumber,
                        warningEvent.EndColumnNumber,
                        warningEvent.Message,
                        warningEvent.HelpKeyword,
                        warningEvent.SenderName,
                        MessageImportance.Low,
                        warningEvent.Timestamp)
                    {
                        BuildEventContext = warningEvent.BuildEventContext,
                        ProjectFile       = warningEvent.ProjectFile,
                    };

                    this.RaiseMessageEvent(null, errorEvent);
                }
                else if (WarningsAsErrors != null && (WarningsAsErrors.Count == 0 || WarningsAsErrors.Contains(warningEvent.Code)))
                {
                    // Treat this warning as an error if an empty set of warnings was specified or this code was specified
                    BuildErrorEventArgs errorEvent = new BuildErrorEventArgs(
                        warningEvent.Subcategory,
                        warningEvent.Code,
                        warningEvent.File,
                        warningEvent.LineNumber,
                        warningEvent.ColumnNumber,
                        warningEvent.EndLineNumber,
                        warningEvent.EndColumnNumber,
                        warningEvent.Message,
                        warningEvent.HelpKeyword,
                        warningEvent.SenderName,
                        warningEvent.Timestamp)
                    {
                        BuildEventContext = warningEvent.BuildEventContext,
                        ProjectFile       = warningEvent.ProjectFile,
                    };

                    this.RaiseErrorEvent(null, errorEvent);
                }
                else
                {
                    this.RaiseWarningEvent(null, warningEvent);
                }
            }
            else if (buildEvent is BuildErrorEventArgs)
            {
                this.RaiseErrorEvent(null, (BuildErrorEventArgs)buildEvent);
            }
            else if (buildEvent is TelemetryEventArgs)
            {
                this.RaiseTelemetryEvent(null, (TelemetryEventArgs)buildEvent);
            }
            else
            {
                ErrorUtilities.VerifyThrow(false, "Unknown event args type.");
            }
        }
Beispiel #6
0
        protected override void ExecuteTask()
        {
            if (DebugTask && !System.Diagnostics.Debugger.IsAttached)
            {
                System.Diagnostics.Debugger.Launch();
            }

            Log(Level.Info, "Set Up");

            try
            {
                if (string.IsNullOrEmpty(base.FileName))
                {
                    base.FileName = "torch.exe";
                }

                const string boolFormat   = @" {0}";
                const string stringFormat = @" {0} {1}";

                string arguments = string.Empty;

                if (NoLogo)
                {
                    arguments += string.Format(boolFormat, @"-nologo");
                }

                if (AllWarningsAsErrors)
                {
                    arguments += string.Format(boolFormat, @"-wxall");
                }
                else if (!string.IsNullOrEmpty(WarningsAsErrors))
                {
                    string[] warnings = WarningsAsErrors.Split(',');
                    foreach (string s in warnings)
                    {
                        arguments += string.Format(@" -wx{0}", s);
                    }
                }

                if (SupressAllWarnings)
                {
                    arguments += string.Format(boolFormat, @"-swall");
                }
                else if (!string.IsNullOrEmpty(SupressWarning))
                {
                    string[] warnings = WarningsAsErrors.Split(',');
                    foreach (string s in warnings)
                    {
                        arguments += string.Format(@" -sw{0}", s);
                    }
                }

                if (AdminImage)
                {
                    arguments += string.Format(@" -a");
                }
                if (NoTidy)
                {
                    arguments += string.Format(@" -notidy");
                }
                if (PreserveUnmodifiedContent)
                {
                    arguments += string.Format(@" -p");
                }
                if (ShowPedanticMessages)
                {
                    arguments += string.Format(@" -pedantic");
                }
                if (WiXInputFormat)
                {
                    arguments += string.Format(@" -xi");
                }
                if (WiXOutputFormat)
                {
                    arguments += string.Format(@" -xo");
                }

                if (!string.IsNullOrEmpty(ExtractedBinariesPath))
                {
                    arguments += string.Format(stringFormat, @"-x ""{0}""", ExtractedBinariesPath);
                }

                if (!string.IsNullOrEmpty(ValidationFlags))
                {
                    string[] flags = ValidationFlags.Split(',');
                    foreach (string f in flags)
                    {
                        switch (f.ToLower())
                        {
                        case "g":
                        case "l":
                        case "r":
                        case "s":
                        case "t":
                        case "u":
                        case "v":
                        case "w":
                        case "x":
                        case "y":
                        case "z":
                            break;

                        default:
                            throw new Exception(string.Format("Bad validation flag value of '{0}' in '{1}'.  Expected any of g,l,r,s,t,u,v,w,x,y,z!  Split on comma is done!", f, ValidationFlags));
                        }
                        arguments += string.Format(stringFormat, @"-val", f);
                    }
                }

                if (!string.IsNullOrEmpty(ValidationErrorsToSupress))
                {
                    string[] errors = ValidationErrorsToSupress.Split(',');
                    foreach (string e in errors)
                    {
                        switch (e.ToLower())
                        {
                        case "a":
                        case "b":
                        case "c":
                        case "d":
                        case "e":
                        case "f":
                            break;

                        default:
                            throw new Exception(string.Format("Bad validationErrorToSupress value of '{0}' in '{1}'.  Expected a through f!  Split on comma is done!", e, ValidationErrorsToSupress));
                        }
                        arguments += string.Format(stringFormat, @"-serr", e);
                    }
                }

                if (!string.IsNullOrEmpty(TransformationType))
                {
                    switch (TransformationType.ToLower())
                    {
                    case "language":
                    case "instance":
                    case "patch":
                        break;

                    default:
                        throw new Exception("Bad transformationType.  language || instance || patch !!!");
                    }
                    ;
                    arguments += string.Format(stringFormat, @"-t", TransformationType);
                }

                if (!string.IsNullOrEmpty(ExtensionClassAssemblyFullyQualifiedClassName))
                {
                    arguments += string.Format(stringFormat, @"-ext", ExtensionClassAssemblyFullyQualifiedClassName);
                }

                if (base.Verbose)
                {
                    arguments += string.Format(boolFormat, @"-v");
                }

                FileInfo targetMSIFile  = new FileInfo(TargetInputMSIFilename);
                FileInfo updatedMSIFile = new FileInfo(UpdatedInputMSIFilename);

                if (!targetMSIFile.Exists)
                {
                    throw new FileNotFoundException(string.Format("Can't find target (RTM) MSI file at [{0}].", targetMSIFile.FullName));
                }
                if (!updatedMSIFile.Exists)
                {
                    throw new FileNotFoundException(string.Format("Can't find updated (Upgrade) MSI file at [{0}].", updatedMSIFile.FullName));
                }

                base.CommandLineArguments = string.Format(@"{0} ""{1}"" ""{2}"" -out {3}", arguments, targetMSIFile.FullName, updatedMSIFile.FullName, Out);

                Log(Level.Info, base.CommandLineArguments);

                base.ExecuteTask();
                Log(Level.Info, "Done!");
            }
            catch (Exception ex)
            {
                Log(Level.Info, "Exception handled");

                Exception e = ex;
                while (null != e)
                {
                    Log(Level.Error, ex.Message);
                    Log(Level.Error, ex.StackTrace);

                    e = e.InnerException;
                }

                throw;
            }
        }
Beispiel #7
0
        protected override void ExecuteTask()
        {
            if (DebugTask && !System.Diagnostics.Debugger.IsAttached)
            {
                System.Diagnostics.Debugger.Launch();
            }

            Log(Level.Info, "Set Up");

            try
            {
                if (string.IsNullOrEmpty(base.FileName))
                {
                    base.FileName = "light.exe";
                }

                const string boolFormat   = @" {0}";
                const string stringFormat = @" {0} {1}";

                string arguments = string.Empty;

                if (NoLogo)
                {
                    arguments += string.Format(boolFormat, @"-nologo");
                }

                if (AllWarningsAsErrors)
                {
                    arguments += string.Format(boolFormat, @"-wxall");
                }
                else if (!string.IsNullOrEmpty(WarningsAsErrors))
                {
                    string[] warnings = WarningsAsErrors.Split(',');
                    foreach (string s in warnings)
                    {
                        arguments += string.Format(@" -wx{0}", s);
                    }
                }

                if (SupressAllWarnings)
                {
                    arguments += string.Format(boolFormat, @"-swall");
                }
                else if (!string.IsNullOrEmpty(SupressWarning))
                {
                    string[] warnings = WarningsAsErrors.Split(',');
                    foreach (string s in warnings)
                    {
                        arguments += string.Format(@" -sw{0}", s);
                    }
                }

                if (NoTidy)
                {
                    arguments += string.Format(@" -notidy");
                }

                if (!string.IsNullOrEmpty(ExtensionClassAssemblyFullyQualifiedClassName))
                {
                    arguments += string.Format(stringFormat, @"-ext", ExtensionClassAssemblyFullyQualifiedClassName);
                }

                if (base.Verbose)
                {
                    arguments += string.Format(boolFormat, @"-v");
                }

                if (!string.IsNullOrEmpty(BinderPath))
                {
                    arguments += string.Format(@" -b ""{0}""", BinderPath);
                }

                arguments += string.Format(@" -out ""{0}""", Out);

                foreach (string objectFile in InElement.Items.AsIs)
                {
                    if (!File.Exists(objectFile))
                    {
                        throw new Exception(string.Format("File {0} not found.", objectFile));
                    }

                    arguments += string.Format(@" ""{0}""", objectFile);
                }

                base.CommandLineArguments = string.Format(@"{0}", arguments);

                Log(Level.Info, base.CommandLineArguments);

                base.ExecuteTask();
                Log(Level.Info, "Done!");
            }
            catch (Exception ex)
            {
                Log(Level.Info, "Exception handled");

                Exception e = ex;
                while (null != e)
                {
                    Log(Level.Error, ex.Message);
                    Log(Level.Error, ex.StackTrace);

                    e = e.InnerException;
                }

                throw;
            }
        }
Beispiel #8
0
        protected override void ExecuteTask()
        {
            if (DebugTask && !System.Diagnostics.Debugger.IsAttached)
            {
                System.Diagnostics.Debugger.Launch();
            }

            Log(Level.Info, "Set Up");

            try
            {
                if (string.IsNullOrEmpty(base.FileName))
                {
                    base.FileName = "pyro.exe";
                }

                const string boolFormat   = @" {0}";
                const string stringFormat = @" {0} {1}";

                string arguments = string.Empty;

                if (NoLogo)
                {
                    arguments += string.Format(boolFormat, @"-nologo");
                }

                if (AllWarningsAsErrors)
                {
                    arguments += string.Format(boolFormat, @"-wxall");
                }
                else if (!string.IsNullOrEmpty(WarningsAsErrors))
                {
                    string[] warnings = WarningsAsErrors.Split(',');
                    foreach (string s in warnings)
                    {
                        arguments += string.Format(@" -wx{0}", s);
                    }
                }

                if (SupressAllWarnings)
                {
                    arguments += string.Format(boolFormat, @"-swall");
                }
                else if (!string.IsNullOrEmpty(SupressWarning))
                {
                    string[] warnings = WarningsAsErrors.Split(',');
                    foreach (string s in warnings)
                    {
                        arguments += string.Format(@" -sw{0}", s);
                    }
                }

                if (NoTidy)
                {
                    arguments += string.Format(boolFormat, @"-notidy");
                }

                if (!string.IsNullOrEmpty(ExtensionClassAssemblyFullyQualifiedClassName))
                {
                    arguments += string.Format(@" -ext ""{0}""", ExtensionClassAssemblyFullyQualifiedClassName);
                }

                if (base.Verbose)
                {
                    arguments += string.Format(boolFormat, @"-v");
                }

                if (SupressAssemblies)
                {
                    arguments += string.Format(boolFormat, @"-sa");
                }
                if (SupressFiles)
                {
                    arguments += string.Format(boolFormat, @"-sf");
                }
                if (SupressFileInfo)
                {
                    arguments += string.Format(boolFormat, @"-sh");
                }
                if (SupressWiXPDBOutput)
                {
                    arguments += string.Format(boolFormat, @"-spdb");
                }
                if (ResueCABFiles)
                {
                    arguments += string.Format(boolFormat, @"-reusecab");
                }
                if (UpdateFileVersionEntries)
                {
                    arguments += string.Format(boolFormat, @"-fv");
                }
                if (CreateBinayDeltaPatch)
                {
                    arguments += string.Format(boolFormat, @"-delta");
                }

                if (!string.IsNullOrEmpty(NewBindPathForTarget))
                {
                    arguments += string.Format(@" -bt ""{0}""", NewBindPathForTarget);
                }
                if (!string.IsNullOrEmpty(NewBindPathForUpgrade))
                {
                    arguments += string.Format(@" -bu ""{0}""", NewBindPathForUpgrade);
                }

                if (null != CabCachePath && !CabCachePath.Exists)
                {
                    arguments += string.Format(@" -cc ""{0}""", CabCachePath);
                }

                if (!string.IsNullOrEmpty(PDBOutputFilename))
                {
                    arguments += string.Format(@" -pdbout ""{0}""", PDBOutputFilename);
                }

                if (null == InElement || 0 == InElement.Items.AsIs.Count)
                {
                    Log(Level.Info, @"Empty items!"); return;
                }

                foreach (string baselineArg in InElement.Items.AsIs)
                {
                    string[] parts = baselineArg.Split(';');
                    arguments += string.Format(@" -t {0} {1}", parts[0], parts[1]);
                }

                base.CommandLineArguments = string.Format(@"""{0}"" {2} -out ""{1}""", InputFilename, Out, arguments);

                Log(Level.Info, base.CommandLineArguments);

                base.ExecuteTask();
                Log(Level.Info, "Done!");
            }
            catch (Exception ex)
            {
                Log(Level.Info, "Exception handled");

                Exception e = ex;
                while (null != e)
                {
                    Log(Level.Error, ex.Message);
                    Log(Level.Error, ex.StackTrace);

                    e = e.InnerException;
                }

                throw;
            }
        }
Beispiel #9
0
        protected override void ExecuteTask()
        {
            if (DebugTask && !System.Diagnostics.Debugger.IsAttached)
            {
                System.Diagnostics.Debugger.Launch();
            }

            Log(Level.Info, "Set Up");

            try
            {
                base.FileName = "heat.exe";

                const string boolFormat   = @" {0}";
                const string stringFormat = @" {0} {1}";

                string arguments = string.Empty;
                if (AllWarningsAsErrors)
                {
                    arguments += string.Format(boolFormat, @"-wxall");
                }

                if (!string.IsNullOrEmpty(WarningsAsErrors))
                {
                    string[] warnings = WarningsAsErrors.Split(',');
                    foreach (string s in warnings)
                    {
                        arguments += string.Format(@" -wx{0}", s);
                    }
                }

                if (!string.IsNullOrEmpty(SupressWarning))
                {
                    string[] warnings = WarningsAsErrors.Split(',');
                    foreach (string s in warnings)
                    {
                        arguments += string.Format(@" -sw{0}", s);
                    }
                }

                if (WixVar)
                {
                    arguments += string.Format(boolFormat, @"-wixvar");
                }

                if (!string.IsNullOrEmpty(Var))
                {
                    arguments += string.Format(stringFormat, @"-var", Var);
                }

                if (base.Verbose)
                {
                    arguments += string.Format(boolFormat, @"-v");
                }

                if (!string.IsNullOrEmpty(Template))
                {
                    arguments += string.Format(stringFormat, @"-template", Template);
                }

                if (!string.IsNullOrEmpty(TransformXSLTFilename))
                {
                    arguments += string.Format(stringFormat, @"-t", TransformXSLTFilename);
                }

                if (SupressAllWarnings)
                {
                    arguments += string.Format(boolFormat, @"-swall");
                }

                if (SVB6)
                {
                    arguments += string.Format(boolFormat, @"-svb6");
                }

                if (SUID)
                {
                    arguments += string.Format(boolFormat, @"-suid");
                }

                if (SREG)
                {
                    arguments += string.Format(boolFormat, @"-sreg");
                }

                if (SRD)
                {
                    arguments += string.Format(boolFormat, @"-srd");
                }

                if (SFRAG)
                {
                    arguments += string.Format(boolFormat, @"-sfrag");
                }

                if (SCOM)
                {
                    arguments += string.Format(boolFormat, @"-scom");
                }

                if (!string.IsNullOrEmpty(ProjectName))
                {
                    arguments += string.Format(stringFormat, @"-projectname", ProjectName);
                }

                if (!string.IsNullOrEmpty(Platform))
                {
                    arguments += string.Format(stringFormat, @"-platform", Platform);
                }

                if (NoLogo)
                {
                    arguments += string.Format(boolFormat, @"-nologo");
                }

                if (KeepEmptyDirectories)
                {
                    arguments += string.Format(boolFormat, @"-ke");
                }

                if (GenerateGuidsNow)
                {
                    arguments += string.Format(boolFormat, @"-gg");
                }

                if (!string.IsNullOrEmpty(Generate))
                {
                    arguments += string.Format(stringFormat, @"-generate", Generate);
                }

                if (!string.IsNullOrEmpty(ExtensionClassAssemblyFullyQualifiedClassName))
                {
                    arguments += string.Format(stringFormat, @"-ext", ExtensionClassAssemblyFullyQualifiedClassName);
                }

                if (!string.IsNullOrEmpty(DirectoryName))
                {
                    arguments += string.Format(stringFormat, @"-dr", DirectoryName);
                }

                if (!string.IsNullOrEmpty(DirectoryId))
                {
                    arguments += string.Format(stringFormat, @"-directoryid", DirectoryId);
                }

                if (!string.IsNullOrEmpty(Configuration))
                {
                    arguments += string.Format(stringFormat, @"-configuration", Configuration);
                }

                if (!string.IsNullOrEmpty(ComponentGroupName))
                {
                    arguments += string.Format(stringFormat, @"-cg", ComponentGroupName);
                }

                if (AutoGenerateGuidsAtCompileTime)
                {
                    arguments += string.Format(boolFormat, @"-ag");
                }

                base.CommandLineArguments = string.Format(@"{0} ""{1}""{2} -out {3}", HarvestType, HarvestSource, arguments, Out);

                Log(Level.Info, base.CommandLineArguments);

                base.ExecuteTask();
                Log(Level.Info, "Done!");
            }
            catch (Exception ex)
            {
                Log(Level.Info, "Exception handled");

                Exception e = ex;
                while (null != e)
                {
                    Log(Level.Error, ex.Message);
                    Log(Level.Error, ex.StackTrace);

                    e = e.InnerException;
                }

                throw;
            }
        }