@joebigelow / wix-1 / commits / 28779cbb

Plumb InstallerPlatform through MSBuild task.

Bob Arnson committed Jan 16, 2019 at 22:53 UTC 28779cbbaa5fcba61009d416654345d50a96fa91
2 files changed +29
src/WixToolset.BuildTasks/DoIt.cs
+1
@@ -159,6 +159,7 @@ namespace WixToolset.BuildTasks
159
160 commandLineBuilder.AppendTextUnquoted("build");
161
162 + commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.InstallerPlatform);
163 commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile);
164 commandLineBuilder.AppendSwitchIfNotNull("-outputType ", this.OutputType);
165 commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo);
src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs
+28
@@ -39,6 +39,9 @@ namespace WixToolsetTest.BuildTasks
39 });
40 result.AssertSuccess();
41
42 + var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86"));
43 + Assert.Single(platformSwitches);
44 +
45 var warnings = result.Output.Where(line => line.Contains(": warning"));
46 Assert.Equal(4, warnings.Count());
47
@@ -55,6 +58,31 @@ namespace WixToolsetTest.BuildTasks
58 }
59 }
60
61 + [Fact]
62 + public void CanBuild64BitMsiPackage()
63 + {
64 + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj");
65 +
66 + using (var fs = new DisposableFileSystem())
67 + {
68 + var baseFolder = fs.GetFolder();
69 + var binFolder = Path.Combine(baseFolder, @"bin\");
70 + var intermediateFolder = Path.Combine(baseFolder, @"obj\");
71 +
72 + var result = this.MsbuildRunner.Execute(projectPath, new[]
73 + {
74 + $"-p:WixTargetsPath={WixTargetsPath}",
75 + $"-p:IntermediateOutputPath={intermediateFolder}",
76 + $"-p:OutputPath={binFolder}",
77 + $"-p:InstallerPlatform=x64",
78 + });
79 + result.AssertSuccess();
80 +
81 + var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x64"));
82 + Assert.Single(platformSwitches);
83 + }
84 + }
85 +
86 [Fact(Skip = "Currently fails")]
87 public void CanBuildSimpleMsiPackageWithIceSuppressions()
88 {