diff options
| author | Rob Mensching <rob@firegiant.com> | 2018-07-21 07:36:34 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2018-07-21 07:36:34 -0700 |
| commit | 306f1d0c528cb6c151594ff96a41b5c01a5c4d9b (patch) | |
| tree | 95deb0884b59decc082eae7adf5d65d45c5f3848 /src/WixToolset.BuildTasks/HeatProject.cs | |
| parent | 6fc54af07b10742e883f3a39ef0114e55e6a36a0 (diff) | |
| download | wix-306f1d0c528cb6c151594ff96a41b5c01a5c4d9b.tar.gz wix-306f1d0c528cb6c151594ff96a41b5c01a5c4d9b.tar.bz2 wix-306f1d0c528cb6c151594ff96a41b5c01a5c4d9b.zip | |
Integrate tools from Core project
Diffstat (limited to 'src/WixToolset.BuildTasks/HeatProject.cs')
| -rw-r--r-- | src/WixToolset.BuildTasks/HeatProject.cs | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/src/WixToolset.BuildTasks/HeatProject.cs b/src/WixToolset.BuildTasks/HeatProject.cs new file mode 100644 index 00000000..8620ffa3 --- /dev/null +++ b/src/WixToolset.BuildTasks/HeatProject.cs | |||
| @@ -0,0 +1,108 @@ | |||
| 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 Microsoft.Build.Framework; | ||
| 6 | |||
| 7 | public sealed class HeatProject : HeatTask | ||
| 8 | { | ||
| 9 | private string configuration; | ||
| 10 | private string directoryIds; | ||
| 11 | private string generateType; | ||
| 12 | private bool generateWixVariables; | ||
| 13 | private string platform; | ||
| 14 | private string project; | ||
| 15 | private string projectName; | ||
| 16 | private string[] projectOutputGroups; | ||
| 17 | |||
| 18 | public string Configuration | ||
| 19 | { | ||
| 20 | get { return this.configuration; } | ||
| 21 | set { this.configuration = value; } | ||
| 22 | } | ||
| 23 | |||
| 24 | public string DirectoryIds | ||
| 25 | { | ||
| 26 | get { return this.directoryIds; } | ||
| 27 | set { this.directoryIds = value; } | ||
| 28 | } | ||
| 29 | |||
| 30 | public bool GenerateWixVariables | ||
| 31 | { | ||
| 32 | get { return this.generateWixVariables; } | ||
| 33 | set { this.generateWixVariables = value; } | ||
| 34 | } | ||
| 35 | |||
| 36 | public string GenerateType | ||
| 37 | { | ||
| 38 | get { return this.generateType; } | ||
| 39 | set { this.generateType = value; } | ||
| 40 | } | ||
| 41 | |||
| 42 | public string Platform | ||
| 43 | { | ||
| 44 | get { return this.platform; } | ||
| 45 | set { this.platform = value; } | ||
| 46 | } | ||
| 47 | |||
| 48 | [Required] | ||
| 49 | public string Project | ||
| 50 | { | ||
| 51 | get { return this.project; } | ||
| 52 | set { this.project = value; } | ||
| 53 | } | ||
| 54 | |||
| 55 | public string ProjectName | ||
| 56 | { | ||
| 57 | get { return this.projectName; } | ||
| 58 | set { this.projectName = value; } | ||
| 59 | } | ||
| 60 | |||
| 61 | public string[] ProjectOutputGroups | ||
| 62 | { | ||
| 63 | get | ||
| 64 | { | ||
| 65 | return this.projectOutputGroups; | ||
| 66 | } | ||
| 67 | set | ||
| 68 | { | ||
| 69 | this.projectOutputGroups = value; | ||
| 70 | |||
| 71 | // If it's just one string and it contains semicolons, let's | ||
| 72 | // split it into separate items. | ||
| 73 | if (this.projectOutputGroups.Length == 1) | ||
| 74 | { | ||
| 75 | this.projectOutputGroups = this.projectOutputGroups[0].Split(new char[] { ';' }); | ||
| 76 | } | ||
| 77 | } | ||
| 78 | } | ||
| 79 | |||
| 80 | protected override string OperationName | ||
| 81 | { | ||
| 82 | get { return "project"; } | ||
| 83 | } | ||
| 84 | |||
| 85 | /// <summary> | ||
| 86 | /// Generate the command line arguments to write to the response file from the properties. | ||
| 87 | /// </summary> | ||
| 88 | /// <returns>Command line string.</returns> | ||
| 89 | protected override string GenerateResponseFileCommands() | ||
| 90 | { | ||
| 91 | WixCommandLineBuilder commandLineBuilder = new WixCommandLineBuilder(); | ||
| 92 | |||
| 93 | commandLineBuilder.AppendSwitch(this.OperationName); | ||
| 94 | commandLineBuilder.AppendFileNameIfNotNull(this.Project); | ||
| 95 | |||
| 96 | commandLineBuilder.AppendSwitchIfNotNull("-configuration ", this.Configuration); | ||
| 97 | commandLineBuilder.AppendSwitchIfNotNull("-directoryid ", this.DirectoryIds); | ||
| 98 | commandLineBuilder.AppendSwitchIfNotNull("-generate ", this.GenerateType); | ||
| 99 | commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.Platform); | ||
| 100 | commandLineBuilder.AppendArrayIfNotNull("-pog ", this.ProjectOutputGroups); | ||
| 101 | commandLineBuilder.AppendSwitchIfNotNull("-projectname ", this.ProjectName); | ||
| 102 | commandLineBuilder.AppendIfTrue("-wixvar", this.GenerateWixVariables); | ||
| 103 | |||
| 104 | base.BuildCommandLine(commandLineBuilder); | ||
| 105 | return commandLineBuilder.ToString(); | ||
| 106 | } | ||
| 107 | } | ||
| 108 | } | ||
