diff options
Diffstat (limited to 'src/WixToolset.Core/CommandLine')
7 files changed, 26 insertions, 20 deletions
diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs index 7b605da1..d8327b7a 100644 --- a/src/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs | |||
@@ -7,8 +7,7 @@ namespace WixToolset.Core.CommandLine | |||
7 | using System.IO; | 7 | using System.IO; |
8 | using System.Linq; | 8 | using System.Linq; |
9 | using WixToolset.Data; | 9 | using WixToolset.Data; |
10 | using WixToolset.Data.Bind; | 10 | using WixToolset.Extensibility.Data; |
11 | using WixToolset.Extensibility; | ||
12 | using WixToolset.Extensibility.Services; | 11 | using WixToolset.Extensibility.Services; |
13 | 12 | ||
14 | internal class BuildCommand : ICommandLineCommand | 13 | internal class BuildCommand : ICommandLineCommand |
diff --git a/src/WixToolset.Core/CommandLine/CommandLineArguments.cs b/src/WixToolset.Core/CommandLine/CommandLineArguments.cs index 37adcfd3..2f8226df 100644 --- a/src/WixToolset.Core/CommandLine/CommandLineArguments.cs +++ b/src/WixToolset.Core/CommandLine/CommandLineArguments.cs | |||
@@ -7,6 +7,7 @@ namespace WixToolset.Core.CommandLine | |||
7 | using System.IO; | 7 | using System.IO; |
8 | using System.Text; | 8 | using System.Text; |
9 | using System.Text.RegularExpressions; | 9 | using System.Text.RegularExpressions; |
10 | using WixToolset.Extensibility.Data; | ||
10 | using WixToolset.Extensibility.Services; | 11 | using WixToolset.Extensibility.Services; |
11 | 12 | ||
12 | internal class CommandLineArguments : ICommandLineArguments | 13 | internal class CommandLineArguments : ICommandLineArguments |
diff --git a/src/WixToolset.Core/CommandLine/CommandLineContext.cs b/src/WixToolset.Core/CommandLine/CommandLineContext.cs index c589222d..ea0cf3d4 100644 --- a/src/WixToolset.Core/CommandLine/CommandLineContext.cs +++ b/src/WixToolset.Core/CommandLine/CommandLineContext.cs | |||
@@ -3,6 +3,7 @@ | |||
3 | namespace WixToolset.Core.CommandLine | 3 | namespace WixToolset.Core.CommandLine |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using WixToolset.Extensibility.Data; | ||
6 | using WixToolset.Extensibility.Services; | 7 | using WixToolset.Extensibility.Services; |
7 | 8 | ||
8 | internal class CommandLineContext : ICommandLineContext | 9 | internal class CommandLineContext : ICommandLineContext |
@@ -14,8 +15,6 @@ namespace WixToolset.Core.CommandLine | |||
14 | 15 | ||
15 | public IServiceProvider ServiceProvider { get; } | 16 | public IServiceProvider ServiceProvider { get; } |
16 | 17 | ||
17 | public IMessaging Messaging { get; set; } | ||
18 | |||
19 | public IExtensionManager ExtensionManager { get; set; } | 18 | public IExtensionManager ExtensionManager { get; set; } |
20 | 19 | ||
21 | public ICommandLineArguments Arguments { get; set; } | 20 | public ICommandLineArguments Arguments { get; set; } |
diff --git a/src/WixToolset.Core/CommandLine/CommandLineParser.cs b/src/WixToolset.Core/CommandLine/CommandLineParser.cs index 65aea1fc..92944ab2 100644 --- a/src/WixToolset.Core/CommandLine/CommandLineParser.cs +++ b/src/WixToolset.Core/CommandLine/CommandLineParser.cs | |||
@@ -7,6 +7,7 @@ namespace WixToolset.Core.CommandLine | |||
7 | using System.IO; | 7 | using System.IO; |
8 | using WixToolset.Data; | 8 | using WixToolset.Data; |
9 | using WixToolset.Extensibility; | 9 | using WixToolset.Extensibility; |
10 | using WixToolset.Extensibility.Data; | ||
10 | using WixToolset.Extensibility.Services; | 11 | using WixToolset.Extensibility.Services; |
11 | 12 | ||
12 | internal enum Commands | 13 | internal enum Commands |
@@ -19,27 +20,34 @@ namespace WixToolset.Core.CommandLine | |||
19 | Bind, | 20 | Bind, |
20 | } | 21 | } |
21 | 22 | ||
22 | internal class CommandLineParser : ICommandLine | 23 | internal class CommandLineParser : ICommandLineParser |
23 | { | 24 | { |
24 | private IServiceProvider ServiceProvider { get; set; } | 25 | public CommandLineParser(IServiceProvider serviceProvider) |
26 | { | ||
27 | this.ServiceProvider = serviceProvider; | ||
28 | |||
29 | this.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
30 | } | ||
31 | |||
32 | private IServiceProvider ServiceProvider { get; } | ||
25 | 33 | ||
26 | private IMessaging Messaging { get; set; } | 34 | private IMessaging Messaging { get; set; } |
27 | 35 | ||
36 | public IExtensionManager ExtensionManager { get; set; } | ||
37 | |||
38 | public ICommandLineArguments Arguments { get; set; } | ||
39 | |||
28 | public static string ExpectedArgument { get; } = "expected argument"; | 40 | public static string ExpectedArgument { get; } = "expected argument"; |
29 | 41 | ||
30 | public string ActiveCommand { get; private set; } | 42 | public string ActiveCommand { get; private set; } |
31 | 43 | ||
32 | public IExtensionManager ExtensionManager { get; private set; } | 44 | public bool ShowHelp { get; private set; } |
33 | |||
34 | public bool ShowHelp { get; set; } | ||
35 | 45 | ||
36 | public ICommandLineCommand ParseStandardCommandLine(ICommandLineContext context) | 46 | public ICommandLineCommand ParseStandardCommandLine() |
37 | { | 47 | { |
38 | this.ServiceProvider = context.ServiceProvider; | 48 | var context = this.ServiceProvider.GetService<ICommandLineContext>(); |
39 | 49 | context.ExtensionManager = this.ExtensionManager ?? this.ServiceProvider.GetService<IExtensionManager>(); | |
40 | this.Messaging = context.Messaging ?? this.ServiceProvider.GetService<IMessaging>(); | 50 | context.Arguments = this.Arguments; |
41 | |||
42 | this.ExtensionManager = context.ExtensionManager ?? this.ServiceProvider.GetService<IExtensionManager>(); | ||
43 | 51 | ||
44 | var next = String.Empty; | 52 | var next = String.Empty; |
45 | 53 | ||
@@ -277,7 +285,7 @@ namespace WixToolset.Core.CommandLine | |||
277 | return OutputType.Unknown; | 285 | return OutputType.Unknown; |
278 | } | 286 | } |
279 | 287 | ||
280 | private ICommandLine Parse(ICommandLineContext context, Func<CommandLineParser, string, bool> parseCommand, Func<CommandLineParser, IParseCommandLine, string, bool> parseArgument) | 288 | private ICommandLineParser Parse(ICommandLineContext context, Func<CommandLineParser, string, bool> parseCommand, Func<CommandLineParser, IParseCommandLine, string, bool> parseArgument) |
281 | { | 289 | { |
282 | var extensions = this.ExtensionManager.Create<IExtensionCommandLine>(); | 290 | var extensions = this.ExtensionManager.Create<IExtensionCommandLine>(); |
283 | 291 | ||
diff --git a/src/WixToolset.Core/CommandLine/CompileCommand.cs b/src/WixToolset.Core/CommandLine/CompileCommand.cs index 123318f5..6bd0f25a 100644 --- a/src/WixToolset.Core/CommandLine/CompileCommand.cs +++ b/src/WixToolset.Core/CommandLine/CompileCommand.cs | |||
@@ -5,8 +5,7 @@ namespace WixToolset.Core.CommandLine | |||
5 | using System; | 5 | using System; |
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
8 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility.Data; |
9 | using WixToolset.Extensibility.Services; | ||
10 | 9 | ||
11 | internal class CompileCommand : ICommandLineCommand | 10 | internal class CompileCommand : ICommandLineCommand |
12 | { | 11 | { |
diff --git a/src/WixToolset.Core/CommandLine/HelpCommand.cs b/src/WixToolset.Core/CommandLine/HelpCommand.cs index 6e547d60..b1298e46 100644 --- a/src/WixToolset.Core/CommandLine/HelpCommand.cs +++ b/src/WixToolset.Core/CommandLine/HelpCommand.cs | |||
@@ -3,7 +3,7 @@ | |||
3 | namespace WixToolset.Core.CommandLine | 3 | namespace WixToolset.Core.CommandLine |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using WixToolset.Extensibility.Services; | 6 | using WixToolset.Extensibility.Data; |
7 | 7 | ||
8 | internal class HelpCommand : ICommandLineCommand | 8 | internal class HelpCommand : ICommandLineCommand |
9 | { | 9 | { |
diff --git a/src/WixToolset.Core/CommandLine/VersionCommand.cs b/src/WixToolset.Core/CommandLine/VersionCommand.cs index a04aac31..e67aafb8 100644 --- a/src/WixToolset.Core/CommandLine/VersionCommand.cs +++ b/src/WixToolset.Core/CommandLine/VersionCommand.cs | |||
@@ -3,7 +3,7 @@ | |||
3 | namespace WixToolset.Core.CommandLine | 3 | namespace WixToolset.Core.CommandLine |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using WixToolset.Extensibility.Services; | 6 | using WixToolset.Extensibility.Data; |
7 | 7 | ||
8 | internal class VersionCommand : ICommandLineCommand | 8 | internal class VersionCommand : ICommandLineCommand |
9 | { | 9 | { |