diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-05-30 18:56:15 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-05-31 15:11:21 +1000 |
| commit | 0fbada441640a27352935edc43e1ea16c7a4d8f8 (patch) | |
| tree | 4d9a522eef941a6ed01dfb43bef0ede3ea441cb9 /src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs | |
| parent | 05ee2175b44c68816c24a33a16861a637fa15ad7 (diff) | |
| download | wix-0fbada441640a27352935edc43e1ea16c7a4d8f8.tar.gz wix-0fbada441640a27352935edc43e1ea16c7a4d8f8.tar.bz2 wix-0fbada441640a27352935edc43e1ea16c7a4d8f8.zip | |
Update all MSBuild tests to run on x86 and x64 MSBuild.
Diffstat (limited to 'src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs')
| -rw-r--r-- | src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs new file mode 100644 index 00000000..d4815bde --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs | |||
| @@ -0,0 +1,46 @@ | |||
| 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 | |||
| 3 | namespace WixToolsetTest.MSBuild | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Collections.Generic; | ||
| 7 | using System.IO; | ||
| 8 | using WixBuildTools.TestSupport; | ||
| 9 | |||
| 10 | public enum BuildSystem | ||
| 11 | { | ||
| 12 | MSBuild, | ||
| 13 | MSBuild64, | ||
| 14 | } | ||
| 15 | |||
| 16 | public static class MsbuildUtilities | ||
| 17 | { | ||
| 18 | public static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); | ||
| 19 | |||
| 20 | public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, params string[] arguments) | ||
| 21 | { | ||
| 22 | var allArgs = new List<string> | ||
| 23 | { | ||
| 24 | $"-p:WixMSBuildProps={MsbuildUtilities.WixPropsPath}", | ||
| 25 | }; | ||
| 26 | |||
| 27 | if (arguments != null) | ||
| 28 | { | ||
| 29 | allArgs.AddRange(arguments); | ||
| 30 | } | ||
| 31 | |||
| 32 | switch (buildSystem) | ||
| 33 | { | ||
| 34 | case BuildSystem.MSBuild: | ||
| 35 | case BuildSystem.MSBuild64: | ||
| 36 | { | ||
| 37 | return MsbuildRunner.Execute(projectPath, allArgs.ToArray(), buildSystem == BuildSystem.MSBuild64); | ||
| 38 | } | ||
| 39 | default: | ||
| 40 | { | ||
| 41 | throw new NotImplementedException(); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | } | ||
| 45 | } | ||
| 46 | } | ||
