Merge the native nupkg into the Core.Native nupkg.
There was no benefit in separating the native assets into its own package, the runtime.<rid>.PackageName strategy is for binaries to be copied to the root of project and therefore doesn't support the portable scenario where all available assets are required. Manually author the repository element in the nupkg for SourceLink.
Sean Hall committed
Jun 24, 2020 at 14:23 UTC
c50a0e000ab1812ec4781ace349a5d84fa01c8e4
6 files changed
+37
-68
appveyor.cmd
+4
-4
@@ -1,13 +1,13 @@
1
@setlocal
2
@pushd %~dp0
3
+@set _C=Release
4
5
nuget restore || exit /b
6
6
-msbuild -p:Configuration=Release .\src\test\WixToolsetTest.Core.Native\WixToolsetTest.Core.Native.csproj || exit /b
7
+msbuild -p:Configuration=%_C% src\test\WixToolsetTest.Core.Native\WixToolsetTest.Core.Native.csproj || exit /b
8
+dotnet test -c %_C% --no-build src\test\WixToolsetTest.Core.Native\WixToolsetTest.Core.Native.csproj || exit /b
9
8
-msbuild -t:Pack -p:Configuration=Release .\src\WixToolset.Core.Native\WixToolset.Core.Native.csproj || exit /b
9
-
10
-msbuild -t:Pack -p:Configuration=Release .\src\wixnative\wixnative.vcxproj || exit /b
10
+msbuild -t:Pack -p:Configuration=%_C% src\WixToolset.Core.Native\WixToolset.Core.Native.csproj || exit /b
11
12
@popd
13
@endlocal
\ No newline at end of file
src/WixToolset.Core.Native/WixToolset.Core.Native.csproj
+20
-10
@@ -5,9 +5,19 @@
5
<NuspecFile>$(MSBuildThisFileName).nuspec</NuspecFile>
6
<Description>Core Native</Description>
7
<DebugType>embedded</DebugType>
8
- <!-- <BeforePack>SetNuspecProperties</BeforePack> -->
8
</PropertyGroup>
9
10
+ <ItemGroup>
11
+ <ProjectReference Include="..\wixnative\wixnative.vcxproj">
12
+ <PrivateAssets>All</PrivateAssets>
13
+ <Properties>Platform=Win32</Properties>
14
+ </ProjectReference>
15
+ <ProjectReference Include="..\wixnative\wixnative.vcxproj">
16
+ <PrivateAssets>All</PrivateAssets>
17
+ <Properties>Platform=x64</Properties>
18
+ </ProjectReference>
19
+ </ItemGroup>
20
+
21
<ItemGroup>
22
<PackageReference Include="WixToolset.Data" Version="4.0.*" PrivateAssets="All" />
23
</ItemGroup>
@@ -20,16 +30,16 @@
30
<PropertyGroup>
31
<NativeFileListPath Condition=" '$(NCrunch)'=='' ">$(MSBuildProjectDir)..\..\build\obj\$(ProjectName)\$(Configuration)\NativeFileList.txt</NativeFileListPath>
32
<NativeFileListPath Condition=" '$(NCrunch)'=='1' ">$(NCrunchOriginalProjectDir)..\..\build\obj\$(ProjectName)\$(Configuration)\NativeFileList.txt</NativeFileListPath>
33
+ <MergeModDirectory>$(MSBuildThisFileDirectory)..\wixnative\</MergeModDirectory>
34
</PropertyGroup>
35
36
<Target Name="BuildWixNative" BeforeTargets="GetCopyToOutputDirectoryItems" Condition=" '$(NCrunch)'=='' ">
26
- <MSBuild Projects="..\wixnative\wixnative.vcxproj" Properties="Platform=Win32" Targets="Build;BuiltProjectOutputGroup;ContentFilesProjectOutputGroup;DebugSymbolsProjectOutputGroup">
27
- <Output TaskParameter="TargetOutputs" ItemName="_NativeProjectOutput" />
28
- </MSBuild>
29
- <MSBuild Projects="..\wixnative\wixnative.vcxproj" Properties="Platform=x64" Targets="Build;BuiltProjectOutputGroup;ContentFilesProjectOutputGroup;DebugSymbolsProjectOutputGroup">
30
- <Output TaskParameter="TargetOutputs" ItemName="_NativeProjectOutput" />
31
- </MSBuild>
32
-
37
+ <ItemGroup>
38
+ <_NativeProjectOutput Include="$(MergeModDirectory)x64\mergemod.dll" />
39
+ <_NativeProjectOutput Include="$(OutputPath)..\x64\wixnative.exe" />
40
+ <_NativeProjectOutput Include="$(OutputPath)..\x64\wixnative.pdb" />
41
+ </ItemGroup>
42
+
43
<WriteLinesToFile File="$(NativeFileListPath)" Lines="@(_NativeProjectOutput)" Overwrite="true" />
44
45
<ItemGroup>
@@ -60,8 +70,8 @@
70
71
<Target Name="SetNuspecProperties" AfterTargets="CoreBuild">
72
<PropertyGroup>
63
- <NuspecBasePath>$(OutputPath)</NuspecBasePath>
64
- <NuspecProperties>Configuration=$(Configuration);Id=$(MSBuildThisFileName);Version=$(BuildVersionSimple);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description)</NuspecProperties>
73
+ <NuspecBasePath>$(OutputPath)..\</NuspecBasePath>
74
+ <NuspecProperties>Id=$(MSBuildThisFileName);Version=$(BuildVersionSimple);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description);RepositoryCommit=$(SourceRevisionId);RepositoryType=$(RepositoryType);RepositoryUrl=$(PrivateRepositoryUrl);MergeModDir=$(MergeModDirectory)</NuspecProperties>
75
</PropertyGroup>
76
</Target>
77
</Project>
src/WixToolset.Core.Native/WixToolset.Core.Native.nuspec
+10
-15
@@ -5,30 +5,25 @@
5
<version>$version$</version>
6
<authors>$authors$</authors>
7
<owners>$authors$</owners>
8
- <!-- <license type="expression">MS-RL</license> -->
9
- <licenseUrl>https://licenses.nuget.org/MS-RL</licenseUrl>
8
+ <license type="expression">MS-RL</license>
9
<projectUrl>https://github.com/wixtoolset/Core.Native</projectUrl>
10
<requireLicenseAcceptance>false</requireLicenseAcceptance>
11
<description>$description$</description>
12
<copyright>$copyright$</copyright>
14
-
13
+ <repository type="$repositorytype$" url="$repositoryurl$" commit="$repositorycommit$" />
14
<dependencies>
16
- <dependency id="runtime.win.WixToolset.Core.Native" version="$version$" />
17
-<!--
18
- <dependency id="runtime.win-x86.WixToolset.Core.Native" version="$version$" />
19
- <dependency id="runtime.win-x64.WixToolset.Core.Native" version="$version$" />
20
--->
15
+ <group targetFramework=".NETStandard2.0" />
16
</dependencies>
17
</metadata>
18
19
<files>
25
- <file src="$id$.dll" target="lib\netstandard2.0" />
20
+ <file src="netstandard2.0\$id$.dll" target="lib\netstandard2.0" />
21
27
- <!--
28
- <file src="..\Win32\wixnative.x86.exe" target="lib\netstandard2.0" />
29
- <file src="..\Win32\wixnative.x86.pdb" target="lib\netstandard2.0" />
30
- <file src="..\x64\wixnative.amd64.exe" target="lib\netstandard2.0" />
31
- <file src="..\x64\wixnative.amd64.pdb" target="lib\netstandard2.0" />
32
- -->
22
+ <file src="$mergemoddir$Win32\mergemod.dll" target="runtimes\win-x86\native" />
23
+ <file src="Win32\wixnative.exe" target="runtimes\win-x86\native" />
24
+ <file src="Win32\wixnative.pdb" target="runtimes\win-x86\native" />
25
+ <file src="$mergemoddir$x64\mergemod.dll" target="runtimes\win-x64\native" />
26
+ <file src="x64\wixnative.exe" target="runtimes\win-x64\native" />
27
+ <file src="x64\wixnative.pdb" target="runtimes\win-x64\native" />
28
</files>
29
</package>
src/test/WixToolsetTest.Core.Native/WixToolsetTest.Core.Native.csproj
+3
-2
@@ -3,8 +3,9 @@
3
4
<Project Sdk="Microsoft.NET.Sdk">
5
<PropertyGroup>
6
- <TargetFramework>netcoreapp2.1</TargetFramework>
6
+ <TargetFramework>netcoreapp3.1</TargetFramework>
7
<IsPackable>false</IsPackable>
8
+ <RuntimeIdentifier>win-x64</RuntimeIdentifier>
9
</PropertyGroup>
10
11
<ItemGroup>
@@ -21,7 +22,7 @@
22
</ItemGroup>
23
24
<ItemGroup>
24
- <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
25
+ <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
26
<PackageReference Include="xunit" Version="2.4.1" />
27
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="All" />
28
</ItemGroup>
src/wixnative/runtime.win.WixToolset.Core.Native.nuspec
deleted
-24
@@ -1,24 +0,0 @@
1
-<?xml version="1.0"?>
2
-<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3
- <metadata minClientVersion="4.0">
4
- <id>$id$</id>
5
- <version>$version$</version>
6
- <authors>$authors$</authors>
7
- <owners>$authors$</owners>
8
- <!-- <license type="expression">MS-RL</license> -->
9
- <licenseUrl>https://licenses.nuget.org/MS-RL</licenseUrl>
10
- <projectUrl>https://github.com/wixtoolset/Core.Native</projectUrl>
11
- <requireLicenseAcceptance>false</requireLicenseAcceptance>
12
- <description>$description$</description>
13
- <copyright>$copyright$</copyright>
14
- </metadata>
15
-
16
- <files>
17
- <file src="Win32\mergemod.dll" target="runtimes\win-x86\native" />
18
- <file src="Win32\wixnative.exe" target="runtimes\win-x86\native" />
19
- <file src="Win32\wixnative.pdb" target="runtimes\win-x86\native" />
20
- <file src="x64\mergemod.dll" target="runtimes\win-x64\native" />
21
- <file src="x64\wixnative.exe" target="runtimes\win-x64\native" />
22
- <file src="x64\wixnative.pdb" target="runtimes\win-x64\native" />
23
- </files>
24
-</package>
src/wixnative/wixnative.vcxproj
-13
@@ -30,7 +30,6 @@
30
<TargetName>wixnative</TargetName>
31
<PlatformToolset>v141</PlatformToolset>
32
<CharacterSet>Unicode</CharacterSet>
33
- <Description>Native component of WixToolset.Core</Description>
33
</PropertyGroup>
34
35
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -69,18 +68,6 @@
68
<None Include="packages.config" />
69
</ItemGroup>
70
72
- <ItemGroup>
73
- <None Include="$(Platform)\mergemod.dll">
74
- <DeploymentContent>true</DeploymentContent>
75
- <Link>%(Filename)%(Extension)</Link>
76
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
77
- </None>
78
- </ItemGroup>
79
-
80
- <Target Name="Pack" DependsOnTargets="GetBuildVersion">
81
- <Exec Command='nuget pack runtime.win.WixToolset.Core.Native.nuspec -BasePath "$(BaseOutputPath)$(Configuration)" -OutputDirectory "$(BaseOutputPath)$(Configuration)" -NoPackageAnalysis -Properties Configuration=$(Configuration);Id=runtime.win.WixToolset.Core.Native;Version="$(BuildVersionSimple)";Platform=$(PlatformTarget);Authors="$(Authors)";Copyright="$(Copyright)";Description="$(Description)";Title="$(Title)"' />
82
- </Target>
83
-
71
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
72
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
73
<PropertyGroup>