From 306f1d0c528cb6c151594ff96a41b5c01a5c4d9b Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 21 Jul 2018 07:36:34 -0700 Subject: Integrate tools from Core project --- .../CreateItemAvoidingInference.cs | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs (limited to 'src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs') 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 @@ +// 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. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + using System.Xml; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task assigns Culture metadata to files based on the value of the Culture attribute on the + /// WixLocalization element inside the file. + /// + public class CreateItemAvoidingInference : Task + { + private string inputProperties; + private ITaskItem[] outputItems; + + /// + /// The output items. + /// + [Output] + public ITaskItem[] OuputItems + { + get { return this.outputItems; } + } + + /// + /// The properties to converty to items. + /// + [Required] + public string InputProperties + { + get { return this.inputProperties; } + set { this.inputProperties = value; } + } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + List newItems = new List(); + + foreach (string property in this.inputProperties.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) + { + newItems.Add(new TaskItem(property)); + } + + this.outputItems = newItems.ToArray(); + + return true; + } + } +} -- cgit v1.2.3-55-g6feb