From 4d5289fa6254ca80a23807c41ca8502f8f38f048 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 4 Oct 2017 14:52:39 -0700 Subject: Pass extensions' data into the linker --- src/WixToolset.Core/CommandLine/BuildCommand.cs | 10 +++++++++- src/WixToolset.Core/CommandLine/CommandLine.cs | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs index d8954cb7..c6ea27cc 100644 --- a/src/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs @@ -11,8 +11,9 @@ namespace WixToolset.Core internal class BuildCommand : ICommand { - public BuildCommand(IEnumerable sources, IDictionary preprocessorVariables, IEnumerable locFiles, IEnumerable libraryFiles, string outputPath, OutputType outputType, IEnumerable cultures, bool bindFiles, IEnumerable bindPaths, string intermediateFolder, string contentsFile, string outputsFile, string builtOutputsFile, string wixProjectFile) + public BuildCommand(ExtensionManager extensions, IEnumerable sources, IDictionary preprocessorVariables, IEnumerable locFiles, IEnumerable libraryFiles, string outputPath, OutputType outputType, IEnumerable cultures, bool bindFiles, IEnumerable bindPaths, string intermediateFolder, string contentsFile, string outputsFile, string builtOutputsFile, string wixProjectFile) { + this.Extensions = extensions; this.LocFiles = locFiles; this.LibraryFiles = libraryFiles; this.PreprocessorVariables = preprocessorVariables; @@ -31,6 +32,8 @@ namespace WixToolset.Core this.WixProjectFile = wixProjectFile; } + public ExtensionManager Extensions { get; } + public IEnumerable LocFiles { get; } public IEnumerable LibraryFiles { get; } @@ -146,6 +149,11 @@ namespace WixToolset.Core var linker = new Linker(); + foreach (var data in this.Extensions.Create()) + { + linker.AddExtensionData(data); + } + var output = linker.Link(sections, this.OutputType); return output; diff --git a/src/WixToolset.Core/CommandLine/CommandLine.cs b/src/WixToolset.Core/CommandLine/CommandLine.cs index cac54091..c95a2db4 100644 --- a/src/WixToolset.Core/CommandLine/CommandLine.cs +++ b/src/WixToolset.Core/CommandLine/CommandLine.cs @@ -195,7 +195,7 @@ namespace WixToolset.Core var bindPathList = GatherBindPaths(bindPaths); var extensions = cli.ExtensionManager; var type = CalculateOutputType(outputType, outputFile); - return new BuildCommand(sourceFiles, variables, locFiles, libraryFiles, outputFile, type, cultures, bindFiles, bindPathList, intermediateFolder, contentsFile, outputsFile, builtOutputsFile, wixProjectFile); + return new BuildCommand(extensions, sourceFiles, variables, locFiles, libraryFiles, outputFile, type, cultures, bindFiles, bindPathList, intermediateFolder, contentsFile, outputsFile, builtOutputsFile, wixProjectFile); } case Commands.Compile: -- cgit v1.2.3-55-g6feb