diff options
Diffstat (limited to 'src/WixToolset.Core/Binder.cs')
| -rw-r--r-- | src/WixToolset.Core/Binder.cs | 57 |
1 files changed, 6 insertions, 51 deletions
diff --git a/src/WixToolset.Core/Binder.cs b/src/WixToolset.Core/Binder.cs index bbc4173b..87b5d2b3 100644 --- a/src/WixToolset.Core/Binder.cs +++ b/src/WixToolset.Core/Binder.cs | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | namespace WixToolset.Core | 3 | namespace WixToolset.Core |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections.Generic; | ||
| 7 | using System.Diagnostics; | 6 | using System.Diagnostics; |
| 8 | using System.Linq; | 7 | using System.Linq; |
| 9 | using System.Reflection; | 8 | using System.Reflection; |
| @@ -16,61 +15,17 @@ namespace WixToolset.Core | |||
| 16 | /// <summary> | 15 | /// <summary> |
| 17 | /// Binder of the WiX toolset. | 16 | /// Binder of the WiX toolset. |
| 18 | /// </summary> | 17 | /// </summary> |
| 19 | internal class Binder | 18 | internal class Binder : IBinder |
| 20 | { | 19 | { |
| 21 | internal Binder(IServiceProvider serviceProvider) | 20 | internal Binder(IServiceProvider serviceProvider) |
| 22 | { | 21 | { |
| 23 | this.ServiceProvider = serviceProvider; | 22 | this.ServiceProvider = serviceProvider; |
| 24 | } | 23 | } |
| 25 | 24 | ||
| 26 | public int CabbingThreadCount { get; set; } | ||
| 27 | |||
| 28 | public string CabCachePath { get; set; } | ||
| 29 | |||
| 30 | public int Codepage { get; set; } | ||
| 31 | |||
| 32 | public CompressionLevel? DefaultCompressionLevel { get; set; } | ||
| 33 | |||
| 34 | public IEnumerable<IDelayedField> DelayedFields { get; set; } | ||
| 35 | |||
| 36 | public IEnumerable<IExpectedExtractFile> ExpectedEmbeddedFiles { get; set; } | ||
| 37 | |||
| 38 | public IEnumerable<string> Ices { get; set; } | ||
| 39 | |||
| 40 | public string IntermediateFolder { get; set; } | ||
| 41 | |||
| 42 | public Intermediate IntermediateRepresentation { get; set; } | ||
| 43 | |||
| 44 | public string OutputPath { get; set; } | ||
| 45 | |||
| 46 | public string OutputPdbPath { get; set; } | ||
| 47 | |||
| 48 | public IEnumerable<string> SuppressIces { get; set; } | ||
| 49 | |||
| 50 | public bool SuppressValidation { get; set; } | ||
| 51 | |||
| 52 | public bool DeltaBinaryPatch { get; set; } | ||
| 53 | |||
| 54 | public IServiceProvider ServiceProvider { get; } | 25 | public IServiceProvider ServiceProvider { get; } |
| 55 | 26 | ||
| 56 | public BindResult Execute() | 27 | public BindResult Bind(IBindContext context) |
| 57 | { | 28 | { |
| 58 | var context = this.ServiceProvider.GetService<IBindContext>(); | ||
| 59 | context.CabbingThreadCount = this.CabbingThreadCount; | ||
| 60 | context.CabCachePath = this.CabCachePath; | ||
| 61 | context.Codepage = this.Codepage; | ||
| 62 | context.DefaultCompressionLevel = this.DefaultCompressionLevel; | ||
| 63 | context.DelayedFields = this.DelayedFields; | ||
| 64 | context.ExpectedEmbeddedFiles = this.ExpectedEmbeddedFiles; | ||
| 65 | context.Extensions = this.ServiceProvider.GetService<IExtensionManager>().Create<IBinderExtension>(); | ||
| 66 | context.Ices = this.Ices; | ||
| 67 | context.IntermediateFolder = this.IntermediateFolder; | ||
| 68 | context.IntermediateRepresentation = this.IntermediateRepresentation; | ||
| 69 | context.OutputPath = this.OutputPath; | ||
| 70 | context.OutputPdbPath = this.OutputPdbPath; | ||
| 71 | context.SuppressIces = this.SuppressIces; | ||
| 72 | context.SuppressValidation = this.SuppressValidation; | ||
| 73 | |||
| 74 | // Prebind. | 29 | // Prebind. |
| 75 | // | 30 | // |
| 76 | foreach (var extension in context.Extensions) | 31 | foreach (var extension in context.Extensions) |
| @@ -80,7 +35,7 @@ namespace WixToolset.Core | |||
| 80 | 35 | ||
| 81 | // Bind. | 36 | // Bind. |
| 82 | // | 37 | // |
| 83 | this.WriteBuildInfoTable(context.IntermediateRepresentation, context.OutputPath, context.OutputPdbPath); | 38 | this.WriteBuildInfoTuple(context.IntermediateRepresentation, context.OutputPath, context.OutputPdbPath); |
| 84 | 39 | ||
| 85 | var bindResult = this.BackendBind(context); | 40 | var bindResult = this.BackendBind(context); |
| 86 | 41 | ||
| @@ -107,7 +62,7 @@ namespace WixToolset.Core | |||
| 107 | 62 | ||
| 108 | foreach (var factory in backendFactories) | 63 | foreach (var factory in backendFactories) |
| 109 | { | 64 | { |
| 110 | if (factory.TryCreateBackend(entrySection.Type.ToString(), context.OutputPath, null, out var backend)) | 65 | if (factory.TryCreateBackend(entrySection.Type.ToString(), context.OutputPath, out var backend)) |
| 111 | { | 66 | { |
| 112 | var result = backend.Bind(context); | 67 | var result = backend.Bind(context); |
| 113 | return result; | 68 | return result; |
| @@ -118,8 +73,8 @@ namespace WixToolset.Core | |||
| 118 | 73 | ||
| 119 | return null; | 74 | return null; |
| 120 | } | 75 | } |
| 121 | 76 | ||
| 122 | private void WriteBuildInfoTable(Intermediate output, string outputFile, string outputPdbPath) | 77 | private void WriteBuildInfoTuple(Intermediate output, string outputFile, string outputPdbPath) |
| 123 | { | 78 | { |
| 124 | var entrySection = output.Sections.First(s => s.Type != SectionType.Fragment); | 79 | var entrySection = output.Sections.First(s => s.Type != SectionType.Fragment); |
| 125 | 80 | ||
