From 155a6e96346e0cb3d9ab6f5372fa29b46ebaee89 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 19 Dec 2017 12:25:40 -0800 Subject: Integrate simplified message handling --- src/WixToolset.Core/CommandLine/CompileCommand.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/WixToolset.Core/CommandLine/CompileCommand.cs') diff --git a/src/WixToolset.Core/CommandLine/CompileCommand.cs b/src/WixToolset.Core/CommandLine/CompileCommand.cs index e7fcdd4d..856dd29f 100644 --- a/src/WixToolset.Core/CommandLine/CompileCommand.cs +++ b/src/WixToolset.Core/CommandLine/CompileCommand.cs @@ -11,16 +11,19 @@ namespace WixToolset.Core internal class CompileCommand : ICommandLineCommand { - public CompileCommand(IServiceProvider serviceProvider, IExtensionManager extensions, IEnumerable sources, IDictionary preprocessorVariables) + public CompileCommand(IServiceProvider serviceProvider, IMessaging messaging, IExtensionManager extensions, IEnumerable sources, IDictionary preprocessorVariables) { this.PreprocessorVariables = preprocessorVariables; this.ServiceProvider = serviceProvider; + this.Messaging = messaging; this.ExtensionManager = extensions; this.SourceFiles = sources; } private IServiceProvider ServiceProvider { get; } + private IMessaging Messaging { get; } + private IExtensionManager ExtensionManager { get; } public IEnumerable IncludeSearchPaths { get; } @@ -34,7 +37,7 @@ namespace WixToolset.Core foreach (var sourceFile in this.SourceFiles) { var preprocessContext = this.ServiceProvider.GetService(); - preprocessContext.Messaging = Messaging.Instance; + preprocessContext.Messaging = this.Messaging; preprocessContext.Extensions = this.ExtensionManager.Create(); preprocessContext.Platform = Platform.X86; // TODO: set this correctly preprocessContext.IncludeSearchPaths = this.IncludeSearchPaths?.ToList() ?? new List(); @@ -45,7 +48,7 @@ namespace WixToolset.Core var document = preprocessor.Process(preprocessContext); var compileContext = this.ServiceProvider.GetService(); - compileContext.Messaging = Messaging.Instance; + compileContext.Messaging = this.Messaging; compileContext.CompilationId = Guid.NewGuid().ToString("N"); compileContext.Extensions = this.ExtensionManager.Create(); compileContext.OutputPath = sourceFile.OutputPath; -- cgit v1.2.3-55-g6feb