diff options
Diffstat (limited to 'src/WixToolset.BuildTasks/heattask.cs')
-rw-r--r-- | src/WixToolset.BuildTasks/heattask.cs | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/src/WixToolset.BuildTasks/heattask.cs b/src/WixToolset.BuildTasks/heattask.cs deleted file mode 100644 index bf0a2ad3..00000000 --- a/src/WixToolset.BuildTasks/heattask.cs +++ /dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | // 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. | ||
2 | |||
3 | namespace WixToolset.BuildTasks | ||
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; | ||
12 | using Microsoft.Build.Utilities; | ||
13 | |||
14 | /// <summary> | ||
15 | /// A base MSBuild task to run the WiX harvester. | ||
16 | /// Specific harvester tasks should extend this class. | ||
17 | /// </summary> | ||
18 | public abstract class HeatTask : WixToolTask | ||
19 | { | ||
20 | private const string HeatToolName = "Heat.exe"; | ||
21 | |||
22 | private bool autogenerageGuids; | ||
23 | private bool generateGuidsNow; | ||
24 | private ITaskItem outputFile; | ||
25 | private bool suppressFragments; | ||
26 | private bool suppressUniqueIds; | ||
27 | private string[] transforms; | ||
28 | |||
29 | public bool AutogenerateGuids | ||
30 | { | ||
31 | get { return this.autogenerageGuids; } | ||
32 | set { this.autogenerageGuids = value; } | ||
33 | } | ||
34 | |||
35 | public bool GenerateGuidsNow | ||
36 | { | ||
37 | get { return this.generateGuidsNow; } | ||
38 | set { this.generateGuidsNow = value; } | ||
39 | } | ||
40 | |||
41 | [Required] | ||
42 | [Output] | ||
43 | public ITaskItem OutputFile | ||
44 | { | ||
45 | get { return this.outputFile; } | ||
46 | set { this.outputFile = value; } | ||
47 | } | ||
48 | |||
49 | public bool SuppressFragments | ||
50 | { | ||
51 | get { return this.suppressFragments; } | ||
52 | set { this.suppressFragments = value; } | ||
53 | } | ||
54 | |||
55 | public bool SuppressUniqueIds | ||
56 | { | ||
57 | get { return this.suppressUniqueIds; } | ||
58 | set { this.suppressUniqueIds = value; } | ||
59 | } | ||
60 | |||
61 | public string[] Transforms | ||
62 | { | ||
63 | get { return this.transforms; } | ||
64 | set { this.transforms = value; } | ||
65 | } | ||
66 | |||
67 | /// <summary> | ||
68 | /// Get the name of the executable. | ||
69 | /// </summary> | ||
70 | /// <remarks>The ToolName is used with the ToolPath to get the location of heat.exe.</remarks> | ||
71 | /// <value>The name of the executable.</value> | ||
72 | protected override string ToolName | ||
73 | { | ||
74 | get { return HeatToolName; } | ||
75 | } | ||
76 | |||
77 | /// <summary> | ||
78 | /// Gets the name of the heat operation performed by the task. | ||
79 | /// </summary> | ||
80 | /// <remarks>This is the first parameter passed on the heat.exe command-line.</remarks> | ||
81 | /// <value>The name of the heat operation performed by the task.</value> | ||
82 | protected abstract string OperationName | ||
83 | { | ||
84 | get; | ||
85 | } | ||
86 | |||
87 | /// <summary> | ||
88 | /// Get the path to the executable. | ||
89 | /// </summary> | ||
90 | /// <remarks>GetFullPathToTool is only called when the ToolPath property is not set (see the ToolName remarks above).</remarks> | ||
91 | /// <returns>The full path to the executable or simply heat.exe if it's expected to be in the system path.</returns> | ||
92 | protected override string GenerateFullPathToTool() | ||
93 | { | ||
94 | // If there's not a ToolPath specified, it has to be in the system path. | ||
95 | if (String.IsNullOrEmpty(this.ToolPath)) | ||
96 | { | ||
97 | return HeatToolName; | ||
98 | } | ||
99 | |||
100 | return Path.Combine(Path.GetFullPath(this.ToolPath), HeatToolName); | ||
101 | } | ||
102 | |||
103 | /// <summary> | ||
104 | /// Builds a command line from options in this task. | ||
105 | /// </summary> | ||
106 | protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) | ||
107 | { | ||
108 | base.BuildCommandLine(commandLineBuilder); | ||
109 | |||
110 | commandLineBuilder.AppendIfTrue("-ag", this.AutogenerateGuids); | ||
111 | commandLineBuilder.AppendIfTrue("-gg", this.GenerateGuidsNow); | ||
112 | commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); | ||
113 | commandLineBuilder.AppendIfTrue("-sfrag", this.SuppressFragments); | ||
114 | commandLineBuilder.AppendIfTrue("-suid", this.SuppressUniqueIds); | ||
115 | commandLineBuilder.AppendArrayIfNotNull("-sw", this.SuppressSpecificWarnings); | ||
116 | commandLineBuilder.AppendArrayIfNotNull("-t ", this.Transforms); | ||
117 | commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); | ||
118 | commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); | ||
119 | } | ||
120 | } | ||
121 | } | ||