forked from CommunityToolkit/WindowsCommunityToolkit
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Directory.Build.targets
44 lines (35 loc) · 1.94 KB
/
Directory.Build.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<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>
<!-- BEGIN Uno Specific -->
<ItemGroup Condition="'$(UnoUIVersionOverride)'!=''">
<!-- Force all projects to use the same uno version to avoid net5 build issues on linux -->
<PackageReference
Update="Uno.WinUI"
Version="5.0.19" />
</ItemGroup>
<!-- END Uno Specific -->
</Project>