From 39c7e2bb0399802e65a3025c4a73db211e730479 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sun, 1 Oct 2017 14:25:33 -0700 Subject: Add support for BindPaths and building .wixlibs --- src/WixToolset.BuildTasks/WixCommandLineBuilder.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/WixToolset.BuildTasks/WixCommandLineBuilder.cs') diff --git a/src/WixToolset.BuildTasks/WixCommandLineBuilder.cs b/src/WixToolset.BuildTasks/WixCommandLineBuilder.cs index 9a6a005d..3f3084a3 100644 --- a/src/WixToolset.BuildTasks/WixCommandLineBuilder.cs +++ b/src/WixToolset.BuildTasks/WixCommandLineBuilder.cs @@ -49,7 +49,7 @@ namespace WixToolset.BuildTasks /// /// Switch to append. /// Values specified by the user. - public void AppendArrayIfNotNull(string switchName, ITaskItem[] values) + public void AppendArrayIfNotNull(string switchName, IEnumerable values) { if (values != null) { @@ -65,7 +65,7 @@ namespace WixToolset.BuildTasks /// /// Switch to append. /// Values specified by the user. - public void AppendArrayIfNotNull(string switchName, string[] values) + public void AppendArrayIfNotNull(string switchName, IEnumerable values) { if (values != null) { @@ -77,9 +77,9 @@ namespace WixToolset.BuildTasks } /// - /// Build the extensions argument. Each extension is searched in the current folder, user defined search + /// Build the extensions argument. Each extension is searched in the current folder, user defined search /// directories (ReferencePath), HintPath, and under Wix Extension Directory in that order. - /// The order of precednce is based off of that described in Microsoft.Common.Targets's SearchPaths + /// The order of precedence is based off of that described in Microsoft.Common.Targets's SearchPaths /// property for the ResolveAssemblyReferences task. /// /// The list of extensions to include. @@ -92,21 +92,19 @@ namespace WixToolset.BuildTasks return; } - string resolvedPath; - foreach (ITaskItem extension in extensions) { string className = extension.GetMetadata("Class"); string fileName = Path.GetFileName(extension.ItemSpec); - if (Path.GetExtension(fileName).Length == 0) + if (String.IsNullOrEmpty(Path.GetExtension(fileName))) { fileName += ".dll"; } // First try reference paths - resolvedPath = FileSearchHelperMethods.SearchFilePaths(referencePaths, fileName); + var resolvedPath = FileSearchHelperMethods.SearchFilePaths(referencePaths, fileName); if (String.IsNullOrEmpty(resolvedPath)) { @@ -118,7 +116,7 @@ namespace WixToolset.BuildTasks // Now try the item itself resolvedPath = extension.ItemSpec; - if (Path.GetExtension(resolvedPath).Length == 0) + if (String.IsNullOrEmpty(Path.GetExtension(resolvedPath))) { resolvedPath += ".dll"; } -- cgit v1.2.3-55-g6feb