From 56ab717c8e1dc4c30b4350a384e2d98982983bb3 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 2 Apr 2020 21:20:22 +1000 Subject: Address breaking changes. --- src/WixToolset.BuildTasks/DoIt.cs | 6 +++--- src/test/WixToolsetTest.WixCop/WixCopRunner.cs | 5 +++-- src/wix/Program.cs | 6 +++--- src/wixcop/CommandLine/ConvertCommand.cs | 4 ++-- src/wixcop/CommandLine/WixCopCommandLineParser.cs | 4 ++-- src/wixcop/Program.cs | 4 ++-- 6 files changed, 15 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index 3aa9f5a3..ad89cc2c 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -111,7 +111,7 @@ namespace WixToolset.BuildTasks public override bool Execute() { - var serviceProvider = new WixToolsetServiceProvider(); + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); var listener = new MsbuildMessageListener(this.Log, "WIX", this.BuildEngine.ProjectFileOfTaskNode); @@ -136,7 +136,7 @@ namespace WixToolset.BuildTasks return !this.Log.HasLoggedErrors; } - private void ExecuteCore(IServiceProvider serviceProvider, IMessageListener listener) + private void ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener) { var commandLineString = this.BuildCommandLine(); @@ -191,7 +191,7 @@ namespace WixToolset.BuildTasks return commandLineBuilder.ToString(); } - private IExtensionManager CreateExtensionManagerWithStandardBackends(IServiceProvider serviceProvider, IMessaging messaging, string[] extensions) + private IExtensionManager CreateExtensionManagerWithStandardBackends(IWixToolsetServiceProvider serviceProvider, IMessaging messaging, string[] extensions) { var extensionManager = serviceProvider.GetService(); diff --git a/src/test/WixToolsetTest.WixCop/WixCopRunner.cs b/src/test/WixToolsetTest.WixCop/WixCopRunner.cs index b831baa7..d2a0abbe 100644 --- a/src/test/WixToolsetTest.WixCop/WixCopRunner.cs +++ b/src/test/WixToolsetTest.WixCop/WixCopRunner.cs @@ -7,6 +7,7 @@ namespace WixToolsetTest.WixCop using WixToolset.Core; using WixToolset.Core.TestPackage; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; using WixToolset.Tools.WixCop; using WixToolset.Tools.WixCop.CommandLine; using WixToolset.Tools.WixCop.Interfaces; @@ -45,7 +46,7 @@ namespace WixToolsetTest.WixCop { var listener = new TestMessageListener(); - var serviceProvider = new WixToolsetServiceProvider(); + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); serviceProvider.AddService((x, y) => listener); serviceProvider.AddService((x, y) => new WixCopCommandLineParser(x)); @@ -58,7 +59,7 @@ namespace WixToolsetTest.WixCop }; } - public static int Execute(IServiceProvider serviceProvider, string[] args) + public static int Execute(IWixToolsetServiceProvider serviceProvider, string[] args) { var wixcop = new Program(); return wixcop.Run(serviceProvider, args); diff --git a/src/wix/Program.cs b/src/wix/Program.cs index a3251f84..e2012ad2 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -24,7 +24,7 @@ namespace WixToolset.Tools [MTAThread] public static int Main(string[] args) { - var serviceProvider = new WixToolsetServiceProvider(); + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); var listener = new ConsoleMessageListener("WIX", "wix.exe"); @@ -58,7 +58,7 @@ namespace WixToolset.Tools /// Service provider to use throughout this execution. /// Command-line arguments to execute. /// Returns the application error code. - public int Run(IServiceProvider serviceProvider, IMessageListener listener, string[] args) + public int Run(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string[] args) { var messaging = serviceProvider.GetService(); messaging.SetListener(listener); @@ -73,7 +73,7 @@ namespace WixToolset.Tools return command?.Execute() ?? 1; } - private static IExtensionManager CreateExtensionManagerWithStandardBackends(IServiceProvider serviceProvider, IMessaging messaging, string[] extensions) + private static IExtensionManager CreateExtensionManagerWithStandardBackends(IWixToolsetServiceProvider serviceProvider, IMessaging messaging, string[] extensions) { var extensionManager = serviceProvider.GetService(); diff --git a/src/wixcop/CommandLine/ConvertCommand.cs b/src/wixcop/CommandLine/ConvertCommand.cs index a9a110fe..8b01faa7 100644 --- a/src/wixcop/CommandLine/ConvertCommand.cs +++ b/src/wixcop/CommandLine/ConvertCommand.cs @@ -14,7 +14,7 @@ namespace WixToolset.Tools.WixCop.CommandLine { private const string SettingsFileDefault = "wixcop.settings.xml"; - public ConvertCommand(IServiceProvider serviceProvider, bool fixErrors, int indentationAmount, List searchPatterns, bool subDirectories, string settingsFile1, string settingsFile2) + public ConvertCommand(IWixToolsetServiceProvider serviceProvider, bool fixErrors, int indentationAmount, List searchPatterns, bool subDirectories, string settingsFile1, string settingsFile2) { this.ErrorsAsWarnings = new HashSet(); this.ExemptFiles = new HashSet(); @@ -43,7 +43,7 @@ namespace WixToolset.Tools.WixCop.CommandLine private List SearchPatterns { get; } - private IServiceProvider ServiceProvider { get; } + private IWixToolsetServiceProvider ServiceProvider { get; } private string SettingsFile1 { get; } diff --git a/src/wixcop/CommandLine/WixCopCommandLineParser.cs b/src/wixcop/CommandLine/WixCopCommandLineParser.cs index 73247dae..3d34a649 100644 --- a/src/wixcop/CommandLine/WixCopCommandLineParser.cs +++ b/src/wixcop/CommandLine/WixCopCommandLineParser.cs @@ -14,14 +14,14 @@ namespace WixToolset.Tools.WixCop.CommandLine private bool fixErrors; private int indentationAmount; private readonly List searchPatterns; - private readonly IServiceProvider serviceProvider; + private readonly IWixToolsetServiceProvider serviceProvider; private string settingsFile1; private string settingsFile2; private bool showHelp; private bool showLogo; private bool subDirectories; - public WixCopCommandLineParser(IServiceProvider serviceProvider) + public WixCopCommandLineParser(IWixToolsetServiceProvider serviceProvider) { this.serviceProvider = serviceProvider; diff --git a/src/wixcop/Program.cs b/src/wixcop/Program.cs index 8e9534f6..e2174272 100644 --- a/src/wixcop/Program.cs +++ b/src/wixcop/Program.cs @@ -24,7 +24,7 @@ namespace WixToolset.Tools.WixCop [STAThread] public static int Main(string[] args) { - var serviceProvider = new WixToolsetServiceProvider(); + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); var listener = new ConsoleMessageListener("WXCP", "wixcop.exe"); serviceProvider.AddService((x, y) => listener); @@ -40,7 +40,7 @@ namespace WixToolset.Tools.WixCop /// Service provider to use throughout this execution. /// The commandline arguments. /// The number of errors that were found. - public int Run(IServiceProvider serviceProvider, string[] args) + public int Run(IWixToolsetServiceProvider serviceProvider, string[] args) { try { -- cgit v1.2.3-55-g6feb