diff options
Diffstat (limited to 'src/WixToolset.Core/Compiler.cs')
| -rw-r--r-- | src/WixToolset.Core/Compiler.cs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index cd51fed6..06f477c1 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs | |||
| @@ -15,6 +15,7 @@ namespace WixToolset.Core | |||
| 15 | using WixToolset.Data; | 15 | using WixToolset.Data; |
| 16 | using WixToolset.Data.Tuples; | 16 | using WixToolset.Data.Tuples; |
| 17 | using WixToolset.Extensibility; | 17 | using WixToolset.Extensibility; |
| 18 | using WixToolset.Extensibility.Data; | ||
| 18 | using WixToolset.Extensibility.Services; | 19 | using WixToolset.Extensibility.Services; |
| 19 | using Wix = WixToolset.Data.Serialize; | 20 | using Wix = WixToolset.Data.Serialize; |
| 20 | 21 | ||
| @@ -71,10 +72,14 @@ namespace WixToolset.Core | |||
| 71 | public Compiler(IServiceProvider serviceProvider) | 72 | public Compiler(IServiceProvider serviceProvider) |
| 72 | { | 73 | { |
| 73 | this.ServiceProvider = serviceProvider; | 74 | this.ServiceProvider = serviceProvider; |
| 75 | |||
| 76 | this.Messaging = serviceProvider.GetService<IMessaging>(); | ||
| 74 | } | 77 | } |
| 75 | 78 | ||
| 76 | private IServiceProvider ServiceProvider { get; } | 79 | private IServiceProvider ServiceProvider { get; } |
| 77 | 80 | ||
| 81 | public IMessaging Messaging { get; } | ||
| 82 | |||
| 78 | private ICompileContext Context { get; set; } | 83 | private ICompileContext Context { get; set; } |
| 79 | 84 | ||
| 80 | private CompilerCore Core { get; set; } | 85 | private CompilerCore Core { get; set; } |
| @@ -107,7 +112,6 @@ namespace WixToolset.Core | |||
| 107 | public Intermediate Execute() | 112 | public Intermediate Execute() |
| 108 | { | 113 | { |
| 109 | this.Context = this.ServiceProvider.GetService<ICompileContext>(); | 114 | this.Context = this.ServiceProvider.GetService<ICompileContext>(); |
| 110 | this.Context.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
| 111 | this.Context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<ICompilerExtension>(); | 115 | this.Context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<ICompilerExtension>(); |
| 112 | this.Context.CompilationId = this.CompliationId; | 116 | this.Context.CompilationId = this.CompliationId; |
| 113 | this.Context.OutputPath = this.OutputPath; | 117 | this.Context.OutputPath = this.OutputPath; |
| @@ -131,7 +135,7 @@ namespace WixToolset.Core | |||
| 131 | } | 135 | } |
| 132 | else | 136 | else |
| 133 | { | 137 | { |
| 134 | this.Context.Messaging.Write(ErrorMessages.DuplicateExtensionXmlSchemaNamespace(extension.GetType().ToString(), extension.Namespace.NamespaceName, collidingExtension.GetType().ToString())); | 138 | this.Messaging.Write(ErrorMessages.DuplicateExtensionXmlSchemaNamespace(extension.GetType().ToString(), extension.Namespace.NamespaceName, collidingExtension.GetType().ToString())); |
| 135 | } | 139 | } |
| 136 | 140 | ||
| 137 | extension.PreCompile(this.Context); | 141 | extension.PreCompile(this.Context); |
| @@ -142,9 +146,9 @@ namespace WixToolset.Core | |||
| 142 | { | 146 | { |
| 143 | var parseHelper = this.Context.ServiceProvider.GetService<IParseHelper>(); | 147 | var parseHelper = this.Context.ServiceProvider.GetService<IParseHelper>(); |
| 144 | 148 | ||
| 145 | this.Core = new CompilerCore(target, this.Context.Messaging, parseHelper, extensionsByNamespace); | 149 | this.Core = new CompilerCore(target, this.Messaging, parseHelper, extensionsByNamespace); |
| 146 | this.Core.ShowPedanticMessages = this.ShowPedanticMessages; | 150 | this.Core.ShowPedanticMessages = this.ShowPedanticMessages; |
| 147 | this.componentIdPlaceholdersResolver = new WixVariableResolver(this.Context.Messaging); | 151 | this.componentIdPlaceholdersResolver = new WixVariableResolver(this.Messaging); |
| 148 | 152 | ||
| 149 | // parse the document | 153 | // parse the document |
| 150 | var source = this.Context.Source; | 154 | var source = this.Context.Source; |
| @@ -185,7 +189,7 @@ namespace WixToolset.Core | |||
| 185 | this.Core = null; | 189 | this.Core = null; |
| 186 | } | 190 | } |
| 187 | 191 | ||
| 188 | return this.Context.Messaging.EncounteredError ? null : target; | 192 | return this.Messaging.EncounteredError ? null : target; |
| 189 | } | 193 | } |
| 190 | 194 | ||
| 191 | private void ResolveComponentIdPlaceholders(Intermediate target) | 195 | private void ResolveComponentIdPlaceholders(Intermediate target) |
