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/HeatFile.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/HeatFile.cs')
| -rw-r--r-- | src/WixToolset.BuildTasks/HeatFile.cs | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/src/WixToolset.BuildTasks/HeatFile.cs b/src/WixToolset.BuildTasks/HeatFile.cs new file mode 100644 index 00000000..69e11b88 --- /dev/null +++ b/src/WixToolset.BuildTasks/HeatFile.cs | |||
| @@ -0,0 +1,95 @@ | |||
| 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 HeatFile : HeatTask | ||
| 8 | { | ||
| 9 | private string file; | ||
| 10 | private bool suppressCom; | ||
| 11 | private bool suppressRegistry; | ||
| 12 | private bool suppressRootDirectory; | ||
| 13 | private string template; | ||
| 14 | private string componentGroupName; | ||
| 15 | private string directoryRefId; | ||
| 16 | private string preprocessorVariable; | ||
| 17 | |||
| 18 | public string ComponentGroupName | ||
| 19 | { | ||
| 20 | get { return this.componentGroupName; } | ||
| 21 | set { this.componentGroupName = value; } | ||
| 22 | } | ||
| 23 | |||
| 24 | public string DirectoryRefId | ||
| 25 | { | ||
| 26 | get { return this.directoryRefId; } | ||
| 27 | set { this.directoryRefId = value; } | ||
| 28 | } | ||
| 29 | |||
| 30 | [Required] | ||
| 31 | public string File | ||
| 32 | { | ||
| 33 | get { return this.file; } | ||
| 34 | set { this.file = value; } | ||
| 35 | } | ||
| 36 | |||
| 37 | public string PreprocessorVariable | ||
| 38 | { | ||
| 39 | get { return this.preprocessorVariable; } | ||
| 40 | set { this.preprocessorVariable = value; } | ||
| 41 | } | ||
| 42 | |||
| 43 | public bool SuppressCom | ||
| 44 | { | ||
| 45 | get { return this.suppressCom; } | ||
| 46 | set { this.suppressCom = value; } | ||
| 47 | } | ||
| 48 | |||
| 49 | public bool SuppressRegistry | ||
| 50 | { | ||
| 51 | get { return this.suppressRegistry; } | ||
| 52 | set { this.suppressRegistry = value; } | ||
| 53 | } | ||
| 54 | |||
| 55 | public bool SuppressRootDirectory | ||
| 56 | { | ||
| 57 | get { return this.suppressRootDirectory; } | ||
| 58 | set { this.suppressRootDirectory = value; } | ||
| 59 | } | ||
| 60 | |||
| 61 | public string Template | ||
| 62 | { | ||
| 63 | get { return this.template; } | ||
| 64 | set { this.template = value; } | ||
| 65 | } | ||
| 66 | |||
| 67 | protected override string OperationName | ||
| 68 | { | ||
| 69 | get { return "file"; } | ||
| 70 | } | ||
| 71 | |||
| 72 | /// <summary> | ||
| 73 | /// Generate the command line arguments to write to the response file from the properties. | ||
| 74 | /// </summary> | ||
| 75 | /// <returns>Command line string.</returns> | ||
| 76 | protected override string GenerateResponseFileCommands() | ||
| 77 | { | ||
| 78 | WixCommandLineBuilder commandLineBuilder = new WixCommandLineBuilder(); | ||
| 79 | |||
| 80 | commandLineBuilder.AppendSwitch(this.OperationName); | ||
| 81 | commandLineBuilder.AppendFileNameIfNotNull(this.File); | ||
| 82 | |||
| 83 | commandLineBuilder.AppendSwitchIfNotNull("-cg ", this.ComponentGroupName); | ||
| 84 | commandLineBuilder.AppendSwitchIfNotNull("-dr ", this.DirectoryRefId); | ||
| 85 | commandLineBuilder.AppendIfTrue("-scom", this.SuppressCom); | ||
| 86 | commandLineBuilder.AppendIfTrue("-srd", this.SuppressRootDirectory); | ||
| 87 | commandLineBuilder.AppendIfTrue("-sreg", this.SuppressRegistry); | ||
| 88 | commandLineBuilder.AppendSwitchIfNotNull("-template ", this.Template); | ||
| 89 | commandLineBuilder.AppendSwitchIfNotNull("-var ", this.PreprocessorVariable); | ||
| 90 | |||
| 91 | base.BuildCommandLine(commandLineBuilder); | ||
| 92 | return commandLineBuilder.ToString(); | ||
| 93 | } | ||
| 94 | } | ||
| 95 | } | ||
