diff options
Diffstat (limited to 'src/WixToolset.BuildTasks/HeatTask.cs')
-rw-r--r-- | src/WixToolset.BuildTasks/HeatTask.cs | 52 |
1 files changed, 17 insertions, 35 deletions
diff --git a/src/WixToolset.BuildTasks/HeatTask.cs b/src/WixToolset.BuildTasks/HeatTask.cs index 8b12c48c..586f02f7 100644 --- a/src/WixToolset.BuildTasks/HeatTask.cs +++ b/src/WixToolset.BuildTasks/HeatTask.cs | |||
@@ -2,24 +2,18 @@ | |||
2 | 2 | ||
3 | namespace WixToolset.BuildTasks | 3 | namespace WixToolset.BuildTasks |
4 | { | 4 | { |
5 | using System; | ||
6 | using System.Diagnostics; | ||
7 | using System.Globalization; | ||
8 | using System.IO; | ||
9 | using System.Text; | ||
10 | |||
11 | using Microsoft.Build.Framework; | 5 | using Microsoft.Build.Framework; |
12 | using Microsoft.Build.Utilities; | 6 | using WixToolset.Extensibility; |
7 | using WixToolset.Extensibility.Data; | ||
8 | using WixToolset.Extensibility.Services; | ||
9 | using WixToolset.Harvesters; | ||
13 | 10 | ||
14 | #if false | ||
15 | /// <summary> | 11 | /// <summary> |
16 | /// A base MSBuild task to run the WiX harvester. | 12 | /// A base MSBuild task to run the WiX harvester. |
17 | /// Specific harvester tasks should extend this class. | 13 | /// Specific harvester tasks should extend this class. |
18 | /// </summary> | 14 | /// </summary> |
19 | public abstract class HeatTask : WixToolTask | 15 | public abstract class HeatTask : ToolsetTask |
20 | { | 16 | { |
21 | private const string HeatToolName = "Heat.exe"; | ||
22 | |||
23 | private bool autogenerageGuids; | 17 | private bool autogenerageGuids; |
24 | private bool generateGuidsNow; | 18 | private bool generateGuidsNow; |
25 | private ITaskItem outputFile; | 19 | private ITaskItem outputFile; |
@@ -65,15 +59,7 @@ namespace WixToolset.BuildTasks | |||
65 | set { this.transforms = value; } | 59 | set { this.transforms = value; } |
66 | } | 60 | } |
67 | 61 | ||
68 | /// <summary> | 62 | protected override string TaskShortName => "HEAT"; |
69 | /// Get the name of the executable. | ||
70 | /// </summary> | ||
71 | /// <remarks>The ToolName is used with the ToolPath to get the location of heat.exe.</remarks> | ||
72 | /// <value>The name of the executable.</value> | ||
73 | protected override string ToolName | ||
74 | { | ||
75 | get { return HeatToolName; } | ||
76 | } | ||
77 | 63 | ||
78 | /// <summary> | 64 | /// <summary> |
79 | /// Gets the name of the heat operation performed by the task. | 65 | /// Gets the name of the heat operation performed by the task. |
@@ -85,20 +71,19 @@ namespace WixToolset.BuildTasks | |||
85 | get; | 71 | get; |
86 | } | 72 | } |
87 | 73 | ||
88 | /// <summary> | 74 | protected override void ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) |
89 | /// Get the path to the executable. | ||
90 | /// </summary> | ||
91 | /// <remarks>GetFullPathToTool is only called when the ToolPath property is not set (see the ToolName remarks above).</remarks> | ||
92 | /// <returns>The full path to the executable or simply heat.exe if it's expected to be in the system path.</returns> | ||
93 | protected override string GenerateFullPathToTool() | ||
94 | { | 75 | { |
95 | // If there's not a ToolPath specified, it has to be in the system path. | 76 | this.Log.LogMessage(MessageImportance.Normal, "heat.exe " + commandLineString); |
96 | if (String.IsNullOrEmpty(this.ToolPath)) | 77 | |
97 | { | 78 | var messaging = serviceProvider.GetService<IMessaging>(); |
98 | return HeatToolName; | 79 | messaging.SetListener(listener); |
99 | } | 80 | |
81 | var arguments = serviceProvider.GetService<ICommandLineArguments>(); | ||
82 | arguments.Populate(commandLineString); | ||
100 | 83 | ||
101 | return Path.Combine(Path.GetFullPath(this.ToolPath), HeatToolName); | 84 | var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider, true); |
85 | var command = commandLine.ParseStandardCommandLine(arguments); | ||
86 | command?.Execute(); | ||
102 | } | 87 | } |
103 | 88 | ||
104 | /// <summary> | 89 | /// <summary> |
@@ -110,14 +95,11 @@ namespace WixToolset.BuildTasks | |||
110 | 95 | ||
111 | commandLineBuilder.AppendIfTrue("-ag", this.AutogenerateGuids); | 96 | commandLineBuilder.AppendIfTrue("-ag", this.AutogenerateGuids); |
112 | commandLineBuilder.AppendIfTrue("-gg", this.GenerateGuidsNow); | 97 | commandLineBuilder.AppendIfTrue("-gg", this.GenerateGuidsNow); |
113 | commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); | ||
114 | commandLineBuilder.AppendIfTrue("-sfrag", this.SuppressFragments); | 98 | commandLineBuilder.AppendIfTrue("-sfrag", this.SuppressFragments); |
115 | commandLineBuilder.AppendIfTrue("-suid", this.SuppressUniqueIds); | 99 | commandLineBuilder.AppendIfTrue("-suid", this.SuppressUniqueIds); |
116 | commandLineBuilder.AppendArrayIfNotNull("-sw", this.SuppressSpecificWarnings); | ||
117 | commandLineBuilder.AppendArrayIfNotNull("-t ", this.Transforms); | 100 | commandLineBuilder.AppendArrayIfNotNull("-t ", this.Transforms); |
118 | commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); | 101 | commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); |
119 | commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); | 102 | commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); |
120 | } | 103 | } |
121 | } | 104 | } |
122 | #endif | ||
123 | } | 105 | } |