forked from CommunityToolkit/WindowsCommunityToolkit
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Directory.Build.props
153 lines (125 loc) · 7.21 KB
/
Directory.Build.props
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<Project>
<PropertyGroup>
<RepositoryDirectory>$(MSBuildThisFileDirectory)</RepositoryDirectory>
<BuildToolsDirectory>$(RepositoryDirectory)build\</BuildToolsDirectory>
</PropertyGroup>
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.Common.props" />
<PropertyGroup>
<!-- Remove after https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3285 is merged, as this is already in our .editorconfig -->
<NoWarn>$(NoWarn);SA1101;SA1633;SA1202;SA1600;SA1413;SA1611;SA1629;SA1201;SA1309;SA1310;SA1602</NoWarn>
<!-- TODO: WinUI3 - Need to fix -->
<NoWarn>$(NoWarn);CA1033;CA1065;CA1001;CS0252;CS8073;CA1063;CA2213;CA2214;CS8600;CS8604</NoWarn>
<!-- TODO: WinUI3 - Remove when XAMLBehaviors is strong signed -->
<NoWarn>$(NoWarn);CS8002</NoWarn>
</PropertyGroup>
<Choose>
<When Condition="$(IsCoreProject)">
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageOutputPath>$(RepositoryDirectory)bin\nupkg</PackageOutputPath>
<GenerateLibraryLayout Condition="$(IsWinUIProject)">true</GenerateLibraryLayout>
<!-- Turned off until 16.11 (https://github.com/dotnet/msbuild/pull/6676) -->
<!--<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>-->
<!-- Enable XAML trimming capability to remove code for Uno targets -->
<UnoXamlResourcesTrimming>true</UnoXamlResourcesTrimming>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<NoWarn>$(NoWarn);CS8002;SA0001</NoWarn>
</PropertyGroup>
</Otherwise>
</Choose>
<Choose>
<When Condition="$(IsWinUIProject)">
<PropertyGroup>
<!-- Code CS8002 is a warning for strong named -> non-strong-named reference. This is valid for platforms other than .NET Framework (and is needed for the UWP targets. -->
<NoWarn>$(NoWarn);CS8002</NoWarn>
<!-- For including default @(Page) and @(Resource) items via 'MSBuild.Sdk.Extras' Sdk package. Also provides up to date check and file nesting -->
<ExtrasEnableDefaultXamlItems>true</ExtrasEnableDefaultXamlItems>
</PropertyGroup>
</When>
</Choose>
<Choose>
<When Condition="!$(IsDesignProject)">
<!--
Debug builds have this turned on by default, but it breaks our Xaml Islands Scenarios.
ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that.
-->
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<EnableXBindDiagnostics>false</EnableXBindDiagnostics>
<EnableTypeInfoReflection>false</EnableTypeInfoReflection>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
</ItemGroup>
</When>
</Choose>
<Import Project="$(BuildToolsDirectory)Windows.Toolkit.VisualStudio.Design.props" Condition="$(IsDesignProject)" />
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="All" />
</ItemGroup>
<Choose>
<When Condition="!$(IsSampleProject) and '$(SourceLinkEnabled)' != 'false'">
<PropertyGroup>
<!-- Declare that the Repository URL can be published to NuSpec -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Embed source files that are not tracked by the source control manager to the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Include PDB in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
</When>
</Choose>
<ItemGroup Condition="!$([MSBuild]::IsOsUnixLike()) and '$(BuildingInsideVisualStudio)'=='' ">
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" />
</ItemGroup>
<!-- BEGIN Uno Specific -->
<PropertyGroup>
<TargetFrameworksOverride>net8.0;net8.0-ios;net8.0-macos;net8.0-android;net8.0-maccatalyst</TargetFrameworksOverride>
<_IsUno>true</_IsUno>
<NoWarn>$(NoWarn);SA1633</NoWarn>
<UnoEnableXamlFuzzyMatching>false</UnoEnableXamlFuzzyMatching>
<!--
WinUI is not supported for this build, users must reference
the official toolkit packages instead.
-->
<TargetFrameworksOverride Condition="'$(BUILD_REPOSITORY_PROVIDER)'==''">$(TargetFrameworksOverride);net5.0-windows10.0.18362.0</TargetFrameworksOverride>
<!--<TargetFrameworksOverride>netstandard2.0</TargetFrameworksOverride>-->
</PropertyGroup>
<PropertyGroup Condition=" '$(_IsUno)'=='true' ">
<NoWarn>$(NoWarn);CS0649;CS0067;CS1998</NoWarn>
</PropertyGroup>
<PropertyGroup>
<!--https://github.com/xamarin/AndroidSupportComponents/issues/176-->
<XamarinAndroidSupportSkipVerifyVersions>true</XamarinAndroidSupportSkipVerifyVersions>
<!-- Workaround for android build using the Uno Source Generators: https://github.com/nventive/Uno.SourceGeneration/issues/109 -->
<JavaSdkDirectory Condition="'$(JavaSdkDirectory)'=='' and '$(JAVA_HOME_8_X64)'!=''">$(JAVA_HOME_8_X64)</JavaSdkDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(_IsUno)'=='true' ">
<ExtrasEnableDefaultPageItems>false</ExtrasEnableDefaultPageItems>
</PropertyGroup>
<PropertyGroup>
<EnableDefaultPageItems>false</EnableDefaultPageItems>
</PropertyGroup>
<ItemGroup Condition=" '$(_IsUno)'=='true' ">
<None Remove="$(MSBuildProjectDirectory)\**\*.xaml"/>
<Page Include="$(MSBuildProjectDirectory)\**\*.xaml" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder);$(ExtrasDefaultPageExcludes)"
XamlRuntime="WinUI" />
<UpToDateCheckInput Include="@(Page)"/>
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.ToLower().StartsWith('xamarinmac')) and '$(Configuration)' == 'Release'">
<Reference Include="Xamarin.Mac">
<HintPath Condition="Exists('C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Xamarin.VisualStudio')">C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Xamarin.VisualStudio\Xamarin.Mac.dll</HintPath>
<HintPath Condition="Exists('C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\Xamarin.VisualStudio')">C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\Xamarin.VisualStudio\Xamarin.Mac.dll</HintPath>
<HintPath Condition="Exists('C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Xamarin.VisualStudio')">C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Xamarin.VisualStudio\Xamarin.Mac.dll</HintPath>
<HintPath Condition="Exists('C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\Extensions\Xamarin.VisualStudio')">C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\Extensions\Xamarin.VisualStudio\Xamarin.Mac.dll</HintPath>
</Reference>
</ItemGroup>
<!-- END Uno Specific -->
</Project>