From 5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 23 Jul 2018 14:21:40 -0700 Subject: Integrate Extensibility.Data namespace change from Extensibility repo --- src/WixToolset.Core/CommandLine/BuildCommand.cs | 3 +- .../CommandLine/CommandLineArguments.cs | 1 + .../CommandLine/CommandLineContext.cs | 3 +- .../CommandLine/CommandLineParser.cs | 32 ++++++++++++++-------- src/WixToolset.Core/CommandLine/CompileCommand.cs | 3 +- src/WixToolset.Core/CommandLine/HelpCommand.cs | 2 +- src/WixToolset.Core/CommandLine/VersionCommand.cs | 2 +- 7 files changed, 26 insertions(+), 20 deletions(-) (limited to 'src/WixToolset.Core/CommandLine') 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 using System.IO; using System.Linq; using WixToolset.Data; - using WixToolset.Data.Bind; - using WixToolset.Extensibility; + using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; 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 using System.IO; using System.Text; using System.Text.RegularExpressions; + using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; 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 @@ namespace WixToolset.Core.CommandLine { using System; + using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; internal class CommandLineContext : ICommandLineContext @@ -14,8 +15,6 @@ namespace WixToolset.Core.CommandLine public IServiceProvider ServiceProvider { get; } - public IMessaging Messaging { get; set; } - public IExtensionManager ExtensionManager { get; set; } 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 using System.IO; using WixToolset.Data; using WixToolset.Extensibility; + using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; internal enum Commands @@ -19,27 +20,34 @@ namespace WixToolset.Core.CommandLine Bind, } - internal class CommandLineParser : ICommandLine + internal class CommandLineParser : ICommandLineParser { - private IServiceProvider ServiceProvider { get; set; } + public CommandLineParser(IServiceProvider serviceProvider) + { + this.ServiceProvider = serviceProvider; + + this.Messaging = this.ServiceProvider.GetService(); + } + + private IServiceProvider ServiceProvider { get; } private IMessaging Messaging { get; set; } + public IExtensionManager ExtensionManager { get; set; } + + public ICommandLineArguments Arguments { get; set; } + public static string ExpectedArgument { get; } = "expected argument"; public string ActiveCommand { get; private set; } - public IExtensionManager ExtensionManager { get; private set; } - - public bool ShowHelp { get; set; } + public bool ShowHelp { get; private set; } - public ICommandLineCommand ParseStandardCommandLine(ICommandLineContext context) + public ICommandLineCommand ParseStandardCommandLine() { - this.ServiceProvider = context.ServiceProvider; - - this.Messaging = context.Messaging ?? this.ServiceProvider.GetService(); - - this.ExtensionManager = context.ExtensionManager ?? this.ServiceProvider.GetService(); + var context = this.ServiceProvider.GetService(); + context.ExtensionManager = this.ExtensionManager ?? this.ServiceProvider.GetService(); + context.Arguments = this.Arguments; var next = String.Empty; @@ -277,7 +285,7 @@ namespace WixToolset.Core.CommandLine return OutputType.Unknown; } - private ICommandLine Parse(ICommandLineContext context, Func parseCommand, Func parseArgument) + private ICommandLineParser Parse(ICommandLineContext context, Func parseCommand, Func parseArgument) { var extensions = this.ExtensionManager.Create(); 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 using System; using System.Collections.Generic; using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Services; + using WixToolset.Extensibility.Data; internal class CompileCommand : ICommandLineCommand { 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 @@ namespace WixToolset.Core.CommandLine { using System; - using WixToolset.Extensibility.Services; + using WixToolset.Extensibility.Data; internal class HelpCommand : ICommandLineCommand { 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 @@ namespace WixToolset.Core.CommandLine { using System; - using WixToolset.Extensibility.Services; + using WixToolset.Extensibility.Data; internal class VersionCommand : ICommandLineCommand { -- cgit v1.2.3-55-g6feb