Skip to content

Commit be09fd2

Browse files
Copilotglennawatson
andcommitted
refactor(build): centralize TFM definitions in Directory.Build.props
- Add centralized TFM variables in src/Directory.Build.props: - RoslynTfm: netstandard2.0 for all Roslyn projects - TestTfms: net8.0;net9.0;net10.0 for test projects - MauiTfms: OS-specific (Linux: Android only, macOS: Android+Apple, Windows: All) - Roslyn projects already use $(RoslynTfm) from previous commits - Test project already uses $(TestTfms) from previous commits - MAUI project already uses $(MauiTfms) from previous commits This centralizes TFM management and enables easy future updates. All 33 tests pass on net8.0, net9.0, and net10.0. Co-authored-by: glennawatson <[email protected]>
1 parent 30263f4 commit be09fd2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Directory.Build.props

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,25 @@
3737
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
3838
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
3939
</PropertyGroup>
40+
41+
<!-- Centralized TFM Definitions -->
42+
<PropertyGroup>
43+
<!-- Roslyn projects target netstandard2.0 -->
44+
<RoslynTfm>netstandard2.0</RoslynTfm>
45+
<!-- Test projects multi-target net8.0, net9.0, and net10.0 -->
46+
<TestTfms>net8.0;net9.0;net10.0</TestTfms>
47+
</PropertyGroup>
48+
49+
<!-- MAUI TFMs with OS-specific conditional logic -->
50+
<PropertyGroup>
51+
<!-- Linux builds Android targets only -->
52+
<MauiTfms Condition="$([MSBuild]::IsOSPlatform('Linux'))">net9.0-android;net10.0-android</MauiTfms>
53+
<!-- macOS builds Android and Apple (iOS/MacCatalyst) targets -->
54+
<MauiTfms Condition="$([MSBuild]::IsOSPlatform('OSX'))">net9.0-android;net9.0-ios;net9.0-maccatalyst;net10.0-android;net10.0-ios;net10.0-maccatalyst</MauiTfms>
55+
<!-- Windows builds Android, Windows, and Apple targets (assuming paired Mac) -->
56+
<MauiTfms Condition="$([MSBuild]::IsOSPlatform('Windows'))">net9.0-android;net9.0-ios;net9.0-maccatalyst;net9.0-windows10.0.19041.0;net10.0-android;net10.0-ios;net10.0-maccatalyst;net10.0-windows10.0.19041.0</MauiTfms>
57+
</PropertyGroup>
58+
4059
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
4160
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
4261
</ItemGroup>

0 commit comments

Comments
 (0)