Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WinRT.Host and WinRT.Host.Shim to Nuget #582

Merged
merged 18 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ set cswinrt_exe=%cswinrt_bin_dir%cswinrt.exe
set netstandard2_runtime=%~dp0WinRT.Runtime\bin\%cswinrt_configuration%\netstandard2.0\WinRT.Runtime.dll
set net5_runtime=%~dp0WinRT.Runtime\bin\%cswinrt_configuration%\net5.0\WinRT.Runtime.dll
set source_generator=%~dp0Authoring\WinRT.SourceGenerator\bin\%cswinrt_configuration%\netstandard2.0\WinRT.SourceGenerator.dll
set winrt_host_%cswinrt_platform%=%~dp0_build\%cswinrt_platform%\%cswinrt_configuration%\WinRT.Host\bin\WinRT.Host.dll
set winrt_shim=%~dp0WinRT.Host.Shim\bin\%cswinrt_configuration%\net5.0\WinRT.Host.Shim.dll
echo Creating nuget package
call :exec .nuget\nuget pack nuget/Microsoft.Windows.CsWinRT.nuspec -Properties cswinrt_exe=%cswinrt_exe%;netstandard2_runtime=%netstandard2_runtime%;net5_runtime=%net5_runtime%;source_generator=%source_generator%;cswinrt_nuget_version=%cswinrt_version_string% -OutputDirectory %cswinrt_bin_dir% -NonInteractive -Verbosity Detailed -NoPackageAnalysis
call :exec .nuget\nuget pack nuget/Microsoft.Windows.CsWinRT.nuspec -Properties cswinrt_exe=%cswinrt_exe%;netstandard2_runtime=%netstandard2_runtime%;net5_runtime=%net5_runtime%;source_generator=%source_generator%;cswinrt_nuget_version=%cswinrt_version_string%;winrt_host_x86=%winrt_host_x86%;winrt_host_x64=%winrt_host_x64%;winrt_host_amd=%winrt_host_amd%;winrt_host_arm64=%winrt_host_arm64%;winrt_shim=%winrt_shim% -OutputDirectory %cswinrt_bin_dir% -NonInteractive -Verbosity Detailed -NoPackageAnalysis
j0shuams marked this conversation as resolved.
Show resolved Hide resolved
goto :eof

:exec
Expand Down
5 changes: 5 additions & 0 deletions nuget/Microsoft.Windows.CsWinRT.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,10 @@
<file src="readme.txt"/>
<file src="$net5_runtime$" target="lib\net5.0\"/>
<file src="$source_generator$" target="analyzers\dotnet\cs\"/>
<file src="$winrt_host_x64$" target ="native\x64"/>
<file src="$winrt_host_x86$" target ="native\x86"/>
<file src="$winrt_host_arm$" target ="native\arm"/>
<file src="$winrt_host_arm64$" target ="native\arm64"/>
<file src="$winrt_shim$" target ="lib\net5.0\"/>
</files>
</package>
11 changes: 7 additions & 4 deletions nuget/Microsoft.Windows.CsWinRT.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<PropertyGroup>
<CsWinRTMessageImportance Condition="'$(CsWinRTMessageImportance)' == ''">normal</CsWinRTMessageImportance>
<CsWinRTCommandVerbosity Condition="'$(CsWinRTMessageImportance)' == 'high'">-verbose</CsWinRTCommandVerbosity>
<ResolveAssemblyReferencesDependsOn Condition="'$(CsWinRTRemoveWindowsReference)'!='false'">$(ResolveAssemblyReferencesDependsOn);CsWinRTRemoveWindowsReference</ResolveAssemblyReferencesDependsOn>
<ResolveAssemblyReferencesDependsOn Condition="'$(CsWinRTRemoveReferences)'!='false'">$(ResolveAssemblyReferencesDependsOn);CsWinRTRemoveReferences</ResolveAssemblyReferencesDependsOn>
<CsWinRTEnabled Condition="'$(CsWinRTEnabled)' == ''">true</CsWinRTEnabled>
<CsWinRTEnabled Condition="'$(CsWinRTEnabled)' != 'true'">false</CsWinRTEnabled>
<CsWinRTGenerateProjection Condition="!$(CsWinRTEnabled)">false</CsWinRTGenerateProjection>
Expand All @@ -18,10 +18,13 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<CoreCompileDependsOn>CsWinRTIncludeProjection;CsWinRTRemoveWinMDReferences;$(CoreCompileDependsOn)</CoreCompileDependsOn>
</PropertyGroup>

<!--Remove Windows.Winmd reference to prevent compile collisions-->
<Target Name="CsWinRTRemoveWindowsReference" Outputs="@(Reference)" Condition="$(CsWinRTEnabled)">
<Target Name="CsWinRTRemoveReferences" Outputs="@(Reference)" >
<ItemGroup>
<Reference Remove="Windows"/>
<!-- Remove Windows.Winmd reference to prevent compile collisions-->
<Reference Condition="'$(CsWinRTEnabled)'=='true'" Remove="Windows"/>
<!-- Remove WinRT.Host.Shim.dll references -->
<Reference Remove="$(CsWinRTPath)lib\net5.0\WinRT.Host.Shim.dll"/>
<ReferencePath Remove="$(CsWinRTPath)lib\net5.0\WinRT.Host.Shim.dll"/>
</ItemGroup>
</Target>

Expand Down