Skip to content

✨ add macos support for test projects in build configuration#64

Merged
gimlichael merged 1 commit into
mainfrom
v11.1.0/fix-mac-os-issue
Jun 5, 2026
Merged

✨ add macos support for test projects in build configuration#64
gimlichael merged 1 commit into
mainfrom
v11.1.0/fix-mac-os-issue

Conversation

@gimlichael

Copy link
Copy Markdown
Member

This pull request updates the build configuration to improve cross-platform support, specifically adding macOS detection and ensuring test projects target the correct frameworks on both Linux and macOS.

Platform detection improvements:

  • Added a new property IsMacOS to detect when the build is running on macOS using MSBuild's IsOSPlatform method.

Test project configuration:

  • Updated the condition for setting TargetFrameworks in test projects to include both Linux and macOS, so test projects now target net10.0 and net9.0 on either OS.

@gimlichael gimlichael merged commit 0972b88 into main Jun 5, 2026
1 of 5 checks passed
@gimlichael gimlichael deleted the v11.1.0/fix-mac-os-issue branch June 5, 2026 04:35
@greptile-apps

greptile-apps Bot commented Jun 5, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds macOS platform detection to Directory.Build.props and updates the test-project TargetFrameworks condition to apply on Linux or macOS, ensuring test projects correctly target net10.0;net9.0 on both platforms (omitting net48, which is Windows-only). The CI pipeline already contains a test_mac job with macos-26/macos-26-intel runners, so the build-system change completes the cross-platform picture.

  • Added <IsMacOS>$([MSBuild]::IsOSPlatform('OSX'))</IsMacOS> following the same pattern as the existing IsLinux and IsWindows properties; OSX is the correct MSBuild platform identifier for macOS.
  • Extended the TargetFrameworks condition for test projects from IsLinux == true to IsLinux == true OR IsMacOS == true, keeping it consistent with the intent that net48 is Windows-only.

Confidence Score: 5/5

Safe to merge — the change is a two-line addition to a build properties file with no runtime logic.

The IsMacOS property uses the correct OSX platform string (matching OSPlatform.OSX in the .NET runtime), and the updated condition correctly gates net10.0;net9.0 to Linux or macOS while leaving the Windows net48 path untouched. The CI pipeline already has a test_mac job ready to exercise this path. No logic errors or gaps were found.

No files require special attention.

Important Files Changed

Filename Overview
Directory.Build.props Adds IsMacOS property using IsOSPlatform('OSX') and extends the test project TargetFrameworks condition to cover Linux OR macOS; both changes are correct and consistent with existing patterns.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[MSBuild evaluates Directory.Build.props] --> B{IsTestProject?}
    B -- No --> C[Apply source / tooling / benchmark config]
    B -- Yes --> D{Platform detection}
    D --> E{IsLinux OR IsMacOS?}
    E -- Yes --> F["TargetFrameworks = net10.0;net9.0"]
    D --> G{IsWindows?}
    G -- Yes --> H["TargetFrameworks = net10.0;net9.0;net48"]
    E -- No --> I[No TargetFrameworks override from platform block]
    G -- No --> I
    F --> J[Common test project settings - IsPackable=false, RunAnalyzers=false, etc.]
    H --> J
    I --> J
Loading

Reviews (1): Last reviewed commit: "✨ add macos support for test projects in..." | Re-trigger Greptile

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.

1 participant