diff options
Diffstat (limited to 'src/WixToolset.BuildTasks/DoIt.cs')
-rw-r--r-- | src/WixToolset.BuildTasks/DoIt.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index d3bd7a80..924bf92f 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs | |||
@@ -9,6 +9,7 @@ namespace WixToolset.BuildTasks | |||
9 | using Microsoft.Build.Utilities; | 9 | using Microsoft.Build.Utilities; |
10 | using WixToolset.Core; | 10 | using WixToolset.Core; |
11 | using WixToolset.Data; | 11 | using WixToolset.Data; |
12 | using WixToolset.Extensibility.Services; | ||
12 | 13 | ||
13 | /// <summary> | 14 | /// <summary> |
14 | /// An MSBuild task to run the WiX compiler. | 15 | /// An MSBuild task to run the WiX compiler. |
@@ -164,10 +165,30 @@ namespace WixToolset.BuildTasks | |||
164 | 165 | ||
165 | this.Log.LogMessage(MessageImportance.Normal, "wix.exe " + commandLineString); | 166 | this.Log.LogMessage(MessageImportance.Normal, "wix.exe " + commandLineString); |
166 | 167 | ||
167 | var command = CommandLine.ParseStandardCommandLine(commandLineString); | 168 | var serviceProvider = new WixToolsetServiceProvider(); |
169 | |||
170 | var context = serviceProvider.GetService<ICommandLineContext>(); | ||
171 | context.Messaging = Messaging.Instance; | ||
172 | context.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider); | ||
173 | context.Arguments = commandLineString; | ||
174 | |||
175 | var commandLine = serviceProvider.GetService<ICommandLine>(); | ||
176 | var command = commandLine.ParseStandardCommandLine(context); | ||
168 | command?.Execute(); | 177 | command?.Execute(); |
169 | } | 178 | } |
170 | 179 | ||
180 | private IExtensionManager CreateExtensionManagerWithStandardBackends(IServiceProvider serviceProvider) | ||
181 | { | ||
182 | var extensionManager = serviceProvider.GetService<IExtensionManager>(); | ||
183 | |||
184 | foreach (var type in new[] { typeof(WixToolset.Core.Burn.StandardBackend), typeof(WixToolset.Core.WindowsInstaller.StandardBackend) }) | ||
185 | { | ||
186 | extensionManager.Add(type.Assembly); | ||
187 | } | ||
188 | |||
189 | return extensionManager; | ||
190 | } | ||
191 | |||
171 | private void DisplayMessage(object sender, DisplayEventArgs e) | 192 | private void DisplayMessage(object sender, DisplayEventArgs e) |
172 | { | 193 | { |
173 | this.Log.LogMessageFromText(e.Message, MessageImportance.Normal); | 194 | this.Log.LogMessageFromText(e.Message, MessageImportance.Normal); |