From 306f1d0c528cb6c151594ff96a41b5c01a5c4d9b Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 21 Jul 2018 07:36:34 -0700 Subject: Integrate tools from Core project --- src/WixToolset.BuildTasks/TaskBase.cs | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/WixToolset.BuildTasks/TaskBase.cs (limited to 'src/WixToolset.BuildTasks/TaskBase.cs') diff --git a/src/WixToolset.BuildTasks/TaskBase.cs b/src/WixToolset.BuildTasks/TaskBase.cs new file mode 100644 index 00000000..3d58fc06 --- /dev/null +++ b/src/WixToolset.BuildTasks/TaskBase.cs @@ -0,0 +1,65 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using Microsoft.Build.Utilities; + + public abstract class TaskBase : Task + { + public string ToolPath { get; set; } + + public string AdditionalOptions { get; set; } + + public bool RunAsSeparateProcess { get; set; } + + /// + /// Gets or sets whether all warnings should be suppressed. + /// + public bool SuppressAllWarnings { get; set; } + + /// + /// Gets or sets a list of specific warnings to be suppressed. + /// + public string[] SuppressSpecificWarnings { get; set; } + + /// + /// Gets or sets whether all warnings should be treated as errors. + /// + public bool TreatWarningsAsErrors { get; set; } + + /// + /// Gets or sets a list of specific warnings to treat as errors. + /// + public string[] TreatSpecificWarningsAsErrors { get; set; } + + /// + /// Gets or sets whether to display verbose output. + /// + public bool VerboseOutput { get; set; } + + /// + /// Gets or sets whether to display the logo. + /// + public bool NoLogo { get; set; } + + public override bool Execute() + { + try + { + this.ExecuteCore(); + } + catch (BuildException e) + { + this.Log.LogErrorFromException(e); + } + catch (Data.WixException e) + { + this.Log.LogErrorFromException(e); + } + + return !this.Log.HasLoggedErrors; + } + + protected abstract void ExecuteCore(); + } +} -- cgit v1.2.3-55-g6feb