@joebigelow / wix-1 / commits / 62224cf5

Create RequiresNativeWixAssets property.

Sean Hall committed Feb 18, 2022 at 17:22 UTC 62224cf5c909c6b9ea09eeb0bcf29021091e7665
6 files changed +44 -58
src/wix/Directory.Build.targets new
+39
@@ -0,0 +1,39 @@
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<!-- 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. -->
3 +<Project>
4 + <Import Project="..\Directory.Build.targets" />
5 +
6 + <ItemGroup Condition=" '$(RequiresNativeWixAssets)'=='true' and ('$(TargetFrameworkIdentifier)'=='.NETFramework' or '$(RuntimeIdentifier)'!='' ) ">
7 + <!-- Copy the x64 binaries when there is no RuntimeIdentifier since we've standardized on VS2022 (which is 64-bit) -->
8 + <None Include="$(MSBuildThisFileDirectory)wixnative\x64\mergemod.dll" CopyToOutputDirectory="PreserveNewest" Condition=" '$(RuntimeIdentifier)'=='win-x64' or '$(RuntimeIdentifier)'=='' " />
9 + <None Include="$(BaseOutputPath)$(Configuration)\x64\wixnative.exe" CopyToOutputDirectory="PreserveNewest" Condition=" '$(RuntimeIdentifier)'=='win-x64' or '$(RuntimeIdentifier)'=='' " />
10 +
11 + <None Include="$(MSBuildThisFileDirectory)wixnative\Win32\mergemod.dll" CopyToOutputDirectory="PreserveNewest" Condition=" '$(RuntimeIdentifier)'=='win-x86' " />
12 + <None Include="$(BaseOutputPath)$(Configuration)\x86\wixnative.exe" CopyToOutputDirectory="PreserveNewest" Condition=" '$(RuntimeIdentifier)'=='win-x86' " />
13 + </ItemGroup>
14 +
15 + <ItemGroup Condition=" '$(RequiresNativeWixAssets)'=='true' and '$(TargetFrameworkIdentifier)'!='.NETFramework' and '$(RuntimeIdentifier)'=='' ">
16 + <NativeLibrary Include="$(MSBuildThisFileDirectory)wixnative\ARM64\mergemod.dll" RuntimeIdentifier="win-arm64" />
17 + <NativeLibrary Include="$(MSBuildThisFileDirectory)wixnative\x64\mergemod.dll" RuntimeIdentifier="win-x64" />
18 + <NativeLibrary Include="$(MSBuildThisFileDirectory)wixnative\Win32\mergemod.dll" RuntimeIdentifier="win-x86" />
19 + <NativeLibrary Include="$(BaseOutputPath)$(Configuration)\ARM64\wixnative.exe" RuntimeIdentifier="win-arm64" />
20 + <NativeLibrary Include="$(BaseOutputPath)$(Configuration)\x64\wixnative.exe" RuntimeIdentifier="win-x64" />
21 + <NativeLibrary Include="$(BaseOutputPath)$(Configuration)\x86\wixnative.exe" RuntimeIdentifier="win-x86" />
22 +
23 + <!--
24 + This PackageReference is required so the RuntimeTargetsCopyLocalItems have a package (any package would
25 + do, WixToolset.Data is as good as any) to "attach" themselves to.
26 + -->
27 + <PackageReference Include="WixToolset.Data" />
28 +
29 + <RuntimeTargetsCopyLocalItems Include="@(NativeLibrary)"
30 + AssetType="native"
31 + DestinationSubDirectory="runtimes\%(RuntimeIdentifier)\native\"
32 + NuGetPackageId="WixToolset.Data"
33 + RuntimeIdentifier="%(RuntimeIdentifier)"
34 + />
35 + <None Include="@(RuntimeTargetsCopyLocalItems)"
36 + Link="%(DestinationSubDirectory)\%(FileName)%(Extension)"
37 + CopyToOutputDirectory="PreserveNewest" />
38 + </ItemGroup>
39 +</Project>
src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj
+1 -6
@@ -8,6 +8,7 @@
8 <DebugType>embedded</DebugType>
9 <RuntimeIdentifier>win-x64</RuntimeIdentifier>
10 <SignOutput>false</SignOutput>
11 + <RequiresNativeWixAssets>true</RequiresNativeWixAssets>
12 </PropertyGroup>
13
14 <ItemGroup>
@@ -22,12 +23,6 @@
23 <ProjectReference Include="..\..\WixToolset.Core.TestPackage\WixToolset.Core.TestPackage.csproj" />
24 </ItemGroup>
25
25 - <!-- Copy the x64 binaries for unittests since we've standardized on VS2022 (which is 64-bit only) -->
26 - <ItemGroup>
27 - <None Include="..\..\wixnative\x64\mergemod.dll" CopyToOutputDirectory="PreserveNewest" />
28 - <None Include="$(BaseOutputPath)$(Configuration)\x64\wixnative.exe" CopyToOutputDirectory="PreserveNewest" />
29 - </ItemGroup>
30 -
26 <ItemGroup>
27 <PackageReference Include="Microsoft.Build.Tasks.Core" />
28 <PackageReference Include="WixBuildTools.TestSupport" />
src/wix/test/WixToolsetTest.Core.Native/WixToolsetTest.Core.Native.csproj
+1 -6
@@ -7,18 +7,13 @@
7 <IsPackable>false</IsPackable>
8 <RuntimeIdentifier>win-x64</RuntimeIdentifier>
9 <SignOutput>false</SignOutput>
10 + <RequiresNativeWixAssets>true</RequiresNativeWixAssets>
11 </PropertyGroup>
12
13 <ItemGroup>
14 <Content Include="TestData\**" CopyToOutputDirectory="PreserveNewest" />
15 </ItemGroup>
16
16 - <!-- Copy the x64 binaries for unittests since we've standardized on VS2022 (which is 64-bit only) -->
17 - <ItemGroup>
18 - <None Include="..\..\wixnative\x64\mergemod.dll" CopyToOutputDirectory="PreserveNewest" />
19 - <None Include="$(BaseOutputPath)$(Configuration)\x64\wixnative.exe" CopyToOutputDirectory="PreserveNewest" />
20 - </ItemGroup>
21 -
17 <ItemGroup>
18 <ProjectReference Include="..\..\WixToolset.Core.Native\WixToolset.Core.Native.csproj" />
19 </ItemGroup>
src/wix/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+1 -6
@@ -7,18 +7,13 @@
7 <IsPackable>false</IsPackable>
8 <DebugType>embedded</DebugType>
9 <SignOutput>false</SignOutput>
10 + <RequiresNativeWixAssets>true</RequiresNativeWixAssets>
11 </PropertyGroup>
12
13 <ItemGroup>
14 <Content Include="TestData\**" CopyToOutputDirectory="PreserveNewest" />
15 </ItemGroup>
16
16 - <!-- Copy the x64 binaries for unittests since we've standardized on VS2022 (which is 64-bit only) -->
17 - <ItemGroup>
18 - <None Include="..\..\wixnative\x64\mergemod.dll" CopyToOutputDirectory="PreserveNewest" />
19 - <None Include="$(BaseOutputPath)$(Configuration)\x64\wixnative.exe" CopyToOutputDirectory="PreserveNewest" />
20 - </ItemGroup>
21 -
17 <ItemGroup>
18 <ProjectReference Include="..\..\WixToolset.Core\WixToolset.Core.csproj" />
19 <ProjectReference Include="..\..\WixToolset.Core.Burn\WixToolset.Core.Burn.csproj" />
src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj
+1 -6
@@ -8,18 +8,13 @@
8 <DebugType>embedded</DebugType>
9 <DefaultItemExcludes>TestData\**;$(DefaultItemExcludes)</DefaultItemExcludes>
10 <SignOutput>false</SignOutput>
11 + <RequiresNativeWixAssets>true</RequiresNativeWixAssets>
12 </PropertyGroup>
13
14 <ItemGroup>
15 <Content Include="TestData\**" CopyToOutputDirectory="PreserveNewest" />
16 </ItemGroup>
17
17 - <!-- Copy the x64 binaries for unittests since we've standardized on VS2022 (which is 64-bit only) -->
18 - <ItemGroup>
19 - <None Include="..\..\wixnative\x64\mergemod.dll" CopyToOutputDirectory="PreserveNewest" />
20 - <None Include="$(BaseOutputPath)$(Configuration)\x64\wixnative.exe" CopyToOutputDirectory="PreserveNewest" />
21 - </ItemGroup>
22 -
18 <ItemGroup>
19 <ProjectReference Include="..\..\WixToolset.Core.TestPackage\WixToolset.Core.TestPackage.csproj" />
20 </ItemGroup>
src/wix/wix/wix.csproj
+1 -34
@@ -14,6 +14,7 @@
14 <ApplicationManifest>wix.exe.manifest</ApplicationManifest>
15 <RollForward>Major</RollForward>
16 <NuspecBasePath>$(OutputPath)publish\wix\</NuspecBasePath>
17 + <RequiresNativeWixAssets Condition=" '$(NCrunch)'=='' ">true</RequiresNativeWixAssets>
18 </PropertyGroup>
19
20 <ItemGroup>
@@ -24,38 +25,4 @@
25 <ProjectReference Include="..\WixToolset.Core.WindowsInstaller\WixToolset.Core.WindowsInstaller.csproj" />
26 </ItemGroup>
27
27 - <ItemGroup Condition=" '$(TargetFrameworkIdentifier)'=='.NETFramework' and '$(NCrunch)'=='' ">
28 - <!-- Copy the x64 binaries when there is no RuntimeIdentifier since we've standardized on VS2022 (which is 64-bit only) -->
29 - <None Include="..\wixnative\x64\mergemod.dll" CopyToOutputDirectory="PreserveNewest" Condition=" '$(RuntimeIdentifier)'=='win-x64' or '$(RuntimeIdentifier)'=='' " />
30 - <None Include="$(BaseOutputPath)$(Configuration)\x64\wixnative.exe" CopyToOutputDirectory="PreserveNewest" Condition=" '$(RuntimeIdentifier)'=='win-x64' or '$(RuntimeIdentifier)'=='' " />
31 -
32 - <None Include="..\wixnative\Win32\mergemod.dll" CopyToOutputDirectory="PreserveNewest" Condition=" '$(RuntimeIdentifier)'=='win-x86' " />
33 - <None Include="$(BaseOutputPath)$(Configuration)\x86\wixnative.exe" CopyToOutputDirectory="PreserveNewest" Condition=" '$(RuntimeIdentifier)'=='win-x86' " />
34 - </ItemGroup>
35 -
36 - <ItemGroup Condition=" '$(TargetFrameworkIdentifier)'!='.NETFramework' and '$(NCrunch)'=='' ">
37 - <NativeLibrary Include="..\wixnative\ARM64\mergemod.dll" RuntimeIdentifier="win-arm64" />
38 - <NativeLibrary Include="..\wixnative\x64\mergemod.dll" RuntimeIdentifier="win-x64" />
39 - <NativeLibrary Include="..\wixnative\Win32\mergemod.dll" RuntimeIdentifier="win-x86" />
40 - <NativeLibrary Include="$(BaseOutputPath)$(Configuration)\ARM64\wixnative.exe" RuntimeIdentifier="win-arm64" />
41 - <NativeLibrary Include="$(BaseOutputPath)$(Configuration)\x64\wixnative.exe" RuntimeIdentifier="win-x64" />
42 - <NativeLibrary Include="$(BaseOutputPath)$(Configuration)\x86\wixnative.exe" RuntimeIdentifier="win-x86" />
43 -
44 - <!--
45 - This PackageReference is required so the RuntimeTargetsCopyLocalItems have a package (any package would
46 - do, WixToolset.Data is as good as any) to "attach" themselves to.
47 - -->
48 - <PackageReference Include="WixToolset.Data" />
49 -
50 - <RuntimeTargetsCopyLocalItems Include="@(NativeLibrary)"
51 - AssetType="native"
52 - DestinationSubDirectory="runtimes\%(RuntimeIdentifier)\native\"
53 - NuGetPackageId="WixToolset.Data"
54 - RuntimeIdentifier="%(RuntimeIdentifier)"
55 - />
56 - <None Include="@(RuntimeTargetsCopyLocalItems)"
57 - Link="%(DestinationSubDirectory)\%(FileName)%(Extension)"
58 - CopyToOutputDirectory="PreserveNewest" />
59 - </ItemGroup>
60 -
28 </Project>