Skip to content

Commit 8b41234

Browse files
committed
Switched central build to use choose instead of condition checks
1 parent 20c643e commit 8b41234

1 file changed

Lines changed: 28 additions & 22 deletions

File tree

src/Directory.Build.props

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,36 @@
44
<Nullable>enable</Nullable>
55
</PropertyGroup>
66

7-
<PropertyGroup Condition="'$(UseMaui)' == 'true'">
8-
<!-- <TargetFrameworks>net8.0-maccatalyst</TargetFrameworks> -->
9-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
10-
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
11-
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
7+
<Choose>
8+
<When Condition="'$(UseMaui)' == 'true'">
9+
<PropertyGroup>
10+
<!-- <TargetFrameworks>net8.0-maccatalyst</TargetFrameworks> -->
11+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
12+
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
13+
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
1214

13-
<!-- Note for MacCatalyst:
14-
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
15-
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
16-
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
17-
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
18-
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
19-
20-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
21-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
22-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
23-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.19041.0</SupportedOSPlatformVersion>
24-
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.19041.0</TargetPlatformMinVersion>
25-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
26-
</PropertyGroup>
15+
<!-- Note for MacCatalyst:
16+
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
17+
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
18+
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
19+
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
20+
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
2721

28-
<PropertyGroup Condition="!Exists('$(UseMaui)')">
29-
<TargetFramework>net9.0-windows10.0.19041.0</TargetFramework>
30-
</PropertyGroup>
22+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
23+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
24+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
25+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.19041.0</SupportedOSPlatformVersion>
26+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.19041.0</TargetPlatformMinVersion>
27+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
28+
</PropertyGroup>
29+
</When>
30+
31+
<Otherwise>
32+
<PropertyGroup>
33+
<TargetFramework>net9.0-windows10.0.19041.0</TargetFramework>
34+
</PropertyGroup>
35+
</Otherwise>
36+
</Choose>
3137

3238
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
3339
<PackageReference Include="Microsoft.NET.Test.Sdk" />

0 commit comments

Comments
 (0)