Add SDKReference-sourced WinMDs when building (#679)

This commit is contained in:
Jon Wiswall 2020-07-03 16:24:24 -07:00 коммит произвёл GitHub
Родитель 61a55bc774
Коммит 3689d85882
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 15 добавлений и 3 удалений

Просмотреть файл

@ -10,4 +10,4 @@ call msbuild /m /p:Configuration=Release,Platform=arm64,CppWinRTBuildVersion=%ta
call msbuild /m /p:Configuration=Release,Platform=x86,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:cppwinrt
nuget pack nuget\Microsoft.Windows.CppWinRT.nuspec -Properties cppwinrt_exe=%cd%\_build\x86\Release\cppwinrt.exe;cppwinrt_fast_fwd_x86=%cd%\_build\x86\Release\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_x64=%cd%\_build\x64\Release\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_arm=%cd%\_build\arm\Release\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_arm64=%cd%\_build\arm64\Release\cppwinrt_fast_forwarder.lib
nuget pack nuget\Microsoft.Windows.CppWinRT.nuspec -Properties target_version=%target_version%;cppwinrt_exe=%cd%\_build\x86\Release\cppwinrt.exe;cppwinrt_fast_fwd_x86=%cd%\_build\x86\Release\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_x64=%cd%\_build\x64\Release\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_arm=%cd%\_build\arm\Release\cppwinrt_fast_forwarder.lib;cppwinrt_fast_fwd_arm64=%cd%\_build\arm64\Release\cppwinrt_fast_forwarder.lib

Просмотреть файл

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>Microsoft.Windows.CppWinRT</id>
<version>1.0.0.0</version>
<version>$target_version$</version>
<title>C++/WinRT Build Support</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>

Просмотреть файл

@ -248,11 +248,12 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<!--Get direct WinMD references (including Nuget packages) for projections, IDL processing, and AppX packaging-->
<Target Name="GetCppWinRTDirectWinMDReferences"
DependsOnTargets="ResolveAssemblyReferences;$(GetCppWinRTDirectWinMDReferencesDependsOn)"
DependsOnTargets="ExpandSDKReferences;ResolveAssemblyReferences;$(GetCppWinRTDirectWinMDReferencesDependsOn)"
Returns="@(CppWinRTDirectWinMDReferences)">
<ItemGroup>
<_CppWinRTDirectWinMDReferences Remove="@(_CppWinRTDirectWinMDReferences)" />
<_CppWinRTDirectWinMDReferences Include="@(ReferencePath)" Condition="'%(ReferencePath.IsSystemReference)' != 'true' and '%(ReferencePath.WinMDFile)' == 'true' and '%(ReferencePath.ReferenceSourceTarget)' == 'ResolveAssemblyReference'" />
<_CppWinRTDirectWinMDReferences Include="@(ReferencePath)" Condition="'%(ReferencePath.WinMDFile)' == 'true' and '%(ReferencePath.ReferenceSourceTarget)' == 'ExpandSDKReference'" />
<CppWinRTDirectWinMDReferences Remove="@(CppWinRTDirectWinMDReferences)"/>
<CppWinRTDirectWinMDReferences Include="@(_CppWinRTDirectWinMDReferences)">
<WinMDPath>%(FullPath)</WinMDPath>

Просмотреть файл

@ -94,3 +94,14 @@ Example:
For more complex analysis of build errors, the [MSBuild Binary and Structured Log Viewer](http://msbuildlog.com/) is highly recommended.
## Building, Testing
Be sure to get the latest nuget.exe from [nuget.org](https://www.nuget.org/downloads) and place it in your path.
Build the package by running [build_nuget.cmd](../build_nuget.cmd) from a developer environment command line. For testing pass a version number that is much higher than your currently installed, like:
```
c:\repos\cppwinrt> .\build_nuget.cmd 5.0.0.0
```
Add the cppwinrt repo directory as a nuget source location and update your projects' references to point at it, update project references, then rebuild a test/sample project.