Uno.WindowsCommunityToolkit/Directory.Build.targets

34 строки
1.7 KiB
XML

<Project>
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.Common.targets" />
<PropertyGroup>
<!-- Exclude Notifications project from this since it sets different min versions than what we want for notifications -->
<UseWinUI Condition="($(TargetFramework.StartsWith('net5.0-windows10')) or '$(TargetFramework)' == 'net461') and '$(MSBuildProjectName)' != 'CommunityToolkit.WinUI.Notifications'">true</UseWinUI>
<UseWinUI Condition="'$(UseWinUI)' == ''">false</UseWinUI>
</PropertyGroup>
<Choose>
<!-- We'll include signing the Notifications library since we need the DLL signature to match for interop from class libraries to main projects -->
<When Condition="!($(TargetFramework.StartsWith('uap10.0')) or '$(TargetFramework)' == 'native' or $(IsSampleProject)) or '$(MSBuildProjectName)' == 'CommunityToolkit.WinUI.Notifications'">
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
</When>
</Choose>
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.WinUI.Build.targets" Condition="$(UseWinUI)" />
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.Workarounds.Xaml.targets" Condition="$(IsCoreProject)" />
<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(SourceRevisionId)' != ''">
<_Parameter1>CommitHash</_Parameter1>
<_Parameter2>$(SourceRevisionId)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
</Target>
</Project>