diff options
Diffstat (limited to 'src/WixToolset.Core/CommandLine/BuildCommand.cs')
| -rw-r--r-- | src/WixToolset.Core/CommandLine/BuildCommand.cs | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs index 92aa3343..5653afca 100644 --- a/src/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs | |||
| @@ -1,6 +1,6 @@ | |||
| 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. | 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 | 2 | ||
| 3 | namespace WixToolset.Core | 3 | namespace WixToolset.Core.CommandLine |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| @@ -13,7 +13,7 @@ namespace WixToolset.Core | |||
| 13 | 13 | ||
| 14 | internal class BuildCommand : ICommandLineCommand | 14 | internal class BuildCommand : ICommandLineCommand |
| 15 | { | 15 | { |
| 16 | public BuildCommand(IServiceProvider serviceProvider, IMessaging messaging, IExtensionManager extensions, IEnumerable<SourceFile> sources, IDictionary<string, string> preprocessorVariables, IEnumerable<string> locFiles, IEnumerable<string> libraryFiles, string outputPath, OutputType outputType, string cabCachePath, IEnumerable<string> cultures, bool bindFiles, IEnumerable<BindPath> bindPaths, string intermediateFolder, string contentsFile, string outputsFile, string builtOutputsFile, string wixProjectFile) | 16 | public BuildCommand(IServiceProvider serviceProvider, IMessaging messaging, IExtensionManager extensions, IEnumerable<SourceFile> sources, IDictionary<string, string> preprocessorVariables, IEnumerable<string> locFiles, IEnumerable<string> libraryFiles, string outputPath, OutputType outputType, string cabCachePath, IEnumerable<string> cultures, bool bindFiles, IEnumerable<BindPath> bindPaths, string intermediateFolder, string contentsFile, string outputsFile, string builtOutputsFile) |
| 17 | { | 17 | { |
| 18 | this.ServiceProvider = serviceProvider; | 18 | this.ServiceProvider = serviceProvider; |
| 19 | this.Messaging = messaging; | 19 | this.Messaging = messaging; |
| @@ -34,7 +34,6 @@ namespace WixToolset.Core | |||
| 34 | this.ContentsFile = contentsFile; | 34 | this.ContentsFile = contentsFile; |
| 35 | this.OutputsFile = outputsFile; | 35 | this.OutputsFile = outputsFile; |
| 36 | this.BuiltOutputsFile = builtOutputsFile; | 36 | this.BuiltOutputsFile = builtOutputsFile; |
| 37 | this.WixProjectFile = wixProjectFile; | ||
| 38 | } | 37 | } |
| 39 | 38 | ||
| 40 | public IServiceProvider ServiceProvider { get; } | 39 | public IServiceProvider ServiceProvider { get; } |
| @@ -73,8 +72,6 @@ namespace WixToolset.Core | |||
| 73 | 72 | ||
| 74 | public string BuiltOutputsFile { get; } | 73 | public string BuiltOutputsFile { get; } |
| 75 | 74 | ||
| 76 | public string WixProjectFile { get; } | ||
| 77 | |||
| 78 | public int Execute() | 75 | public int Execute() |
| 79 | { | 76 | { |
| 80 | var intermediates = this.CompilePhase(); | 77 | var intermediates = this.CompilePhase(); |
| @@ -207,7 +204,12 @@ namespace WixToolset.Core | |||
| 207 | 204 | ||
| 208 | ResolveResult resolveResult; | 205 | ResolveResult resolveResult; |
| 209 | { | 206 | { |
| 210 | var resolver = new Resolver(this.ServiceProvider, this.BindPaths, output, this.IntermediateFolder, localizations); | 207 | var resolver = new Resolver(this.ServiceProvider); |
| 208 | resolver.BindPaths = this.BindPaths; | ||
| 209 | resolver.IntermediateFolder = this.IntermediateFolder; | ||
| 210 | resolver.IntermediateRepresentation = output; | ||
| 211 | resolver.Localizations = localizations; | ||
| 212 | |||
| 211 | resolveResult = resolver.Execute(); | 213 | resolveResult = resolver.Execute(); |
| 212 | } | 214 | } |
| 213 | 215 | ||
| @@ -224,28 +226,22 @@ namespace WixToolset.Core | |||
| 224 | intermediateFolder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); | 226 | intermediateFolder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); |
| 225 | } | 227 | } |
| 226 | 228 | ||
| 227 | var context = this.ServiceProvider.GetService<IBindContext>(); | 229 | var binder = new Binder(this.ServiceProvider); |
| 228 | context.Messaging = this.Messaging; | 230 | //binder.CabbingThreadCount = this.CabbingThreadCount; |
| 229 | //context.CabbingThreadCount = this.CabbingThreadCount; | 231 | binder.CabCachePath = this.CabCachePath; |
| 230 | context.CabCachePath = this.CabCachePath; | 232 | binder.Codepage = resolveResult.Codepage; |
| 231 | context.Codepage = resolveResult.Codepage; | 233 | //binder.DefaultCompressionLevel = this.DefaultCompressionLevel; |
| 232 | //context.DefaultCompressionLevel = this.DefaultCompressionLevel; | 234 | binder.DelayedFields = resolveResult.DelayedFields; |
| 233 | context.DelayedFields = resolveResult.DelayedFields; | 235 | binder.ExpectedEmbeddedFiles = resolveResult.ExpectedEmbeddedFiles; |
| 234 | context.ExpectedEmbeddedFiles = resolveResult.ExpectedEmbeddedFiles; | 236 | binder.Ices = Array.Empty<string>(); // TODO: set this correctly |
| 235 | //context.Ices = this.Ices; | 237 | binder.IntermediateFolder = intermediateFolder; |
| 236 | context.IntermediateFolder = intermediateFolder; | 238 | binder.IntermediateRepresentation = resolveResult.IntermediateRepresentation; |
| 237 | context.IntermediateRepresentation = resolveResult.IntermediateRepresentation; | 239 | binder.OutputPath = this.OutputPath; |
| 238 | context.OutputPath = this.OutputPath; | 240 | binder.OutputPdbPath = Path.ChangeExtension(this.OutputPath, ".wixpdb"); |
| 239 | context.OutputPdbPath = Path.ChangeExtension(this.OutputPath, ".wixpdb"); | 241 | binder.SuppressIces = Array.Empty<string>(); // TODO: set this correctly |
| 240 | //context.SuppressIces = this.SuppressIces; | 242 | binder.SuppressValidation = true; // TODO: set this correctly |
| 241 | context.SuppressValidation = true; // TODO: set this correctly | 243 | |
| 242 | context.ContentsFile = this.ContentsFile; | 244 | bindResult = binder.Execute(); |
| 243 | context.OutputsFile = this.OutputsFile; | ||
| 244 | context.BuiltOutputsFile = this.BuiltOutputsFile; | ||
| 245 | context.WixprojectFile = this.WixProjectFile; | ||
| 246 | |||
| 247 | var binder = new Binder(); | ||
| 248 | bindResult = binder.Bind(context); | ||
| 249 | } | 245 | } |
| 250 | 246 | ||
| 251 | if (this.Messaging.EncounteredError) | 247 | if (this.Messaging.EncounteredError) |
| @@ -254,8 +250,14 @@ namespace WixToolset.Core | |||
| 254 | } | 250 | } |
| 255 | 251 | ||
| 256 | { | 252 | { |
| 257 | // TODO: correctly set SuppressAclReset bool at the end. | 253 | var layout = new Layout(this.ServiceProvider); |
| 258 | var layout = new Layout(this.ServiceProvider, bindResult.FileTransfers, bindResult.ContentFilePaths, this.ContentsFile, this.OutputsFile, this.BuiltOutputsFile, false); | 254 | layout.FileTransfers = bindResult.FileTransfers; |
| 255 | layout.ContentFilePaths = bindResult.ContentFilePaths; | ||
| 256 | layout.ContentsFile = this.ContentsFile; | ||
| 257 | layout.OutputsFile = this.OutputsFile; | ||
| 258 | layout.BuiltOutputsFile = this.BuiltOutputsFile; | ||
| 259 | layout.SuppressAclReset = false; // TODO: correctly set SuppressAclReset | ||
| 260 | |||
| 259 | layout.Execute(); | 261 | layout.Execute(); |
| 260 | } | 262 | } |
| 261 | } | 263 | } |
