aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/CommandLine/CompileCommand.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2017-12-19 12:25:40 -0800
committerRob Mensching <rob@firegiant.com>2017-12-19 12:25:40 -0800
commit155a6e96346e0cb3d9ab6f5372fa29b46ebaee89 (patch)
tree59d1f151bfde8068b6014b05b5c8cfea3402c974 /src/WixToolset.Core/CommandLine/CompileCommand.cs
parent6f1665ed759b31bd095f186f9239232c653597cd (diff)
downloadwix-155a6e96346e0cb3d9ab6f5372fa29b46ebaee89.tar.gz
wix-155a6e96346e0cb3d9ab6f5372fa29b46ebaee89.tar.bz2
wix-155a6e96346e0cb3d9ab6f5372fa29b46ebaee89.zip
Integrate simplified message handling
Diffstat (limited to 'src/WixToolset.Core/CommandLine/CompileCommand.cs')
-rw-r--r--src/WixToolset.Core/CommandLine/CompileCommand.cs9
1 files changed, 6 insertions, 3 deletions
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
11 11
12 internal class CompileCommand : ICommandLineCommand 12 internal class CompileCommand : ICommandLineCommand
13 { 13 {
14 public CompileCommand(IServiceProvider serviceProvider, IExtensionManager extensions, IEnumerable<SourceFile> sources, IDictionary<string, string> preprocessorVariables) 14 public CompileCommand(IServiceProvider serviceProvider, IMessaging messaging, IExtensionManager extensions, IEnumerable<SourceFile> sources, IDictionary<string, string> preprocessorVariables)
15 { 15 {
16 this.PreprocessorVariables = preprocessorVariables; 16 this.PreprocessorVariables = preprocessorVariables;
17 this.ServiceProvider = serviceProvider; 17 this.ServiceProvider = serviceProvider;
18 this.Messaging = messaging;
18 this.ExtensionManager = extensions; 19 this.ExtensionManager = extensions;
19 this.SourceFiles = sources; 20 this.SourceFiles = sources;
20 } 21 }
21 22
22 private IServiceProvider ServiceProvider { get; } 23 private IServiceProvider ServiceProvider { get; }
23 24
25 private IMessaging Messaging { get; }
26
24 private IExtensionManager ExtensionManager { get; } 27 private IExtensionManager ExtensionManager { get; }
25 28
26 public IEnumerable<string> IncludeSearchPaths { get; } 29 public IEnumerable<string> IncludeSearchPaths { get; }
@@ -34,7 +37,7 @@ namespace WixToolset.Core
34 foreach (var sourceFile in this.SourceFiles) 37 foreach (var sourceFile in this.SourceFiles)
35 { 38 {
36 var preprocessContext = this.ServiceProvider.GetService<IPreprocessContext>(); 39 var preprocessContext = this.ServiceProvider.GetService<IPreprocessContext>();
37 preprocessContext.Messaging = Messaging.Instance; 40 preprocessContext.Messaging = this.Messaging;
38 preprocessContext.Extensions = this.ExtensionManager.Create<IPreprocessorExtension>(); 41 preprocessContext.Extensions = this.ExtensionManager.Create<IPreprocessorExtension>();
39 preprocessContext.Platform = Platform.X86; // TODO: set this correctly 42 preprocessContext.Platform = Platform.X86; // TODO: set this correctly
40 preprocessContext.IncludeSearchPaths = this.IncludeSearchPaths?.ToList() ?? new List<string>(); 43 preprocessContext.IncludeSearchPaths = this.IncludeSearchPaths?.ToList() ?? new List<string>();
@@ -45,7 +48,7 @@ namespace WixToolset.Core
45 var document = preprocessor.Process(preprocessContext); 48 var document = preprocessor.Process(preprocessContext);
46 49
47 var compileContext = this.ServiceProvider.GetService<ICompileContext>(); 50 var compileContext = this.ServiceProvider.GetService<ICompileContext>();
48 compileContext.Messaging = Messaging.Instance; 51 compileContext.Messaging = this.Messaging;
49 compileContext.CompilationId = Guid.NewGuid().ToString("N"); 52 compileContext.CompilationId = Guid.NewGuid().ToString("N");
50 compileContext.Extensions = this.ExtensionManager.Create<ICompilerExtension>(); 53 compileContext.Extensions = this.ExtensionManager.Create<ICompilerExtension>();
51 compileContext.OutputPath = sourceFile.OutputPath; 54 compileContext.OutputPath = sourceFile.OutputPath;