diff options
Diffstat (limited to '')
-rw-r--r-- | src/WixToolset.Core/Librarian.cs | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/WixToolset.Core/Librarian.cs b/src/WixToolset.Core/Librarian.cs index 2efb0f9b..3e843070 100644 --- a/src/WixToolset.Core/Librarian.cs +++ b/src/WixToolset.Core/Librarian.cs | |||
@@ -9,27 +9,45 @@ namespace WixToolset.Core | |||
9 | using WixToolset.Core.Link; | 9 | using WixToolset.Core.Link; |
10 | using WixToolset.Data; | 10 | using WixToolset.Data; |
11 | using WixToolset.Extensibility; | 11 | using WixToolset.Extensibility; |
12 | using WixToolset.Extensibility.Services; | ||
12 | 13 | ||
13 | /// <summary> | 14 | /// <summary> |
14 | /// Core librarian tool. | 15 | /// Core librarian tool. |
15 | /// </summary> | 16 | /// </summary> |
16 | public sealed class Librarian | 17 | public sealed class Librarian |
17 | { | 18 | { |
19 | public Librarian(IServiceProvider serviceProvider) | ||
20 | { | ||
21 | this.ServiceProvider = serviceProvider; | ||
22 | } | ||
23 | |||
24 | private IServiceProvider ServiceProvider { get; } | ||
25 | |||
18 | private ILibraryContext Context { get; set; } | 26 | private ILibraryContext Context { get; set; } |
19 | 27 | ||
28 | public bool BindFiles { get; set; } | ||
29 | |||
30 | public IEnumerable<BindPath> BindPaths { get; set; } | ||
31 | |||
32 | public IEnumerable<Localization> Localizations { get; set; } | ||
33 | |||
34 | public IEnumerable<Intermediate> Intermediates { get; set; } | ||
35 | |||
20 | /// <summary> | 36 | /// <summary> |
21 | /// Create a library by combining several intermediates (objects). | 37 | /// Create a library by combining several intermediates (objects). |
22 | /// </summary> | 38 | /// </summary> |
23 | /// <param name="sections">The sections to combine into a library.</param> | 39 | /// <param name="sections">The sections to combine into a library.</param> |
24 | /// <returns>Returns the new library.</returns> | 40 | /// <returns>Returns the new library.</returns> |
25 | public Intermediate Combine(ILibraryContext context) | 41 | public Intermediate Execute() |
26 | { | 42 | { |
27 | this.Context = context ?? throw new ArgumentNullException(nameof(context)); | 43 | this.Context = new LibraryContext(this.ServiceProvider); |
28 | 44 | this.Context.Messaging = this.ServiceProvider.GetService<IMessaging>(); | |
29 | if (String.IsNullOrEmpty(this.Context.LibraryId)) | 45 | this.Context.BindFiles = this.BindFiles; |
30 | { | 46 | this.Context.BindPaths = this.BindPaths; |
31 | this.Context.LibraryId = Convert.ToBase64String(Guid.NewGuid().ToByteArray()).TrimEnd('=').Replace('+', '.').Replace('/', '_'); | 47 | this.Context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<ILibrarianExtension>(); |
32 | } | 48 | this.Context.Localizations = this.Localizations; |
49 | this.Context.LibraryId = Convert.ToBase64String(Guid.NewGuid().ToByteArray()).TrimEnd('=').Replace('+', '.').Replace('/', '_'); | ||
50 | this.Context.Intermediates = this.Intermediates; | ||
33 | 51 | ||
34 | foreach (var extension in this.Context.Extensions) | 52 | foreach (var extension in this.Context.Extensions) |
35 | { | 53 | { |