diff options
Diffstat (limited to 'src/tools/WixToolset.HeatTasks/HeatProject.cs')
-rw-r--r-- | src/tools/WixToolset.HeatTasks/HeatProject.cs | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/tools/WixToolset.HeatTasks/HeatProject.cs b/src/tools/WixToolset.HeatTasks/HeatProject.cs new file mode 100644 index 00000000..d54f6ad1 --- /dev/null +++ b/src/tools/WixToolset.HeatTasks/HeatProject.cs | |||
@@ -0,0 +1,72 @@ | |||
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.HeatTasks | ||
4 | { | ||
5 | using Microsoft.Build.Framework; | ||
6 | |||
7 | public sealed class HeatProject : HeatTask | ||
8 | { | ||
9 | private string[] projectOutputGroups; | ||
10 | |||
11 | public string Configuration { get; set; } | ||
12 | |||
13 | public string DirectoryIds { get; set; } | ||
14 | |||
15 | public bool GenerateWixVariables { get; set; } | ||
16 | |||
17 | public string GenerateType { get; set; } | ||
18 | |||
19 | public string MsbuildBinPath { get; set; } | ||
20 | |||
21 | public string Platform { get; set; } | ||
22 | |||
23 | [Required] | ||
24 | public string Project { get; set; } | ||
25 | |||
26 | public string ProjectName { get; set; } | ||
27 | |||
28 | public string[] ProjectOutputGroups | ||
29 | { | ||
30 | get | ||
31 | { | ||
32 | return this.projectOutputGroups; | ||
33 | } | ||
34 | set | ||
35 | { | ||
36 | this.projectOutputGroups = value; | ||
37 | |||
38 | // If it's just one string and it contains semicolons, let's | ||
39 | // split it into separate items. | ||
40 | if (this.projectOutputGroups.Length == 1) | ||
41 | { | ||
42 | this.projectOutputGroups = this.projectOutputGroups[0].Split(new char[] { ';' }); | ||
43 | } | ||
44 | } | ||
45 | } | ||
46 | |||
47 | public bool UseToolsVersion { get; set; } | ||
48 | |||
49 | protected override string OperationName => "project"; | ||
50 | |||
51 | protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) | ||
52 | { | ||
53 | commandLineBuilder.AppendSwitch(this.OperationName); | ||
54 | commandLineBuilder.AppendFileNameIfNotNull(this.Project); | ||
55 | |||
56 | commandLineBuilder.AppendSwitchIfNotNull("-configuration ", this.Configuration); | ||
57 | commandLineBuilder.AppendSwitchIfNotNull("-directoryid ", this.DirectoryIds); | ||
58 | commandLineBuilder.AppendSwitchIfNotNull("-generate ", this.GenerateType); | ||
59 | commandLineBuilder.AppendSwitchIfNotNull("-msbuildbinpath ", this.MsbuildBinPath); | ||
60 | commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.Platform); | ||
61 | commandLineBuilder.AppendArrayIfNotNull("-pog ", this.ProjectOutputGroups); | ||
62 | commandLineBuilder.AppendSwitchIfNotNull("-projectname ", this.ProjectName); | ||
63 | commandLineBuilder.AppendIfTrue("-wixvar", this.GenerateWixVariables); | ||
64 | |||
65 | #if !NETCOREAPP | ||
66 | commandLineBuilder.AppendIfTrue("-usetoolsversion", this.UseToolsVersion); | ||
67 | #endif | ||
68 | |||
69 | base.BuildCommandLine(commandLineBuilder); | ||
70 | } | ||
71 | } | ||
72 | } | ||