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/CreateItemAvoidingInference.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/CreateItemAvoidingInference.cs')
| -rw-r--r-- | src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs b/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs new file mode 100644 index 00000000..84816cac --- /dev/null +++ b/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs | |||
| @@ -0,0 +1,60 @@ | |||
| 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.Collections; | ||
| 7 | using System.Collections.Generic; | ||
| 8 | using System.Globalization; | ||
| 9 | using System.IO; | ||
| 10 | using System.Xml; | ||
| 11 | using Microsoft.Build.Framework; | ||
| 12 | using Microsoft.Build.Utilities; | ||
| 13 | |||
| 14 | /// <summary> | ||
| 15 | /// This task assigns Culture metadata to files based on the value of the Culture attribute on the | ||
| 16 | /// WixLocalization element inside the file. | ||
| 17 | /// </summary> | ||
| 18 | public class CreateItemAvoidingInference : Task | ||
| 19 | { | ||
| 20 | private string inputProperties; | ||
| 21 | private ITaskItem[] outputItems; | ||
| 22 | |||
| 23 | /// <summary> | ||
| 24 | /// The output items. | ||
| 25 | /// </summary> | ||
| 26 | [Output] | ||
| 27 | public ITaskItem[] OuputItems | ||
| 28 | { | ||
| 29 | get { return this.outputItems; } | ||
| 30 | } | ||
| 31 | |||
| 32 | /// <summary> | ||
| 33 | /// The properties to converty to items. | ||
| 34 | /// </summary> | ||
| 35 | [Required] | ||
| 36 | public string InputProperties | ||
| 37 | { | ||
| 38 | get { return this.inputProperties; } | ||
| 39 | set { this.inputProperties = value; } | ||
| 40 | } | ||
| 41 | |||
| 42 | /// <summary> | ||
| 43 | /// Gets a complete list of external cabs referenced by the given installer database file. | ||
| 44 | /// </summary> | ||
| 45 | /// <returns>True upon completion of the task execution.</returns> | ||
| 46 | public override bool Execute() | ||
| 47 | { | ||
| 48 | List<ITaskItem> newItems = new List<ITaskItem>(); | ||
| 49 | |||
| 50 | foreach (string property in this.inputProperties.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) | ||
| 51 | { | ||
| 52 | newItems.Add(new TaskItem(property)); | ||
| 53 | } | ||
| 54 | |||
| 55 | this.outputItems = newItems.ToArray(); | ||
| 56 | |||
| 57 | return true; | ||
| 58 | } | ||
| 59 | } | ||
| 60 | } | ||
