From ecf3a0cca5a424a91ab98557d963d2535963d582 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 22 Dec 2017 15:53:01 -0800 Subject: Reintroduce binder extensions and light.exe for binding .wixouts --- src/WixToolset.Core/CommandLine/BuildCommand.cs | 62 +++++++++++++------------ 1 file changed, 32 insertions(+), 30 deletions(-) (limited to 'src/WixToolset.Core/CommandLine/BuildCommand.cs') 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 @@ // 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. -namespace WixToolset.Core +namespace WixToolset.Core.CommandLine { using System; using System.Collections.Generic; @@ -13,7 +13,7 @@ namespace WixToolset.Core internal class BuildCommand : ICommandLineCommand { - public BuildCommand(IServiceProvider serviceProvider, IMessaging messaging, IExtensionManager extensions, IEnumerable sources, IDictionary preprocessorVariables, IEnumerable locFiles, IEnumerable libraryFiles, string outputPath, OutputType outputType, string cabCachePath, IEnumerable cultures, bool bindFiles, IEnumerable bindPaths, string intermediateFolder, string contentsFile, string outputsFile, string builtOutputsFile, string wixProjectFile) + public BuildCommand(IServiceProvider serviceProvider, IMessaging messaging, IExtensionManager extensions, IEnumerable sources, IDictionary preprocessorVariables, IEnumerable locFiles, IEnumerable libraryFiles, string outputPath, OutputType outputType, string cabCachePath, IEnumerable cultures, bool bindFiles, IEnumerable bindPaths, string intermediateFolder, string contentsFile, string outputsFile, string builtOutputsFile) { this.ServiceProvider = serviceProvider; this.Messaging = messaging; @@ -34,7 +34,6 @@ namespace WixToolset.Core this.ContentsFile = contentsFile; this.OutputsFile = outputsFile; this.BuiltOutputsFile = builtOutputsFile; - this.WixProjectFile = wixProjectFile; } public IServiceProvider ServiceProvider { get; } @@ -73,8 +72,6 @@ namespace WixToolset.Core public string BuiltOutputsFile { get; } - public string WixProjectFile { get; } - public int Execute() { var intermediates = this.CompilePhase(); @@ -207,7 +204,12 @@ namespace WixToolset.Core ResolveResult resolveResult; { - var resolver = new Resolver(this.ServiceProvider, this.BindPaths, output, this.IntermediateFolder, localizations); + var resolver = new Resolver(this.ServiceProvider); + resolver.BindPaths = this.BindPaths; + resolver.IntermediateFolder = this.IntermediateFolder; + resolver.IntermediateRepresentation = output; + resolver.Localizations = localizations; + resolveResult = resolver.Execute(); } @@ -224,28 +226,22 @@ namespace WixToolset.Core intermediateFolder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); } - var context = this.ServiceProvider.GetService(); - context.Messaging = this.Messaging; - //context.CabbingThreadCount = this.CabbingThreadCount; - context.CabCachePath = this.CabCachePath; - context.Codepage = resolveResult.Codepage; - //context.DefaultCompressionLevel = this.DefaultCompressionLevel; - context.DelayedFields = resolveResult.DelayedFields; - context.ExpectedEmbeddedFiles = resolveResult.ExpectedEmbeddedFiles; - //context.Ices = this.Ices; - context.IntermediateFolder = intermediateFolder; - context.IntermediateRepresentation = resolveResult.IntermediateRepresentation; - context.OutputPath = this.OutputPath; - context.OutputPdbPath = Path.ChangeExtension(this.OutputPath, ".wixpdb"); - //context.SuppressIces = this.SuppressIces; - context.SuppressValidation = true; // TODO: set this correctly - context.ContentsFile = this.ContentsFile; - context.OutputsFile = this.OutputsFile; - context.BuiltOutputsFile = this.BuiltOutputsFile; - context.WixprojectFile = this.WixProjectFile; - - var binder = new Binder(); - bindResult = binder.Bind(context); + var binder = new Binder(this.ServiceProvider); + //binder.CabbingThreadCount = this.CabbingThreadCount; + binder.CabCachePath = this.CabCachePath; + binder.Codepage = resolveResult.Codepage; + //binder.DefaultCompressionLevel = this.DefaultCompressionLevel; + binder.DelayedFields = resolveResult.DelayedFields; + binder.ExpectedEmbeddedFiles = resolveResult.ExpectedEmbeddedFiles; + binder.Ices = Array.Empty(); // TODO: set this correctly + binder.IntermediateFolder = intermediateFolder; + binder.IntermediateRepresentation = resolveResult.IntermediateRepresentation; + binder.OutputPath = this.OutputPath; + binder.OutputPdbPath = Path.ChangeExtension(this.OutputPath, ".wixpdb"); + binder.SuppressIces = Array.Empty(); // TODO: set this correctly + binder.SuppressValidation = true; // TODO: set this correctly + + bindResult = binder.Execute(); } if (this.Messaging.EncounteredError) @@ -254,8 +250,14 @@ namespace WixToolset.Core } { - // TODO: correctly set SuppressAclReset bool at the end. - var layout = new Layout(this.ServiceProvider, bindResult.FileTransfers, bindResult.ContentFilePaths, this.ContentsFile, this.OutputsFile, this.BuiltOutputsFile, false); + var layout = new Layout(this.ServiceProvider); + layout.FileTransfers = bindResult.FileTransfers; + layout.ContentFilePaths = bindResult.ContentFilePaths; + layout.ContentsFile = this.ContentsFile; + layout.OutputsFile = this.OutputsFile; + layout.BuiltOutputsFile = this.BuiltOutputsFile; + layout.SuppressAclReset = false; // TODO: correctly set SuppressAclReset + layout.Execute(); } } -- cgit v1.2.3-55-g6feb