forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
122 lines (110 loc) · 5.93 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
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
<Project>
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<ItemGroup>
<!-- Upgrade xunit's transitive NETStandard.Library dependency to avoid .NET Standard 1.x dependencies. -->
<!-- <PackageReference Include="NETStandard.Library"
IsImplicitlyDefined="false"
PrivateAssets="all"
ExcludeAssets="runtime"
VersionOverride="2.0.3"
Condition="'$(TargetFrameworkIdentifier)' != '.NETStandard' and
$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netstandard2.0'))" /> -->
</ItemGroup>
<Import Condition="'$(SampleProject)' != 'true'" Project="eng\Versions.targets" />
<Import Condition="'$(SampleProject)' != 'true' and '$(IsTestProject)' != 'true'" Project="eng\BannedApis.targets" />
<Import Project="eng\AndroidX.targets" />
<Import Project="eng\NuGetVersions.targets" />
<PropertyGroup>
<!-- Allows for MAUI Xaml Hot Reload Samples to run without checks -->
<IgnoreMauiXamlHotReloadCompatibilityCheck>True</IgnoreMauiXamlHotReloadCompatibilityCheck>
</PropertyGroup>
<!-- platform version number information -->
<PropertyGroup Condition="'$(_MauiTargetPlatformIsiOS)' == 'True'">
<SupportedOSPlatformVersion>11.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion>11.0</TargetPlatformMinVersion>
<!-- Workaround: https://github.com/dotnet/roslyn-analyzers/issues/6158 -->
<NoWarn>$(NoWarn);CA1416</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(_MauiTargetPlatformIstvOS)' == 'True'">
<SupportedOSPlatformVersion>10.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion>10.0</TargetPlatformMinVersion>
<!-- Workaround: https://github.com/dotnet/roslyn-analyzers/issues/6158 -->
<NoWarn>$(NoWarn);CA1416</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(_MauiTargetPlatformIsMacCatalyst)' == 'True'">
<SupportedOSPlatformVersion>13.1</SupportedOSPlatformVersion>
<TargetPlatformMinVersion>13.1</TargetPlatformMinVersion>
<!-- Workaround: https://github.com/dotnet/roslyn-analyzers/issues/6158 -->
<NoWarn>$(NoWarn);CA1416</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(_MauiTargetPlatformIsmacOS)' == 'True'">
<SupportedOSPlatformVersion>10.14</SupportedOSPlatformVersion>
<TargetPlatformMinVersion>10.14</TargetPlatformMinVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(_MauiTargetPlatformIsAndroid)' == 'True'">
<SupportedOSPlatformVersion>21.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion>21.0</TargetPlatformMinVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(_MauiTargetPlatformIsTizen)' == 'True'">
<SupportedOSPlatformVersion>6.5</SupportedOSPlatformVersion>
<TargetPlatformMinVersion>6.5</TargetPlatformMinVersion>
</PropertyGroup>
<!--
NOTE: The Contains('-windows10') is a bit of a hack
because we don't want to set these properties for WPF projects...
There's probably a better way we should find to infer this
-->
<PropertyGroup Condition="'$(_MauiTargetPlatformIsWindows)' == 'True' AND $(TargetFramework.Contains('-windows10'))">
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>
<!--
Disable generation of obj/Debug/net8.0-android/__Microsoft.Android.Resource.Designer.cs
Enable this individually in projects that declare/use AndroidResource IDs.
-->
<PropertyGroup Condition="'$(_MauiTargetPlatformIsAndroid)' == 'True' AND '$(AndroidApplication)' != 'true' AND '$(MauiGenerateResourceDesigner)' != 'true'">
<AndroidGenerateResourceDesigner>false</AndroidGenerateResourceDesigner>
<AndroidUseIntermediateDesignerFile Condition="$(TargetFramework.StartsWith('$(_MauiPreviousDotNetTfm)'))">false</AndroidUseIntermediateDesignerFile>
</PropertyGroup>
<!-- semi HACK: by default, WinUI includes all @(None) with .bmp/.png as @(Content) and adds that to the .pri -->
<ItemGroup Condition="'$(_MauiTargetPlatformIsWindows)' == 'True'">
<Content Remove="@(None->WithMetadataValue('Pack','true'))" />
</ItemGroup>
<!-- Until we get a new enough dotnet -->
<ItemGroup Condition="'$(_MauiTargetPlatformIsWindows)' == 'True'">
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.19041.31" TargetingPackVersion="10.0.19041.31" />
</ItemGroup>
<!--
Workaround for https://github.com/microsoft/WindowsAppSDK/issues/2684
-->
<Import Project="src\Core\src\nuget\buildTransitive\WinUI.targets" Condition=" '$(WindowsPackageType)' == 'None' and '$(_MauiTargetPlatformIsWindows)' == 'True' " />
<!-- NuGet package information -->
<PropertyGroup Condition="'$(IsPackable)' == 'true'">
<PackageTags Condition="'$(PackageTags)' == ''">$(DefaultPackageTags)</PackageTags>
<GenerateNuspecDependsOn>
_MauiPackReadmeFile;
$(GenerateNuspecDependsOn);
</GenerateNuspecDependsOn>
</PropertyGroup>
<ItemGroup Condition="'$(IsPackable)' == 'true'">
<None Include="$(LicenseFile)"
PackagePath="$([System.IO.Path]::GetFileName('$(LicenseFile)'))"
Pack="true" />
<None Include="$(PackageThirdPartyNoticesFile)"
PackagePath="$([System.IO.Path]::GetFileName('$(PackageThirdPartyNoticesFile)'))"
Pack="true" />
</ItemGroup>
<Target Name="_MauiPackReadmeFile" Condition="'$(IsPackable)' == 'true' and '$(PackageReadmeFile)' == ''">
<PropertyGroup>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<WriteLinesToFile File="$(IntermediateOutputPath)\$(PackageReadmeFile)"
Lines="$(Description)"
Overwrite="true" />
<ItemGroup>
<_PackageFiles Include="$(IntermediateOutputPath)\$(PackageReadmeFile)"
PackagePath="$(PackageReadmeFile)"
Pack="true" />
</ItemGroup>
</Target>
</Project>