diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.BuildTasks/HeatTask.cs | 9 | ||||
| -rw-r--r-- | src/WixToolset.BuildTasks/ToolsetTask.cs | 76 | ||||
| -rw-r--r-- | src/WixToolset.BuildTasks/WixBuild.cs | 10 | ||||
| -rw-r--r-- | src/WixToolset.MSBuild/tools/wix.harvest.targets | 19 | ||||
| -rw-r--r-- | src/WixToolset.MSBuild/tools/wix.targets | 11 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 25 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 8 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs | 7 |
8 files changed, 119 insertions, 46 deletions
diff --git a/src/WixToolset.BuildTasks/HeatTask.cs b/src/WixToolset.BuildTasks/HeatTask.cs index 586f02f7..5feed26d 100644 --- a/src/WixToolset.BuildTasks/HeatTask.cs +++ b/src/WixToolset.BuildTasks/HeatTask.cs | |||
| @@ -59,7 +59,8 @@ namespace WixToolset.BuildTasks | |||
| 59 | set { this.transforms = value; } | 59 | set { this.transforms = value; } |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | protected override string TaskShortName => "HEAT"; | 62 | protected sealed override string TaskShortName => "HEAT"; |
| 63 | protected sealed override string ToolName => "heat.exe"; | ||
| 63 | 64 | ||
| 64 | /// <summary> | 65 | /// <summary> |
| 65 | /// Gets the name of the heat operation performed by the task. | 66 | /// Gets the name of the heat operation performed by the task. |
| @@ -71,10 +72,8 @@ namespace WixToolset.BuildTasks | |||
| 71 | get; | 72 | get; |
| 72 | } | 73 | } |
| 73 | 74 | ||
| 74 | protected override void ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) | 75 | protected sealed override int ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) |
| 75 | { | 76 | { |
| 76 | this.Log.LogMessage(MessageImportance.Normal, "heat.exe " + commandLineString); | ||
| 77 | |||
| 78 | var messaging = serviceProvider.GetService<IMessaging>(); | 77 | var messaging = serviceProvider.GetService<IMessaging>(); |
| 79 | messaging.SetListener(listener); | 78 | messaging.SetListener(listener); |
| 80 | 79 | ||
| @@ -83,7 +82,7 @@ namespace WixToolset.BuildTasks | |||
| 83 | 82 | ||
| 84 | var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider, true); | 83 | var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider, true); |
| 85 | var command = commandLine.ParseStandardCommandLine(arguments); | 84 | var command = commandLine.ParseStandardCommandLine(arguments); |
| 86 | command?.Execute(); | 85 | return command?.Execute() ?? -1; |
| 87 | } | 86 | } |
| 88 | 87 | ||
| 89 | /// <summary> | 88 | /// <summary> |
diff --git a/src/WixToolset.BuildTasks/ToolsetTask.cs b/src/WixToolset.BuildTasks/ToolsetTask.cs index 713a938b..fe6812fc 100644 --- a/src/WixToolset.BuildTasks/ToolsetTask.cs +++ b/src/WixToolset.BuildTasks/ToolsetTask.cs | |||
| @@ -3,14 +3,16 @@ | |||
| 3 | namespace WixToolset.BuildTasks | 3 | namespace WixToolset.BuildTasks |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.IO; | ||
| 6 | using System.Runtime.InteropServices; | 7 | using System.Runtime.InteropServices; |
| 8 | using Microsoft.Build.Framework; | ||
| 7 | using Microsoft.Build.Utilities; | 9 | using Microsoft.Build.Utilities; |
| 8 | using WixToolset.Core; | 10 | using WixToolset.Core; |
| 9 | using WixToolset.Data; | 11 | using WixToolset.Data; |
| 10 | using WixToolset.Extensibility; | 12 | using WixToolset.Extensibility; |
| 11 | using WixToolset.Extensibility.Services; | 13 | using WixToolset.Extensibility.Services; |
| 12 | 14 | ||
| 13 | public abstract class ToolsetTask : Task | 15 | public abstract class ToolsetTask : ToolTask |
| 14 | { | 16 | { |
| 15 | /// <summary> | 17 | /// <summary> |
| 16 | /// Gets or sets additional options that are appended the the tool command-line. | 18 | /// Gets or sets additional options that are appended the the tool command-line. |
| @@ -27,6 +29,12 @@ namespace WixToolset.BuildTasks | |||
| 27 | public bool NoLogo { get; set; } | 29 | public bool NoLogo { get; set; } |
| 28 | 30 | ||
| 29 | /// <summary> | 31 | /// <summary> |
| 32 | /// Gets or sets a flag indicating whether the task | ||
| 33 | /// should be run as separate process or in-proc. | ||
| 34 | /// </summary> | ||
| 35 | public bool RunAsSeparateProcess { get; set; } | ||
| 36 | |||
| 37 | /// <summary> | ||
| 30 | /// Gets or sets whether all warnings should be suppressed. | 38 | /// Gets or sets whether all warnings should be suppressed. |
| 31 | /// </summary> | 39 | /// </summary> |
| 32 | public bool SuppressAllWarnings { get; set; } | 40 | public bool SuppressAllWarnings { get; set; } |
| @@ -51,19 +59,27 @@ namespace WixToolset.BuildTasks | |||
| 51 | /// </summary> | 59 | /// </summary> |
| 52 | public bool VerboseOutput { get; set; } | 60 | public bool VerboseOutput { get; set; } |
| 53 | 61 | ||
| 54 | public override bool Execute() | 62 | protected sealed override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands) |
| 55 | { | 63 | { |
| 56 | var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); | 64 | if (this.RunAsSeparateProcess) |
| 65 | { | ||
| 66 | return base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands); | ||
| 67 | } | ||
| 68 | |||
| 69 | return this.ExecuteInProc($"{commandLineCommands} {responseFileCommands}"); | ||
| 70 | } | ||
| 57 | 71 | ||
| 72 | private int ExecuteInProc(string commandLineString) | ||
| 73 | { | ||
| 74 | this.Log.LogMessage(MessageImportance.Normal, $"({this.ToolName}){commandLineString}"); | ||
| 75 | |||
| 76 | var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); | ||
| 58 | var listener = new MsbuildMessageListener(this.Log, this.TaskShortName, this.BuildEngine.ProjectFileOfTaskNode); | 77 | var listener = new MsbuildMessageListener(this.Log, this.TaskShortName, this.BuildEngine.ProjectFileOfTaskNode); |
| 78 | int exitCode = -1; | ||
| 59 | 79 | ||
| 60 | try | 80 | try |
| 61 | { | 81 | { |
| 62 | var commandLineBuilder = new WixCommandLineBuilder(); | 82 | exitCode = this.ExecuteCore(serviceProvider, listener, commandLineString); |
| 63 | this.BuildCommandLine(commandLineBuilder); | ||
| 64 | |||
| 65 | var commandLineString = commandLineBuilder.ToString(); | ||
| 66 | this.ExecuteCore(serviceProvider, listener, commandLineString); | ||
| 67 | } | 83 | } |
| 68 | catch (WixException e) | 84 | catch (WixException e) |
| 69 | { | 85 | { |
| @@ -79,7 +95,47 @@ namespace WixToolset.BuildTasks | |||
| 79 | } | 95 | } |
| 80 | } | 96 | } |
| 81 | 97 | ||
| 82 | return !this.Log.HasLoggedErrors; | 98 | if (exitCode == 0 && this.Log.HasLoggedErrors) |
| 99 | { | ||
| 100 | exitCode = -1; | ||
| 101 | } | ||
| 102 | return exitCode; | ||
| 103 | } | ||
| 104 | |||
| 105 | /// <summary> | ||
| 106 | /// Get the path to the executable. | ||
| 107 | /// </summary> | ||
| 108 | /// <remarks> | ||
| 109 | /// ToolTask only calls GenerateFullPathToTool when the ToolPath property is not set. | ||
| 110 | /// WiX never sets the ToolPath property, but the user can through $(WixToolDir). | ||
| 111 | /// If we return only a file name, ToolTask will search the system paths for it. | ||
| 112 | /// </remarks> | ||
| 113 | protected sealed override string GenerateFullPathToTool() | ||
| 114 | { | ||
| 115 | var thisDllPath = new Uri(typeof(ToolsetTask).Assembly.CodeBase).AbsolutePath; | ||
| 116 | if (this.RunAsSeparateProcess) | ||
| 117 | { | ||
| 118 | return Path.Combine(Path.GetDirectoryName(thisDllPath), this.ToolExe); | ||
| 119 | } | ||
| 120 | |||
| 121 | // We need to return a path that exists, so if we're not actually going to run the tool then just return this dll path. | ||
| 122 | return thisDllPath; | ||
| 123 | } | ||
| 124 | |||
| 125 | protected sealed override string GenerateResponseFileCommands() | ||
| 126 | { | ||
| 127 | var commandLineBuilder = new WixCommandLineBuilder(); | ||
| 128 | this.BuildCommandLine(commandLineBuilder); | ||
| 129 | return commandLineBuilder.ToString(); | ||
| 130 | } | ||
| 131 | |||
| 132 | protected sealed override void LogToolCommand(string message) | ||
| 133 | { | ||
| 134 | // Only log this if we're actually going to do it. | ||
| 135 | if (this.RunAsSeparateProcess) | ||
| 136 | { | ||
| 137 | base.LogToolCommand(message); | ||
| 138 | } | ||
| 83 | } | 139 | } |
| 84 | 140 | ||
| 85 | /// <summary> | 141 | /// <summary> |
| @@ -98,7 +154,7 @@ namespace WixToolset.BuildTasks | |||
| 98 | commandLineBuilder.AppendIfTrue("-wx", this.TreatWarningsAsErrors); | 154 | commandLineBuilder.AppendIfTrue("-wx", this.TreatWarningsAsErrors); |
| 99 | } | 155 | } |
| 100 | 156 | ||
| 101 | protected abstract void ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener messageListener, string commandLineString); | 157 | protected abstract int ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener messageListener, string commandLineString); |
| 102 | 158 | ||
| 103 | protected abstract string TaskShortName { get; } | 159 | protected abstract string TaskShortName { get; } |
| 104 | } | 160 | } |
diff --git a/src/WixToolset.BuildTasks/WixBuild.cs b/src/WixToolset.BuildTasks/WixBuild.cs index b8fb4136..c15bc2f7 100644 --- a/src/WixToolset.BuildTasks/WixBuild.cs +++ b/src/WixToolset.BuildTasks/WixBuild.cs | |||
| @@ -4,10 +4,7 @@ namespace WixToolset.BuildTasks | |||
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| 7 | using System.Runtime.InteropServices; | ||
| 8 | using Microsoft.Build.Framework; | 7 | using Microsoft.Build.Framework; |
| 9 | using Microsoft.Build.Utilities; | ||
| 10 | using WixToolset.Core; | ||
| 11 | using WixToolset.Data; | 8 | using WixToolset.Data; |
| 12 | using WixToolset.Extensibility; | 9 | using WixToolset.Extensibility; |
| 13 | using WixToolset.Extensibility.Data; | 10 | using WixToolset.Extensibility.Data; |
| @@ -80,11 +77,10 @@ namespace WixToolset.BuildTasks | |||
| 80 | public string AdditionalCub { get; set; } | 77 | public string AdditionalCub { get; set; } |
| 81 | 78 | ||
| 82 | protected override string TaskShortName => "WIX"; | 79 | protected override string TaskShortName => "WIX"; |
| 80 | protected override string ToolName => "wix.exe"; | ||
| 83 | 81 | ||
| 84 | protected override void ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) | 82 | protected override int ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) |
| 85 | { | 83 | { |
| 86 | this.Log.LogMessage(MessageImportance.Normal, "wix.exe " + commandLineString); | ||
| 87 | |||
| 88 | var messaging = serviceProvider.GetService<IMessaging>(); | 84 | var messaging = serviceProvider.GetService<IMessaging>(); |
| 89 | messaging.SetListener(listener); | 85 | messaging.SetListener(listener); |
| 90 | 86 | ||
| @@ -95,7 +91,7 @@ namespace WixToolset.BuildTasks | |||
| 95 | commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); | 91 | commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); |
| 96 | commandLine.Arguments = arguments; | 92 | commandLine.Arguments = arguments; |
| 97 | var command = commandLine.ParseStandardCommandLine(); | 93 | var command = commandLine.ParseStandardCommandLine(); |
| 98 | command?.Execute(); | 94 | return command?.Execute() ?? -1; |
| 99 | } | 95 | } |
| 100 | 96 | ||
| 101 | protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) | 97 | protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) |
diff --git a/src/WixToolset.MSBuild/tools/wix.harvest.targets b/src/WixToolset.MSBuild/tools/wix.harvest.targets index e4d866ea..dea44469 100644 --- a/src/WixToolset.MSBuild/tools/wix.harvest.targets +++ b/src/WixToolset.MSBuild/tools/wix.harvest.targets | |||
| @@ -3,6 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 5 | <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 6 | <!-- These properties can be overridden to support non-default installations. --> | ||
| 7 | <PropertyGroup> | ||
| 8 | <HeatToolDir Condition=" '$(HeatToolDir)' == '' ">$(WixToolDir)</HeatToolDir> | ||
| 9 | </PropertyGroup> | ||
| 6 | 10 | ||
| 7 | <!-- These tasks are extensions for harvesting WiX source code from other sources. --> | 11 | <!-- These tasks are extensions for harvesting WiX source code from other sources. --> |
| 8 | <UsingTask TaskName="HeatFile" AssemblyFile="$(WixTasksPath)" /> | 12 | <UsingTask TaskName="HeatFile" AssemblyFile="$(WixTasksPath)" /> |
| @@ -274,7 +278,10 @@ | |||
| 274 | Configuration="%(_AllHeatProjects.Configuration)" | 278 | Configuration="%(_AllHeatProjects.Configuration)" |
| 275 | Platform="%(_AllHeatProjects.Platform)" | 279 | Platform="%(_AllHeatProjects.Platform)" |
| 276 | GenerateWixVariables="$(HarvestProjectsGenerateWixVariables)" | 280 | GenerateWixVariables="$(HarvestProjectsGenerateWixVariables)" |
| 277 | AdditionalOptions="$(HarvestProjectsAdditionalOptions)"> | 281 | AdditionalOptions="$(HarvestProjectsAdditionalOptions)" |
| 282 | RunAsSeparateProcess="$(RunWixToolsOutOfProc)" | ||
| 283 | ToolExe="$(HeatToolExe)" | ||
| 284 | ToolPath="$(HeatToolDir)"> | ||
| 278 | 285 | ||
| 279 | <Output TaskParameter="OutputFile" ItemName="Compile" /> | 286 | <Output TaskParameter="OutputFile" ItemName="Compile" /> |
| 280 | <Output TaskParameter="OutputFile" ItemName="FileWrites" /> | 287 | <Output TaskParameter="OutputFile" ItemName="FileWrites" /> |
| @@ -359,7 +366,10 @@ | |||
| 359 | SuppressCom="%(HarvestDirectory.SuppressCom)" | 366 | SuppressCom="%(HarvestDirectory.SuppressCom)" |
| 360 | SuppressRootDirectory="%(HarvestDirectory.SuppressRootDirectory)" | 367 | SuppressRootDirectory="%(HarvestDirectory.SuppressRootDirectory)" |
| 361 | SuppressRegistry="%(HarvestDirectory.SuppressRegistry)" | 368 | SuppressRegistry="%(HarvestDirectory.SuppressRegistry)" |
| 362 | AdditionalOptions="$(HarvestDirectoryAdditionalOptions)"> | 369 | AdditionalOptions="$(HarvestDirectoryAdditionalOptions)" |
| 370 | RunAsSeparateProcess="$(RunWixToolsOutOfProc)" | ||
| 371 | ToolExe="$(HeatToolExe)" | ||
| 372 | ToolPath="$(HeatToolDir)"> | ||
| 363 | 373 | ||
| 364 | <Output TaskParameter="OutputFile" ItemName="Compile" /> | 374 | <Output TaskParameter="OutputFile" ItemName="Compile" /> |
| 365 | <Output TaskParameter="OutputFile" ItemName="FileWrites" /> | 375 | <Output TaskParameter="OutputFile" ItemName="FileWrites" /> |
| @@ -432,7 +442,10 @@ | |||
| 432 | SuppressCom="%(HarvestFile.SuppressCom)" | 442 | SuppressCom="%(HarvestFile.SuppressCom)" |
| 433 | SuppressRegistry="%(HarvestFile.SuppressRegistry)" | 443 | SuppressRegistry="%(HarvestFile.SuppressRegistry)" |
| 434 | SuppressRootDirectory="%(HarvestFile.SuppressRootDirectory)" | 444 | SuppressRootDirectory="%(HarvestFile.SuppressRootDirectory)" |
| 435 | AdditionalOptions="$(HarvestFileAdditionalOptions)"> | 445 | AdditionalOptions="$(HarvestFileAdditionalOptions)" |
| 446 | RunAsSeparateProcess="$(RunWixToolsOutOfProc)" | ||
| 447 | ToolExe="$(HeatToolExe)" | ||
| 448 | ToolPath="$(HeatToolDir)"> | ||
| 436 | 449 | ||
| 437 | <Output TaskParameter="OutputFile" ItemName="Compile" /> | 450 | <Output TaskParameter="OutputFile" ItemName="Compile" /> |
| 438 | <Output TaskParameter="OutputFile" ItemName="FileWrites" /> | 451 | <Output TaskParameter="OutputFile" ItemName="FileWrites" /> |
diff --git a/src/WixToolset.MSBuild/tools/wix.targets b/src/WixToolset.MSBuild/tools/wix.targets index 62414017..6914d03e 100644 --- a/src/WixToolset.MSBuild/tools/wix.targets +++ b/src/WixToolset.MSBuild/tools/wix.targets | |||
| @@ -249,11 +249,6 @@ | |||
| 249 | 249 | ||
| 250 | <Error | 250 | <Error |
| 251 | Code="WIX102" | 251 | Code="WIX102" |
| 252 | Condition=" '$(MSBuildToolsVersion)' == '' OR '$(MSBuildToolsVersion)' < '4.0' " | ||
| 253 | Text="MSBuild v$(MSBuildToolsVersion) is not supported by the project "$(MSBuildProjectFile)". You must use MSBuild v4.0 or later." /> | ||
| 254 | |||
| 255 | <Error | ||
| 256 | Code="WIX103" | ||
| 257 | Condition=" '$(WixPdbType)' != 'none' and '$(WixPdbType)' != 'full' " | 252 | Condition=" '$(WixPdbType)' != 'none' and '$(WixPdbType)' != 'full' " |
| 258 | Text="The WixPdbType property '$(WixPdbType)' is not valid in project "$(MSBuildProjectFile)". Supported values are: 'full', 'none'" /> | 253 | Text="The WixPdbType property '$(WixPdbType)' is not valid in project "$(MSBuildProjectFile)". Supported values are: 'full', 'none'" /> |
| 259 | 254 | ||
| @@ -695,7 +690,11 @@ | |||
| 695 | 690 | ||
| 696 | SuppressValidation="$(SuppressValidation)" | 691 | SuppressValidation="$(SuppressValidation)" |
| 697 | SuppressIces="$(SuppressIces)" | 692 | SuppressIces="$(SuppressIces)" |
| 698 | AdditionalCub="$(AdditionalCub)" /> | 693 | AdditionalCub="$(AdditionalCub)" |
| 694 | |||
| 695 | RunAsSeparateProcess="$(RunWixToolsOutOfProc)" | ||
| 696 | ToolExe="$(WixToolExe)" | ||
| 697 | ToolPath="$(WixToolDir)" /> | ||
| 699 | 698 | ||
| 700 | <!-- | 699 | <!-- |
| 701 | SuppressAllWarnings="$(CompilerSuppressAllWarnings);$(LinkerSuppressAllWarnings)" | 700 | SuppressAllWarnings="$(CompilerSuppressAllWarnings);$(LinkerSuppressAllWarnings)" |
diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index 210473fa..6862f2a8 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | |||
| @@ -28,9 +28,6 @@ namespace WixToolsetTest.MSBuild | |||
| 28 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 28 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 29 | result.AssertSuccess(); | 29 | result.AssertSuccess(); |
| 30 | 30 | ||
| 31 | var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); | ||
| 32 | Assert.Single(platformSwitches); | ||
| 33 | |||
| 34 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 31 | var warnings = result.Output.Where(line => line.Contains(": warning")); |
| 35 | Assert.Empty(warnings); | 32 | Assert.Empty(warnings); |
| 36 | 33 | ||
| @@ -63,9 +60,6 @@ namespace WixToolsetTest.MSBuild | |||
| 63 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 60 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 64 | result.AssertSuccess(); | 61 | result.AssertSuccess(); |
| 65 | 62 | ||
| 66 | var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); | ||
| 67 | Assert.Single(platformSwitches); | ||
| 68 | |||
| 69 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 63 | var warnings = result.Output.Where(line => line.Contains(": warning")); |
| 70 | Assert.Empty(warnings); | 64 | Assert.Empty(warnings); |
| 71 | 65 | ||
| @@ -98,7 +92,7 @@ namespace WixToolsetTest.MSBuild | |||
| 98 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 92 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 99 | result.AssertSuccess(); | 93 | result.AssertSuccess(); |
| 100 | 94 | ||
| 101 | var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); | 95 | var platformSwitches = result.Output.Where(line => line.Contains("-platform x86")); |
| 102 | Assert.Single(platformSwitches); | 96 | Assert.Single(platformSwitches); |
| 103 | 97 | ||
| 104 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 98 | var warnings = result.Output.Where(line => line.Contains(": warning")); |
| @@ -223,7 +217,7 @@ namespace WixToolsetTest.MSBuild | |||
| 223 | }); | 217 | }); |
| 224 | result.AssertSuccess(); | 218 | result.AssertSuccess(); |
| 225 | 219 | ||
| 226 | var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x64")); | 220 | var platformSwitches = result.Output.Where(line => line.Contains("-platform x64")); |
| 227 | Assert.Single(platformSwitches); | 221 | Assert.Single(platformSwitches); |
| 228 | 222 | ||
| 229 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) | 223 | var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) |
| @@ -287,9 +281,11 @@ namespace WixToolsetTest.MSBuild | |||
| 287 | } | 281 | } |
| 288 | 282 | ||
| 289 | [Theory] | 283 | [Theory] |
| 290 | [InlineData(BuildSystem.MSBuild)] | 284 | [InlineData(BuildSystem.MSBuild, null)] |
| 291 | [InlineData(BuildSystem.MSBuild64)] | 285 | [InlineData(BuildSystem.MSBuild, true)] |
| 292 | public void CanBuildSimpleMsiPackageAsWixipl(BuildSystem buildSystem) | 286 | [InlineData(BuildSystem.MSBuild64, null)] |
| 287 | [InlineData(BuildSystem.MSBuild64, true)] | ||
| 288 | public void CanBuildSimpleMsiPackageAsWixipl(BuildSystem buildSystem, bool? outOfProc) | ||
| 293 | { | 289 | { |
| 294 | var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); | 290 | var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); |
| 295 | 291 | ||
| @@ -303,9 +299,14 @@ namespace WixToolsetTest.MSBuild | |||
| 303 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] | 299 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] |
| 304 | { | 300 | { |
| 305 | "-p:OutputType=IntermediatePostLink", | 301 | "-p:OutputType=IntermediatePostLink", |
| 306 | }); | 302 | }, outOfProc: outOfProc); |
| 307 | result.AssertSuccess(); | 303 | result.AssertSuccess(); |
| 308 | 304 | ||
| 305 | var expectedOutOfProc = outOfProc.HasValue && outOfProc.Value; | ||
| 306 | var expectedWixCommand = $"{(expectedOutOfProc ? "wix.exe" : "(wix.exe)")} build"; | ||
| 307 | var buildCommands = result.Output.Where(line => line.TrimStart().Contains(expectedWixCommand)); | ||
| 308 | Assert.Single(buildCommands); | ||
| 309 | |||
| 309 | var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) | 310 | var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) |
| 310 | .Select(s => s.Substring(baseFolder.Length + 1)) | 311 | .Select(s => s.Substring(baseFolder.Length + 1)) |
| 311 | .Single(); | 312 | .Single(); |
diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs index 038da241..b5c71f86 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | |||
| @@ -31,7 +31,9 @@ namespace WixToolsetTest.MSBuild | |||
| 31 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 31 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 32 | result.AssertSuccess(); | 32 | result.AssertSuccess(); |
| 33 | 33 | ||
| 34 | var heatCommandLines = result.Output.Where(line => line.TrimStart().StartsWith("heat.exe file")); | 34 | var expectedOutOfProc = false; |
| 35 | var expectedHeatCommand = $"{(expectedOutOfProc ? "heat.exe" : "(heat.exe)")} file"; | ||
| 36 | var heatCommandLines = result.Output.Where(line => line.Contains(expectedHeatCommand)); | ||
| 35 | Assert.Single(heatCommandLines); | 37 | Assert.Single(heatCommandLines); |
| 36 | 38 | ||
| 37 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 39 | var warnings = result.Output.Where(line => line.Contains(": warning")); |
| @@ -86,7 +88,9 @@ namespace WixToolsetTest.MSBuild | |||
| 86 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); | 88 | var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); |
| 87 | result.AssertSuccess(); | 89 | result.AssertSuccess(); |
| 88 | 90 | ||
| 89 | var heatCommandLines = result.Output.Where(line => line.TrimStart().StartsWith("heat.exe file")); | 91 | var expectedOutOfProc = false; |
| 92 | var expectedHeatCommand = $"{(expectedOutOfProc ? "heat.exe" : "(heat.exe)")} file"; | ||
| 93 | var heatCommandLines = result.Output.Where(line => line.Contains(expectedHeatCommand)); | ||
| 90 | Assert.Equal(2, heatCommandLines.Count()); | 94 | Assert.Equal(2, heatCommandLines.Count()); |
| 91 | 95 | ||
| 92 | var warnings = result.Output.Where(line => line.Contains(": warning")); | 96 | var warnings = result.Output.Where(line => line.Contains(": warning")); |
diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs index 633fffe0..6a6f32e0 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs | |||
| @@ -17,7 +17,7 @@ namespace WixToolsetTest.MSBuild | |||
| 17 | { | 17 | { |
| 18 | public static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); | 18 | public static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); |
| 19 | 19 | ||
| 20 | public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release") | 20 | public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null) |
| 21 | { | 21 | { |
| 22 | var allArgs = new List<string> | 22 | var allArgs = new List<string> |
| 23 | { | 23 | { |
| @@ -28,6 +28,11 @@ namespace WixToolsetTest.MSBuild | |||
| 28 | "-nr:false", | 28 | "-nr:false", |
| 29 | }; | 29 | }; |
| 30 | 30 | ||
| 31 | if (outOfProc.HasValue) | ||
| 32 | { | ||
| 33 | allArgs.Add($"-p:RunWixToolsOutOfProc={outOfProc.Value}"); | ||
| 34 | } | ||
| 35 | |||
| 31 | if (arguments != null) | 36 | if (arguments != null) |
| 32 | { | 37 | { |
| 33 | allArgs.AddRange(arguments); | 38 | allArgs.AddRange(arguments); |
