Skip to content

Conversation

@mandel-macaque
Copy link
Contributor

@mandel-macaque mandel-macaque commented Sep 17, 2025

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.

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.
Copy link
Contributor

Copilot AI left a 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 SupportKind enum to differentiate between implicit and explicit platform support
  • Implements PlatformSupportVersion struct 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

Comment on lines +24 to +27
public static PlatformSupportVersion ImplicitDefault { get; } = new () {
Version = new (),
Kind = SupportKind.Implicit
};
Copy link

Copilot AI Sep 17, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines 32 to 35
public static PlatformSupportVersion ExplicitDefault { get; } = new () {
Version = new (),
Kind = SupportKind.Explicit
};
Copy link

Copilot AI Sep 17, 2025

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.

Copilot uses AI. Check for mistakes.
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #382ee7e] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 382ee7ed33b5408b73472582687fd2fb00786f7c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #382ee7e] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 382ee7ed33b5408b73472582687fd2fb00786f7c [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

.NET ( No breaking changes )

✅ API diff vs stable

.NET ( No breaking changes )

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 382ee7ed33b5408b73472582687fd2fb00786f7c [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #382ee7e] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 382ee7ed33b5408b73472582687fd2fb00786f7c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #382ee7e] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 382ee7ed33b5408b73472582687fd2fb00786f7c [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #382ee7e] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 382ee7ed33b5408b73472582687fd2fb00786f7c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #382ee7e] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 382ee7ed33b5408b73472582687fd2fb00786f7c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #382ee7e] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: 382ee7ed33b5408b73472582687fd2fb00786f7c [PR build]

@mandel-macaque mandel-macaque merged commit 33eab2c into main Sep 18, 2025
40 checks passed
@mandel-macaque mandel-macaque deleted the dev/mandel/implicit-explicit-support branch September 18, 2025 10:57
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.

5 participants