diff options
author | Rob Mensching <rob@firegiant.com> | 2022-10-12 22:01:55 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2022-10-14 20:13:50 -0700 |
commit | 07b3d459ea0a45cbef29b98d283edafbab26462a (patch) | |
tree | 1e834882038ba3862f8acb7b60e7a4bfaef793fd /src/test | |
parent | 5567239a9411aac769a34f2c65b80a523a577ad7 (diff) | |
download | wix-07b3d459ea0a45cbef29b98d283edafbab26462a.tar.gz wix-07b3d459ea0a45cbef29b98d283edafbab26462a.tar.bz2 wix-07b3d459ea0a45cbef29b98d283edafbab26462a.zip |
Normalize ToolsetTask implementation to call wix.exe and heat.exe
Share the ToolsetTask implementation that can find .NET Core and
.NET Framework with multiple architectures.
Fixes 6951
Diffstat (limited to 'src/test')
9 files changed, 110 insertions, 0 deletions
diff --git a/src/test/wix/TestData/WixprojPackageHarvesting/Package.wxs b/src/test/wix/TestData/WixprojPackageHarvesting/Package.wxs new file mode 100644 index 00000000..cea86733 --- /dev/null +++ b/src/test/wix/TestData/WixprojPackageHarvesting/Package.wxs | |||
@@ -0,0 +1,12 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
2 | <Package Name='WixprojPackageHarvesting' Manufacturer='WiX Toolset' Version='0.0.1' UpgradeCode='41a2c17e-1976-465b-bcde-eae03516ca68'> | ||
3 | |||
4 | <StandardDirectory Id='ProgramFiles6432Folder'> | ||
5 | <Directory Id='ApplicationFolder' Name='Test App' /> | ||
6 | </StandardDirectory> | ||
7 | |||
8 | <Feature Id='Main'> | ||
9 | <ComponentGroupRef Id='HarvestedComponents' /> | ||
10 | </Feature> | ||
11 | </Package> | ||
12 | </Wix> | ||
diff --git a/src/test/wix/TestData/WixprojPackageHarvesting/WixprojPackageHarvesting.wixproj b/src/test/wix/TestData/WixprojPackageHarvesting/WixprojPackageHarvesting.wixproj new file mode 100644 index 00000000..c4255246 --- /dev/null +++ b/src/test/wix/TestData/WixprojPackageHarvesting/WixprojPackageHarvesting.wixproj | |||
@@ -0,0 +1,21 @@ | |||
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 | <Project Sdk='WixToolset.Sdk'> | ||
4 | <PropertyGroup> | ||
5 | <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
6 | <SuppressValidation>true</SuppressValidation> | ||
7 | </PropertyGroup> | ||
8 | |||
9 | <ItemGroup> | ||
10 | <HarvestDirectory Include="_data"> | ||
11 | <ComponentGroupName>HarvestedComponents</ComponentGroupName> | ||
12 | <DirectoryRefId>ApplicationFolder</DirectoryRefId> | ||
13 | <SuppressRootDirectory>true</SuppressRootDirectory> | ||
14 | </HarvestDirectory> | ||
15 | <BindInputPaths Include="_data" /> | ||
16 | </ItemGroup> | ||
17 | |||
18 | <ItemGroup> | ||
19 | <PackageReference Include="Wixtoolset.Heat" /> | ||
20 | </ItemGroup> | ||
21 | </Project> | ||
diff --git a/src/test/wix/TestData/WixprojPackageHarvesting/_data/a.txt b/src/test/wix/TestData/WixprojPackageHarvesting/_data/a.txt new file mode 100644 index 00000000..71b864af --- /dev/null +++ b/src/test/wix/TestData/WixprojPackageHarvesting/_data/a.txt | |||
@@ -0,0 +1 @@ | |||
This is a.txt. | |||
diff --git a/src/test/wix/TestData/WixprojPackageHarvesting/_data/b.txt b/src/test/wix/TestData/WixprojPackageHarvesting/_data/b.txt new file mode 100644 index 00000000..78eb1cc6 --- /dev/null +++ b/src/test/wix/TestData/WixprojPackageHarvesting/_data/b.txt | |||
@@ -0,0 +1 @@ | |||
This is b.txt. | |||
diff --git a/src/test/wix/TestData/WixprojPackageHeatDir/Package.wxs b/src/test/wix/TestData/WixprojPackageHeatDir/Package.wxs new file mode 100644 index 00000000..cea86733 --- /dev/null +++ b/src/test/wix/TestData/WixprojPackageHeatDir/Package.wxs | |||
@@ -0,0 +1,12 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
2 | <Package Name='WixprojPackageHarvesting' Manufacturer='WiX Toolset' Version='0.0.1' UpgradeCode='41a2c17e-1976-465b-bcde-eae03516ca68'> | ||
3 | |||
4 | <StandardDirectory Id='ProgramFiles6432Folder'> | ||
5 | <Directory Id='ApplicationFolder' Name='Test App' /> | ||
6 | </StandardDirectory> | ||
7 | |||
8 | <Feature Id='Main'> | ||
9 | <ComponentGroupRef Id='HarvestedComponents' /> | ||
10 | </Feature> | ||
11 | </Package> | ||
12 | </Wix> | ||
diff --git a/src/test/wix/TestData/WixprojPackageHeatDir/WixprojPackageHeatDir.wixproj b/src/test/wix/TestData/WixprojPackageHeatDir/WixprojPackageHeatDir.wixproj new file mode 100644 index 00000000..3df9c9d4 --- /dev/null +++ b/src/test/wix/TestData/WixprojPackageHeatDir/WixprojPackageHeatDir.wixproj | |||
@@ -0,0 +1,30 @@ | |||
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 | <Project Sdk='WixToolset.Sdk'> | ||
4 | <PropertyGroup> | ||
5 | <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
6 | <SuppressValidation>true</SuppressValidation> | ||
7 | </PropertyGroup> | ||
8 | |||
9 | <ItemGroup> | ||
10 | <BindInputPaths Include="_data" /> | ||
11 | </ItemGroup> | ||
12 | |||
13 | <ItemGroup> | ||
14 | <PackageReference Include="Wixtoolset.Heat" /> | ||
15 | </ItemGroup> | ||
16 | |||
17 | <Target Name="ManualHarvest" BeforeTargets="BeforeBuild"> | ||
18 | <HeatDirectory | ||
19 | Directory="_data" | ||
20 | AutogenerateGuids="true" | ||
21 | ComponentGroupName="HarvestedComponents" | ||
22 | DirectoryRefId="ApplicationFolder" | ||
23 | OutputFile="obj\_g.wxs" | ||
24 | /> | ||
25 | <ItemGroup> | ||
26 | <Compile Include="obj\_g.wxs" /> | ||
27 | </ItemGroup> | ||
28 | </Target> | ||
29 | |||
30 | </Project> | ||
diff --git a/src/test/wix/TestData/WixprojPackageHeatDir/_data/a.txt b/src/test/wix/TestData/WixprojPackageHeatDir/_data/a.txt new file mode 100644 index 00000000..71b864af --- /dev/null +++ b/src/test/wix/TestData/WixprojPackageHeatDir/_data/a.txt | |||
@@ -0,0 +1 @@ | |||
This is a.txt. | |||
diff --git a/src/test/wix/TestData/WixprojPackageHeatDir/_data/b.txt b/src/test/wix/TestData/WixprojPackageHeatDir/_data/b.txt new file mode 100644 index 00000000..78eb1cc6 --- /dev/null +++ b/src/test/wix/TestData/WixprojPackageHeatDir/_data/b.txt | |||
@@ -0,0 +1 @@ | |||
This is b.txt. | |||
diff --git a/src/test/wix/WixE2E/WixE2EFixture.cs b/src/test/wix/WixE2E/WixE2EFixture.cs index b1c6b2de..5574680f 100644 --- a/src/test/wix/WixE2E/WixE2EFixture.cs +++ b/src/test/wix/WixE2E/WixE2EFixture.cs | |||
@@ -115,6 +115,32 @@ namespace WixE2E | |||
115 | Assert.NotEqual(firstHashes, secondHashes); | 115 | Assert.NotEqual(firstHashes, secondHashes); |
116 | } | 116 | } |
117 | 117 | ||
118 | [Theory] | ||
119 | [InlineData(false)] | ||
120 | [InlineData(true)] | ||
121 | public void CanBuildPackageWithHarvesting(bool x64) | ||
122 | { | ||
123 | var projectPath = TestData.Get("TestData", "WixprojPackageHarvesting", "WixprojPackageHarvesting.wixproj"); | ||
124 | |||
125 | CleanEverything(); | ||
126 | |||
127 | var result = RestoreAndBuild(projectPath, x64); | ||
128 | result.AssertSuccess(); | ||
129 | } | ||
130 | |||
131 | [Theory] | ||
132 | [InlineData(false)] | ||
133 | [InlineData(true)] | ||
134 | public void CanBuildPackageWithHeatDir(bool x64) | ||
135 | { | ||
136 | var projectPath = TestData.Get("TestData", "WixprojPackageHeatDir", "WixprojPackageHeatDir.wixproj"); | ||
137 | |||
138 | CleanEverything(); | ||
139 | |||
140 | var result = RestoreAndBuild(projectPath, x64); | ||
141 | result.AssertSuccess(); | ||
142 | } | ||
143 | |||
118 | [Fact(Skip = "Investigate if .NET Core WebApplications can be incrementally built")] | 144 | [Fact(Skip = "Investigate if .NET Core WebApplications can be incrementally built")] |
119 | public void CanIncrementalBuildPackageWithNetCoreWebAppWithoutEdits() | 145 | public void CanIncrementalBuildPackageWithNetCoreWebAppWithoutEdits() |
120 | { | 146 | { |
@@ -161,6 +187,11 @@ namespace WixE2E | |||
161 | } | 187 | } |
162 | } | 188 | } |
163 | } | 189 | } |
190 | |||
191 | foreach (var logFile in Directory.GetFiles(rootFolder, "*.binlog", SearchOption.AllDirectories)) | ||
192 | { | ||
193 | File.Delete(logFile); | ||
194 | } | ||
164 | } | 195 | } |
165 | 196 | ||
166 | private static string GetFileHash(string path) | 197 | private static string GetFileHash(string path) |