diff options
author | Rob Mensching <rob@firegiant.com> | 2018-10-19 02:57:04 -0700 |
---|---|---|
committer | Rob Mensching <rob@robmensching.com> | 2018-10-24 21:17:34 -0700 |
commit | 7d302ba01db5b2a9e255cfade17b1c3d687fdee2 (patch) | |
tree | 2723d4361db7cc8d0db118fc2ada16a3a798ac41 | |
parent | 13eedbfcf97e402ade06f2be29f98723ef7ff286 (diff) | |
download | wix-7d302ba01db5b2a9e255cfade17b1c3d687fdee2.tar.gz wix-7d302ba01db5b2a9e255cfade17b1c3d687fdee2.tar.bz2 wix-7d302ba01db5b2a9e255cfade17b1c3d687fdee2.zip |
Minor code cleanup/reorganization
-rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Decompiler.cs | 2 | ||||
-rw-r--r-- | src/WixToolset.Core/CommandLine/ParseCommandLine.cs | 22 | ||||
-rw-r--r-- | src/WixToolset.Core/Decompiler.cs | 7 | ||||
-rw-r--r-- | src/WixToolset.Core/ExtensibilityServices/FileTransfer.cs (renamed from src/WixToolset.Core/FileTransfer.cs) | 2 | ||||
-rw-r--r-- | src/WixToolset.Core/ExtensibilityServices/TrackedFile.cs (renamed from src/WixToolset.Core/TrackedFile.cs) | 2 | ||||
-rw-r--r-- | src/WixToolset.Core/ExtensibilityServices/Uuid.cs (renamed from src/WixToolset.Core/Uuid.cs) | 2 | ||||
-rw-r--r-- | src/WixToolset.Core/WixToolsetServiceProvider.cs | 2 |
7 files changed, 19 insertions, 20 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Decompiler.cs b/src/WixToolset.Core.WindowsInstaller/Decompiler.cs index 8136bf00..c5d68db3 100644 --- a/src/WixToolset.Core.WindowsInstaller/Decompiler.cs +++ b/src/WixToolset.Core.WindowsInstaller/Decompiler.cs | |||
@@ -1,6 +1,6 @@ | |||
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. | 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 | 2 | ||
3 | namespace WixToolset | 3 | namespace WixToolset.Core.WindowsInstaller |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Collections; | 6 | using System.Collections; |
diff --git a/src/WixToolset.Core/CommandLine/ParseCommandLine.cs b/src/WixToolset.Core/CommandLine/ParseCommandLine.cs index 7d0dcbd8..3cf6e032 100644 --- a/src/WixToolset.Core/CommandLine/ParseCommandLine.cs +++ b/src/WixToolset.Core/CommandLine/ParseCommandLine.cs | |||
@@ -25,11 +25,14 @@ namespace WixToolset.Core.CommandLine | |||
25 | this.ErrorArgument = errorArgument; | 25 | this.ErrorArgument = errorArgument; |
26 | } | 26 | } |
27 | 27 | ||
28 | public bool IsSwitch(string arg) => !String.IsNullOrEmpty(arg) && ('/' == arg[0] || '-' == arg[0]); | 28 | public bool IsSwitch(string arg) |
29 | { | ||
30 | return !String.IsNullOrEmpty(arg) && ('/' == arg[0] || '-' == arg[0]); | ||
31 | } | ||
29 | 32 | ||
30 | public void GetArgumentAsFilePathOrError(string argument, string fileType, IList<string> paths) | 33 | public void GetArgumentAsFilePathOrError(string argument, string fileType, IList<string> paths) |
31 | { | 34 | { |
32 | foreach (var path in GetFiles(argument, fileType)) | 35 | foreach (var path in this.GetFiles(argument, fileType)) |
33 | { | 36 | { |
34 | paths.Add(path); | 37 | paths.Add(path); |
35 | } | 38 | } |
@@ -60,7 +63,7 @@ namespace WixToolset.Core.CommandLine | |||
60 | 63 | ||
61 | public string GetNextArgumentAsDirectoryOrError(string commandLineSwitch) | 64 | public string GetNextArgumentAsDirectoryOrError(string commandLineSwitch) |
62 | { | 65 | { |
63 | if (this.TryGetNextNonSwitchArgumentOrError(out var arg) && TryGetDirectory(commandLineSwitch, this.Messaging, arg, out var directory)) | 66 | if (this.TryGetNextNonSwitchArgumentOrError(out var arg) && this.TryGetDirectory(commandLineSwitch, this.Messaging, arg, out var directory)) |
64 | { | 67 | { |
65 | return directory; | 68 | return directory; |
66 | } | 69 | } |
@@ -71,7 +74,7 @@ namespace WixToolset.Core.CommandLine | |||
71 | 74 | ||
72 | public bool GetNextArgumentAsDirectoryOrError(string commandLineSwitch, IList<string> directories) | 75 | public bool GetNextArgumentAsDirectoryOrError(string commandLineSwitch, IList<string> directories) |
73 | { | 76 | { |
74 | if (this.TryGetNextNonSwitchArgumentOrError(out var arg) && TryGetDirectory(commandLineSwitch, this.Messaging, arg, out var directory)) | 77 | if (this.TryGetNextNonSwitchArgumentOrError(out var arg) && this.TryGetDirectory(commandLineSwitch, this.Messaging, arg, out var directory)) |
75 | { | 78 | { |
76 | directories.Add(directory); | 79 | directories.Add(directory); |
77 | return true; | 80 | return true; |
@@ -96,7 +99,7 @@ namespace WixToolset.Core.CommandLine | |||
96 | { | 99 | { |
97 | if (this.TryGetNextNonSwitchArgumentOrError(out var arg)) | 100 | if (this.TryGetNextNonSwitchArgumentOrError(out var arg)) |
98 | { | 101 | { |
99 | foreach (var path in GetFiles(arg, fileType)) | 102 | foreach (var path in this.GetFiles(arg, fileType)) |
100 | { | 103 | { |
101 | paths.Add(path); | 104 | paths.Add(path); |
102 | } | 105 | } |
@@ -125,7 +128,10 @@ namespace WixToolset.Core.CommandLine | |||
125 | return result; | 128 | return result; |
126 | } | 129 | } |
127 | 130 | ||
128 | private static bool IsValidArg(string arg) => !(String.IsNullOrEmpty(arg) || '/' == arg[0] || '-' == arg[0]); | 131 | private static bool IsValidArg(string arg) |
132 | { | ||
133 | return !(String.IsNullOrEmpty(arg) || '/' == arg[0] || '-' == arg[0]); | ||
134 | } | ||
129 | 135 | ||
130 | private static bool TryDequeue(Queue<string> q, out string arg) | 136 | private static bool TryDequeue(Queue<string> q, out string arg) |
131 | { | 137 | { |
@@ -194,8 +200,8 @@ namespace WixToolset.Core.CommandLine | |||
194 | } | 200 | } |
195 | 201 | ||
196 | // Convert alternate directory separators to the standard one. | 202 | // Convert alternate directory separators to the standard one. |
197 | string filePath = searchPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); | 203 | var filePath = searchPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); |
198 | int lastSeparator = filePath.LastIndexOf(Path.DirectorySeparatorChar); | 204 | var lastSeparator = filePath.LastIndexOf(Path.DirectorySeparatorChar); |
199 | var files = new string[0]; | 205 | var files = new string[0]; |
200 | 206 | ||
201 | try | 207 | try |
diff --git a/src/WixToolset.Core/Decompiler.cs b/src/WixToolset.Core/Decompiler.cs index 5f14dfca..45cfbea0 100644 --- a/src/WixToolset.Core/Decompiler.cs +++ b/src/WixToolset.Core/Decompiler.cs | |||
@@ -3,7 +3,6 @@ | |||
3 | namespace WixToolset.Core | 3 | namespace WixToolset.Core |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using WixToolset.Data; | ||
7 | using WixToolset.Extensibility; | 6 | using WixToolset.Extensibility; |
8 | using WixToolset.Extensibility.Data; | 7 | using WixToolset.Extensibility.Data; |
9 | using WixToolset.Extensibility.Services; | 8 | using WixToolset.Extensibility.Services; |
@@ -18,12 +17,6 @@ namespace WixToolset.Core | |||
18 | this.ServiceProvider = serviceProvider; | 17 | this.ServiceProvider = serviceProvider; |
19 | } | 18 | } |
20 | 19 | ||
21 | public OutputType DecompileType { get; set; } | ||
22 | |||
23 | public string IntermediateFolder { get; set; } | ||
24 | |||
25 | public string OutputPath { get; set; } | ||
26 | |||
27 | public IServiceProvider ServiceProvider { get; } | 20 | public IServiceProvider ServiceProvider { get; } |
28 | 21 | ||
29 | public BindResult Decompile(IDecompileContext context) | 22 | public BindResult Decompile(IDecompileContext context) |
diff --git a/src/WixToolset.Core/FileTransfer.cs b/src/WixToolset.Core/ExtensibilityServices/FileTransfer.cs index 7f9ed0f3..2cad7cce 100644 --- a/src/WixToolset.Core/FileTransfer.cs +++ b/src/WixToolset.Core/ExtensibilityServices/FileTransfer.cs | |||
@@ -1,6 +1,6 @@ | |||
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. | 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 | 2 | ||
3 | namespace WixToolset.Core | 3 | namespace WixToolset.Core.ExtensibilityServices |
4 | { | 4 | { |
5 | using WixToolset.Data; | 5 | using WixToolset.Data; |
6 | using WixToolset.Extensibility.Data; | 6 | using WixToolset.Extensibility.Data; |
diff --git a/src/WixToolset.Core/TrackedFile.cs b/src/WixToolset.Core/ExtensibilityServices/TrackedFile.cs index 312b09f4..028cddbf 100644 --- a/src/WixToolset.Core/TrackedFile.cs +++ b/src/WixToolset.Core/ExtensibilityServices/TrackedFile.cs | |||
@@ -1,6 +1,6 @@ | |||
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. | 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 | 2 | ||
3 | namespace WixToolset.Core | 3 | namespace WixToolset.Core.ExtensibilityServices |
4 | { | 4 | { |
5 | using WixToolset.Data; | 5 | using WixToolset.Data; |
6 | using WixToolset.Extensibility.Data; | 6 | using WixToolset.Extensibility.Data; |
diff --git a/src/WixToolset.Core/Uuid.cs b/src/WixToolset.Core/ExtensibilityServices/Uuid.cs index c93d134d..a5692b71 100644 --- a/src/WixToolset.Core/Uuid.cs +++ b/src/WixToolset.Core/ExtensibilityServices/Uuid.cs | |||
@@ -1,6 +1,6 @@ | |||
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. | 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 | 2 | ||
3 | namespace WixToolset | 3 | namespace WixToolset.Core.ExtensibilityServices |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Net; | 6 | using System.Net; |
diff --git a/src/WixToolset.Core/WixToolsetServiceProvider.cs b/src/WixToolset.Core/WixToolsetServiceProvider.cs index 83b9356d..0337f771 100644 --- a/src/WixToolset.Core/WixToolsetServiceProvider.cs +++ b/src/WixToolset.Core/WixToolsetServiceProvider.cs | |||
@@ -92,7 +92,7 @@ namespace WixToolset.Core | |||
92 | public void AddService<T>(Func<IServiceProvider, Dictionary<Type, object>, T> creationFunction) | 92 | public void AddService<T>(Func<IServiceProvider, Dictionary<Type, object>, T> creationFunction) |
93 | where T : class | 93 | where T : class |
94 | { | 94 | { |
95 | AddService(typeof(T), creationFunction); | 95 | this.AddService(typeof(T), creationFunction); |
96 | } | 96 | } |
97 | 97 | ||
98 | private static T AddSingleton<T>(Dictionary<Type, object> singletons, T service) | 98 | private static T AddSingleton<T>(Dictionary<Type, object> singletons, T service) |