Skip to content

build: cross-platform targeting for non-Windows builds + pinned Android platform versions#1582

Merged
glennawatson merged 2 commits into
mainfrom
glennawatson/enable-netfx-targeting-non-windows
May 23, 2026
Merged

build: cross-platform targeting for non-Windows builds + pinned Android platform versions#1582
glennawatson merged 2 commits into
mainfrom
glennawatson/enable-netfx-targeting-non-windows

Conversation

@glennawatson
Copy link
Copy Markdown
Contributor

What

Two build/targeting fixes so the full Splat target matrix restores and reference-compiles on non-Windows machines.

1. Compile .NET Framework and Windows targets on non-Windows

  • Set EnableWindowsTargeting=true so the WPF/WinForms/.NET Framework reference packs restore on any OS.
  • Removed the IsOsPlatform('Windows') guards around the legacy (net462/net472/net481) and Windows desktop TFMs, and around UseWPF/UseWindowsForms in Splat.Drawing, so those desktop TFMs reference-compile on Linux/macOS as well as Windows.
  • Apple TFMs stay gated to Windows or macOS (they can't reference-compile on Linux).

2. Pin Android target platform versions

  • net9.0-android/net10.0-android were bare (no platform version). When Splat.Drawing is consumed via a cross-repo ProjectReference, the platform version is not resolved during restore, producing NU1012 ("Platform version is not present for one or more target frameworks"). Pinned to net9.0-android35.0;net10.0-android36.0.
  • Updated Splat.Drawing's Android <ItemGroup> condition from EndsWith('0-android') (which no longer matches the versioned TFM) to the version-agnostic $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android', so the Android PlatformBitmapLoader is still compiled in.

Why

ReactiveUI temporarily project-references the local Splat / Splat.Drawing while the dead System.Reactive dependency is removed. These changes let that full target matrix build on non-Windows CI and dev machines.

Make the full target set buildable on Linux/macOS, not just Windows:

- Set EnableWindowsTargeting=true and drop the Windows-only gate on the
  net462/net472/net481 legacy targets so they are always part of the build.
- Always include the net8/9/10 -windows TFMs in the UI projects' target set.
- Drop the IsOsPlatform('Windows') gate on Splat.Drawing's UseWPF/UseWindowsForms
  (and its redundant local EnableWindowsTargeting) so the WPF/WinForms reference
  packs are restored and the desktop TFMs reference-compile everywhere.
- Apple TFMs remain gated to Windows/macOS (they cannot build on Linux).

Verified on Linux: core + Splat.Drawing build across net8.0/net9.0/net10.0/
net462/net472/net481 and the -windows TFMs; full test suite passes (12825 passed, 0 failed).
Android TFMs were bare (`net9.0-android`/`net10.0-android`) with no platform
version. When Splat.Drawing is consumed via a cross-repo ProjectReference the
platform version is not resolved during restore, producing NU1012 ("Platform
version is not present for one or more target frameworks").

- Pin the versions: `net9.0-android35.0;net10.0-android36.0`.
- Update Splat.Drawing's Android `<ItemGroup>` condition from
  `EndsWith('0-android')` (which no longer matches the versioned TFM) to the
  version-agnostic `GetTargetPlatformIdentifier(...) == 'android'`, so the
  Android `PlatformBitmapLoader` is still compiled in.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.40%. Comparing base (0d1f6d8) to head (1f9f319).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1582      +/-   ##
==========================================
- Coverage   79.47%   79.40%   -0.07%     
==========================================
  Files         116      116              
  Lines        7168     7168              
  Branches     1143     1143              
==========================================
- Hits         5697     5692       -5     
- Misses       1162     1165       +3     
- Partials      309      311       +2     

☔ 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 fe4c43e into main May 23, 2026
5 of 6 checks passed
@glennawatson glennawatson deleted the glennawatson/enable-netfx-targeting-non-windows branch May 23, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants