Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: Centralize TFM definitions in Directory.Build.props with platform-specific handling#103

Merged
glennawatson merged 2 commits intomainfrom
copilot/update-target-frameworks-setup
Nov 13, 2025
Merged

chore: Centralize TFM definitions in Directory.Build.props with platform-specific handling#103
glennawatson merged 2 commits intomainfrom
copilot/update-target-frameworks-setup

Conversation

Copy link
Contributor

Copilot AI commented Nov 13, 2025

Moves Target Framework Moniker (TFM) definitions from individual .csproj files to Directory.Build.props for centralized management and platform-specific builds, aligning with ReactiveUI project standards.

Changes

  • Directory.Build.props: Added TFM property definitions

    • NetCoreTargetFrameworks: netstandard2.0;net8.0;net9.0;net10.0 (cross-platform)
    • NetFrameworkTargetFrameworks: net462;net472 (Windows only via $([MSBuild]::IsOsPlatform('Windows')))
    • LibraryTargetFrameworks: Combines both for library projects
    • TestTargetFrameworks: Core TFMs + Framework TFMs, excludes netstandard
  • ReactiveUI.Extensions.csproj: Changed <TargetFrameworks> from hardcoded to $(LibraryTargetFrameworks)

  • ReactiveUI.Extensions.Tests.csproj: Changed <TargetFrameworks> from hardcoded to $(TestTargetFrameworks)

Behavior

Linux/macOS builds:

  • Library: netstandard2.0;net8.0;net9.0;net10.0
  • Tests: net8.0;net9.0;net10.0

Windows builds:

  • Library: netstandard2.0;net8.0;net9.0;net10.0;net462;net472
  • Tests: net8.0;net9.0;net10.0;net462;net472

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • aka.ms
    • Triggering command: curl -I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Below is a example of what we did to the ReactiveUI.Avalonia project that we want to do to Extensions project.

We want to put some named TFMs in the Directory.Build.props file, then rely on those for the two projects.

so our target for the libbrari will be netstandard2.0;net462/net472;net8.0;net9.0;net10.0 and for testing it'll be net8.0/net9.0/net10.0/net462/net472 (no netstandard) exclusively. the net framework TFMs are new, yes likely covered by netstandard but doesn't hurt.

separate out the variables for the framework tfms and only compile those on windows platforms

the combine into the final TFMs for the project and testing targets by combining together the propertygroup items together based on the build environment.

Yes this is a bit of a simpler project but it brings it in line with rxui projects in general.

Description:

Currently, the ReactiveUI.Avalonia project hardcodes the Target Frameworks (TFMs) in its .csproj file. We want to refactor this to use the same pattern as splat and ReactiveUI, where TFMs are defined in the Directory.Build.props file for better consistency and easier maintenance across the repositories.

Instructions:

  1. Update src/Directory.Build.props:
    In reactiveui/reactiveui.avalonia/ReactiveUI.Avalonia-Add.NET10.0SupportAndMinorAPIImprovements/src/Directory.Build.props, replace the existing <BaseTargetFrameworks> property with a more specific one for Avalonia. This will allow us to manage the TFMs for all projects in this repository from a single location.

    Replace this:

    <BaseTargetFrameworks>netstandard2.0;net8.0;net9.0</BaseTargetFrameworks>

    With this:

    <AvaloniaTargetFrameworks>netstandard2.0;net8.0;net9.0;net10.0</AvaloniaTargetFrameworks>
  2. Update src/ReactiveUI.Avalonia/ReactiveUI.Avalonia.csproj:
    In reactiveui/reactiveui.avalonia/ReactiveUI.Avalonia-Add.NET10.0SupportAndMinorAPIImprovements/src/ReactiveUI.Avalonia/ReactiveUI.Avalonia.csproj, modify the <TargetFrameworks> element to reference the new property defined in Directory.Build.props.

    Replace this:

    <TargetFrameworks>netstandard2.0;net8.0;net9.0;net10.0</TargetFrameworks>

    With this:

    <TargetFrameworks>$(AvaloniaTargetFrameworks)</TargetFrameworks>

By making these changes, we will have a more consistent and maintainable build process that aligns with the standards set in our other repositories.

Test projects CANNOT have netstandard, so have a separate target in the directory.build.props file for tests, eg just net8/9/10


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Refactor TFMs setup in Directory.Build.props Centralize TFM definitions in Directory.Build.props with platform-specific handling Nov 13, 2025
Copilot AI requested a review from glennawatson November 13, 2025 05:53
@glennawatson glennawatson changed the title Centralize TFM definitions in Directory.Build.props with platform-specific handling chore: Centralize TFM definitions in Directory.Build.props with platform-specific handling Nov 13, 2025
@glennawatson glennawatson marked this pull request as ready for review November 13, 2025 05:54
@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.33%. Comparing base (e2490c0) to head (014d3d0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #103   +/-   ##
=======================================
  Coverage   80.33%   80.33%           
=======================================
  Files           8        8           
  Lines         651      651           
  Branches       64       64           
=======================================
  Hits          523      523           
  Misses        104      104           
  Partials       24       24           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@glennawatson glennawatson merged commit 1cfd70a into main Nov 13, 2025
10 checks passed
@glennawatson glennawatson deleted the copilot/update-target-frameworks-setup branch November 13, 2025 05:57
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants