-
Notifications
You must be signed in to change notification settings - Fork 554
[RGen] Add a new type to track versions. #23838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When adding a platform to a symbol it might be the case that the addition has an implication for another platform. For example, when we add support for iOS we are adding support for Catalyst. This new struct keeps track of the reason why a version was added and will allow to choose always the Explicit verison when two versions are compared. This will later can be used with the Builder class to add Implicit versions for a platform and be able to calculate which version to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new PlatformSupportVersion type to track platform support versions with associated kind information (Implicit or Explicit). The purpose is to handle cases where adding platform support has implications for other platforms (e.g., iOS support implying Catalyst support) and ensure explicit versions take precedence over implicit ones when comparing versions.
Key changes:
- Adds a new
SupportKindenum to differentiate between implicit and explicit platform support - Implements
PlatformSupportVersionstruct with version tracking and comparison logic - Provides comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/rgen/Microsoft.Macios.Generator/Availability/SupportKind.cs |
Defines enum for categorizing support as Implicit or Explicit |
src/rgen/Microsoft.Macios.Generator/Availability/PlatformSupportVersion.cs |
Core struct implementation with version tracking and comparison methods |
tests/rgen/Microsoft.Macios.Generator.Tests/Availability/PlatformSupportVersionTests.cs |
Comprehensive unit tests for the new PlatformSupportVersion functionality |
| public static PlatformSupportVersion ImplicitDefault { get; } = new () { | ||
| Version = new (), | ||
| Kind = SupportKind.Implicit | ||
| }; |
Copilot
AI
Sep 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new Version() constructor creates a version of 0.0.0.0, but this may be unclear. Consider using new Version(0, 0) to make the intent explicit and match the test expectations.
| public static PlatformSupportVersion ExplicitDefault { get; } = new () { | ||
| Version = new (), | ||
| Kind = SupportKind.Explicit | ||
| }; |
Copilot
AI
Sep 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new Version() constructor creates a version of 0.0.0.0, but this may be unclear. Consider using new Version(0, 0) to make the intent explicit and match the test expectations.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #382ee7e] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #382ee7e] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commit.NET ( No breaking changes )✅ API diff vs stable.NET ( No breaking changes )ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #382ee7e] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #382ee7e] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [CI Build #382ee7e] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #382ee7e] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #382ee7e] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
When adding a platform to a symbol it might be the case that the addition has an implication for another platform. For example, when we add support for iOS we are adding support for Catalyst. This new struct keeps track of the reason why a version was added and will allow to choose always the Explicit version when two versions are compared.
This will later can be used with the Builder class to add Implicit versions for a platform and be able to calculate which version to use.