main
cs 39 lines 1.14 KB
Raw
1 // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3 namespace WixToolset.Core
4 {
5 using System;
6 using WixToolset.Extensibility.Data;
7 using WixToolset.Extensibility.Services;
8
9 internal class Optimizer : IOptimizer
10 {
11 internal Optimizer(IServiceProvider serviceProvider)
12 {
13 this.ServiceProvider = serviceProvider;
14 this.Messaging = this.ServiceProvider.GetService<IMessaging>();
15 }
16
17 private IServiceProvider ServiceProvider { get; }
18
19 private IMessaging Messaging { get; }
20
21 public void Optimize(IOptimizeContext context)
22 {
23 foreach (var extension in context.Extensions)
24 {
25 extension.PreOptimize(context);
26 }
27
28 {
29 var command = new HarvestFilesCommand(context);
30 command.Execute();
31 }
32
33 foreach (var extension in context.Extensions)
34 {
35 extension.PostOptimize(context);
36 }
37 }
38 }
39 }