Skip to content
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

Should we add [assembly:Introduced (...)] to the platform assemblies ? #10793

Closed
spouliot opened this issue Mar 5, 2021 · 0 comments · Fixed by #10820
Closed

Should we add [assembly:Introduced (...)] to the platform assemblies ? #10793

spouliot opened this issue Mar 5, 2021 · 0 comments · Fixed by #10820
Assignees
Labels
enhancement The issue or pull request is an enhancement iOS Issues affecting Xamarin.iOS macOS Issues affecting Xamarin.Mac
Milestone

Comments

@spouliot
Copy link
Contributor

spouliot commented Mar 5, 2021

Right now our minimum supported OS are not defined inside the assembly metadata (but inside our tools / build scrips). However we'll need this for dotnet so it make sense to consider doing the same for legacy assemblies.

Beside the slight change to the attribute itself

diff --git a/src/ObjCRuntime/PlatformAvailability2.cs b/src/ObjCRuntime/PlatformAvailability2.cs
index 04477a67d..c5c5390a9 100644
--- a/src/ObjCRuntime/PlatformAvailability2.cs
+++ b/src/ObjCRuntime/PlatformAvailability2.cs
@@ -51,6 +51,7 @@ namespace ObjCRuntime
        }
 
        [AttributeUsage (
+               AttributeTargets.Assembly |
                AttributeTargets.Class |
                AttributeTargets.Constructor |
                AttributeTargets.Delegate |

We would need to mark API that are not available differently.

E.g. All ARKit.* types would need to mention they are not available outside iOS, otherwise the current (legacy) tooling would presume it's available in the minimum version (since the lack of attribute on the type would fallback to the assembly, which would mention something with [Watch (2,0)]).

This has indirect benefits since we often inline (for protocols) several [Introduced] attributes in members - but if we had an [Unavailable] on the type then we could (actually would) skip them.

@spouliot spouliot added enhancement The issue or pull request is an enhancement macOS Issues affecting Xamarin.Mac iOS Issues affecting Xamarin.iOS request-for-comments The issue is a suggested idea seeking feedback labels Mar 5, 2021
@spouliot spouliot added this to the Future milestone Mar 5, 2021
@spouliot spouliot self-assigned this Mar 9, 2021
@spouliot spouliot removed the request-for-comments The issue is a suggested idea seeking feedback label Mar 9, 2021
spouliot pushed a commit to spouliot/xamarin-macios that referenced this issue Mar 9, 2021
The minimum OS supported for .net assemblies are specified in
https://github.com/dotnet/core/blob/master/release-notes/6.0/6.0-supported-os.md

The minimum for legacy assemblies are unchanged. However this information
will now be present in the assemblies (and not just in documentation and
code).

This PR partially address xamarin#10659 and possibly xamarin#10728

Fix xamarin#10793
spouliot added a commit that referenced this issue Mar 10, 2021
)

The minimum OS supported for .net assemblies are specified in
https://github.com/dotnet/core/blob/master/release-notes/6.0/6.0-supported-os.md

The minimum for legacy assemblies are unchanged. However this information
will now be present in the assemblies (and not just in documentation and
code).

This PR partially address #10659 and possibly #10728

Fix #10793
@ghost ghost locked as resolved and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement The issue or pull request is an enhancement iOS Issues affecting Xamarin.iOS macOS Issues affecting Xamarin.Mac
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant