@joebigelow / wix / commits / 05ee2175

Update MSBuild tests to use WixToolset.MSBuild.props to find wix.targets.

Sean Hall committed May 30, 2020 at 18:55 UTC 05ee2175b44c68816c24a33a16861a637fa15ad7
12 files changed +29 -45
src/ThmViewerPackage/ThmViewerPackage.wixproj
+2 -2
@@ -1,6 +1,6 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 - <Import Project="..\Directory.Build.props" />
3 + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
4
5 <PropertyGroup>
6 <ProjectGuid>59c4b122-5167-445b-8fc4-09dcd4eced89</ProjectGuid>
@@ -23,7 +23,7 @@
23 </ProjectReference>
24 </ItemGroup>
25
26 - <Import Project="$(OutputPath)\publish\WixToolset.MSBuild\tools\wix.targets" />
26 + <Import Project="$(WixTargetsPath)" />
27
28 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
29 <PropertyGroup>
src/Wix.Build.props
+2
@@ -9,4 +9,6 @@
9 <ItemGroup>
10 <BindInputPaths Include="$(OutputPath)Win32\" />
11 </ItemGroup>
12 +
13 + <Import Project="$(OutputPath)\publish\WixToolset.MSBuild\build\WixToolset.MSBuild.props" />
14 </Project>
src/WixToolset.MSBuild/WixToolset.MSBuild.csproj
+1
@@ -12,6 +12,7 @@
12 </PropertyGroup>
13
14 <ItemGroup>
15 + <Content Include="build\$(MSBuildThisFileName).props" CopyToOutputDirectory="PreserveNewest" />
16 <Content Include="tools\wix.ca.targets" CopyToOutputDirectory="PreserveNewest" />
17 <Content Include="tools\wix.harvest.targets" CopyToOutputDirectory="PreserveNewest" />
18 <Content Include="tools\wix.signing.targets" CopyToOutputDirectory="PreserveNewest" />
src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec
+1 -1
@@ -11,7 +11,7 @@
11 </metadata>
12
13 <files>
14 - <file src="$projectFolder$$id$.props" target="build" />
14 + <file src="build\**\*" target="build" />
15 <file src="tools\**\*" target="tools" />
16 </files>
17 </package>
src/WixToolset.MSBuild/build/WixToolset.MSBuild.props renamed
src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs
+10 -10
@@ -11,7 +11,7 @@ namespace WixToolsetTest.MSBuild
11
12 public class MsbuildFixture
13 {
14 - private static readonly string WixTargetsPath = Path.Combine(new Uri(typeof(MsbuildFixture).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "tools", "wix.targets");
14 + private static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildFixture).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props");
15
16 [Fact]
17 public void CanBuildSimpleBundle()
@@ -27,7 +27,7 @@ namespace WixToolsetTest.MSBuild
27
28 var result = MsbuildRunner.Execute(projectPath, new[]
29 {
30 - $"-p:WixTargetsPath={WixTargetsPath}",
30 + $"-p:WixMSBuildProps={WixPropsPath}",
31 });
32 result.AssertSuccess();
33
@@ -63,7 +63,7 @@ namespace WixToolsetTest.MSBuild
63
64 var result = MsbuildRunner.Execute(projectPath, new[]
65 {
66 - $"-p:WixTargetsPath={WixTargetsPath}",
66 + $"-p:WixMSBuildProps={WixPropsPath}",
67 });
68 result.AssertSuccess();
69
@@ -124,7 +124,7 @@ namespace WixToolsetTest.MSBuild
124 var result = MsbuildRunner.Execute(projectPath, new[]
125 {
126 wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}",
127 - $"-p:WixTargetsPath={WixTargetsPath}",
127 + $"-p:WixMSBuildProps={WixPropsPath}",
128 });
129 result.AssertSuccess();
130
@@ -150,7 +150,7 @@ namespace WixToolsetTest.MSBuild
150
151 var result = MsbuildRunner.Execute(projectPath, new[]
152 {
153 - $"-p:WixTargetsPath={WixTargetsPath}",
153 + $"-p:WixMSBuildProps={WixPropsPath}",
154 $"-p:InstallerPlatform=x64",
155 });
156 result.AssertSuccess();
@@ -185,7 +185,7 @@ namespace WixToolsetTest.MSBuild
185
186 var result = MsbuildRunner.Execute(projectPath, new[]
187 {
188 - $"-p:WixTargetsPath={WixTargetsPath}",
188 + $"-p:WixMSBuildProps={WixPropsPath}",
189 "-p:SuppressIces=\"ICE45;ICE46\""
190 });
191 result.AssertSuccess();
@@ -206,7 +206,7 @@ namespace WixToolsetTest.MSBuild
206
207 var result = MsbuildRunner.Execute(projectPath, new[]
208 {
209 - $"-p:WixTargetsPath={WixTargetsPath}",
209 + $"-p:WixMSBuildProps={WixPropsPath}",
210 "-p:SuppressSpecificWarnings=\"1118;1102\""
211 });
212 result.AssertSuccess();
@@ -230,7 +230,7 @@ namespace WixToolsetTest.MSBuild
230
231 var result = MsbuildRunner.Execute(projectPath, new[]
232 {
233 - $"-p:WixTargetsPath={WixTargetsPath}",
233 + $"-p:WixMSBuildProps={WixPropsPath}",
234 "-p:OutputType=IntermediatePostLink"
235 });
236 result.AssertSuccess();
@@ -256,7 +256,7 @@ namespace WixToolsetTest.MSBuild
256 // Build
257 var result = MsbuildRunner.Execute(projectPath, new[]
258 {
259 - $"-p:WixTargetsPath={WixTargetsPath}",
259 + $"-p:WixMSBuildProps={WixPropsPath}",
260 "-v:diag"
261 });
262 result.AssertSuccess();
@@ -272,7 +272,7 @@ namespace WixToolsetTest.MSBuild
272 // Clean
273 result = MsbuildRunner.Execute(projectPath, new[]
274 {
275 - $"-p:WixTargetsPath={WixTargetsPath}",
275 + $"-p:WixMSBuildProps={WixPropsPath}",
276 "-t:Clean",
277 "-v:diag"
278 });
src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs
+3 -3
@@ -13,7 +13,7 @@ namespace WixToolsetTest.MSBuild
13
14 public class MsbuildHeatFixture
15 {
16 - private static readonly string WixTargetsPath = Path.Combine(new Uri(typeof(MsbuildHeatFixture).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "tools", "wix.targets");
16 + private static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildHeatFixture).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props");
17
18 [Fact]
19 public void CanBuildHeatFilePackage()
@@ -30,7 +30,7 @@ namespace WixToolsetTest.MSBuild
30
31 var result = MsbuildRunner.Execute(projectPath, new[]
32 {
33 - $"-p:WixTargetsPath={WixTargetsPath}",
33 + $"-p:WixMSBuildProps={WixPropsPath}",
34 });
35 result.AssertSuccess();
36
@@ -86,7 +86,7 @@ namespace WixToolsetTest.MSBuild
86
87 var result = MsbuildRunner.Execute(projectPath, new[]
88 {
89 - $"-p:WixTargetsPath={WixTargetsPath}",
89 + $"-p:WixMSBuildProps={WixPropsPath}",
90 });
91 result.AssertSuccess();
92
src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj
+2 -5
@@ -1,5 +1,6 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 + <Import Project="$(WixMSBuildProps)" />
4 <PropertyGroup>
5 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6 <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
@@ -53,9 +54,5 @@
54 </HarvestFile>
55 </ItemGroup>
56
56 - <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
57 - <Import Project="$(MSBuildExtensionsPath32)\WixToolset\v4.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\WixToolset\v4.x\wix.targets') " />
58 - <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
59 - <Error Text="WiX Toolset build tools (v4.0 or later) must be installed to build this project. To download the WiX Toolset, go to http://wixtoolset.org/releases/." />
60 - </Target>
57 + <Import Project="$(WixTargetsPath)" />
58 </Project>
\ No newline at end of file
src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj
+2 -5
@@ -1,5 +1,6 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 + <Import Project="$(WixMSBuildProps)" />
4 <PropertyGroup>
5 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6 <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
@@ -48,9 +49,5 @@
49 </HarvestFile>
50 </ItemGroup>
51
51 - <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
52 - <Import Project="$(MSBuildExtensionsPath32)\WixToolset\v4.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\WixToolset\v4.x\wix.targets') " />
53 - <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
54 - <Error Text="WiX Toolset build tools (v4.0 or later) must be installed to build this project. To download the WiX Toolset, go to http://wixtoolset.org/releases/." />
55 - </Target>
52 + <Import Project="$(WixTargetsPath)" />
53 </Project>
\ No newline at end of file
src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj
+2 -9
@@ -1,5 +1,6 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 + <Import Project="$(WixMSBuildProps)" />
4 <PropertyGroup>
5 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6 <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
@@ -12,10 +13,6 @@
13 <Cultures>en-US,en;de-DE</Cultures>
14 </PropertyGroup>
15
15 - <PropertyGroup>
16 - <WixTargetsPath>..\..\..\..\..\..\build\Release\publish\net461\wix.targets</WixTargetsPath>
17 - </PropertyGroup>
18 -
16 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
17 <PlatformName>$(Platform)</PlatformName>
18 <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
@@ -49,9 +46,5 @@
46 <BindInputPaths Include="data" />
47 </ItemGroup>
48
52 - <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
53 - <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\wix.targets') " />
54 - <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
55 - <Error Text="WiX Toolset build tools (v3.11 or later) must be installed to build this project. To download the WiX Toolset, go to http://wixtoolset.org/releases/." />
56 - </Target>
49 + <Import Project="$(WixTargetsPath)" />
50 </Project>
src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj
+2 -5
@@ -1,5 +1,6 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 + <Import Project="$(WixMSBuildProps)" />
4 <PropertyGroup>
5 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6 <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
@@ -41,9 +42,5 @@
42 <BindInputPaths Include="data" />
43 </ItemGroup>
44
44 - <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
45 - <Import Project="$(MSBuildExtensionsPath32)\WixToolset\v4.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\WixToolset\v4.x\wix.targets') " />
46 - <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
47 - <Error Text="WiX Toolset build tools (v4.0 or later) must be installed to build this project. To download the WiX Toolset, go to http://wixtoolset.org/releases/." />
48 - </Target>
45 + <Import Project="$(WixTargetsPath)" />
46 </Project>
\ No newline at end of file
src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj
+2 -5
@@ -1,5 +1,6 @@
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 + <Import Project="$(WixMSBuildProps)" />
4 <PropertyGroup>
5 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6 <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
@@ -37,9 +38,5 @@
38 <BindInputPaths Include="..\MsiPackage\data" />
39 </ItemGroup>
40
40 - <Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
41 - <Import Project="$(MSBuildExtensionsPath32)\WixToolset\v4.x\wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\WixToolset\v4.x\wix.targets') " />
42 - <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
43 - <Error Text="WiX Toolset build tools (v4.0 or later) must be installed to build this project. To download the WiX Toolset, go to http://wixtoolset.org/releases/." />
44 - </Target>
41 + <Import Project="$(WixTargetsPath)" />
42 </Project>
\ No newline at end of file