From 752fc93dba6280b8580d4b1a3453fe0ce70668fe Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 24 Apr 2025 12:56:14 +0200 Subject: [PATCH 1/2] [SpriteKit] Fix all availability attributes in this framework. * Add/adjust availability attributes. * Remove !.NET availability attributes / code. This is a step towards fixing https://github.com/dotnet/macios/issues/21185. --- runtime/bindings-generator.cs | 13 + src/SpriteKit/SKAction.cs | 11 - src/SpriteKit/SKNode.cs | 6 - src/SpriteKit/SKShapeNode.cs | 9 - src/SpriteKit/SKUniform.cs | 293 ------------------ src/SpriteKit/SKWarpGeometryGrid.cs | 7 +- src/frameworks.sources | 1 - src/spritekit.cs | 76 +---- .../ApiAvailabilityTest.KnownFailures.cs | 6 - tests/cecil-tests/ApiAvailabilityTest.cs | 2 +- .../ConstructorTest.KnownFailures.cs | 3 - .../Documentation.KnownFailures.txt | 3 - 12 files changed, 21 insertions(+), 409 deletions(-) delete mode 100644 src/SpriteKit/SKUniform.cs diff --git a/runtime/bindings-generator.cs b/runtime/bindings-generator.cs index d39538a0d8a7..99d5aa78b1ca 100644 --- a/runtime/bindings-generator.cs +++ b/runtime/bindings-generator.cs @@ -1151,6 +1151,19 @@ static IEnumerable GetFunctionData () } ); + data.Add ( + new FunctionData { + Comment = " // NativeHandle func (NativeHandleType, Vector2)", + Prefix = "simd__", + Variants = Variants.msgSend | Variants.msgSendSuper, + ReturnType = Types.NativeHandle, + Parameters = new ParameterData [] { + new ParameterData { TypeData = Types.NativeHandle }, + new ParameterData { TypeData = Types.Vector2 }, + }, + } + ); + data.Add ( new FunctionData { Comment = " // IntPtr func (IntPtr, Vector2, Vector2); @try", diff --git a/src/SpriteKit/SKAction.cs b/src/SpriteKit/SKAction.cs index 382ed3962a2b..c09179ff459a 100644 --- a/src/SpriteKit/SKAction.cs +++ b/src/SpriteKit/SKAction.cs @@ -14,12 +14,6 @@ #nullable enable namespace SpriteKit { - -#if !NET - [Obsolete ("Use 'SKActionTimingFunction2' instead.")] - public delegate void SKActionTimingFunction (float /* float, not CGFloat */ time); -#endif - public partial class SKAction { /// To be added. @@ -31,10 +25,5 @@ public static SKAction ResizeTo (CGSize size, double duration) { return SKAction.ResizeTo (size.Width, size.Height, duration); } - -#if !NET - [Obsolete ("Use 'TimingFunction2' instead.")] - public virtual SKActionTimingFunction? TimingFunction { get; set; } -#endif } } diff --git a/src/SpriteKit/SKNode.cs b/src/SpriteKit/SKNode.cs index 530f40e18486..9c5070f0f78d 100644 --- a/src/SpriteKit/SKNode.cs +++ b/src/SpriteKit/SKNode.cs @@ -19,7 +19,6 @@ namespace SpriteKit { public partial class SKNode : IEnumerable, IEnumerable { -#if NET /// To be added. /// /// @@ -33,7 +32,6 @@ public partial class SKNode : IEnumerable, IEnumerable { [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] -#endif public static T? FromFile (string file) where T : SKNode { var fileHandle = CFString.CreateNative (file); @@ -81,7 +79,6 @@ IEnumerator IEnumerable.GetEnumerator () return GetEnumerator (); } -#if NET /// To be added. /// To be added. /// To be added. @@ -92,7 +89,6 @@ IEnumerator IEnumerable.GetEnumerator () [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] -#endif public static SKNode? Create (string filename, Type [] types, out NSError error) { // Let's fail early. @@ -112,7 +108,6 @@ IEnumerator IEnumerable.GetEnumerator () } } -#if NET /// To be added. /// To be added. /// To be added. @@ -123,7 +118,6 @@ IEnumerator IEnumerable.GetEnumerator () [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] -#endif public static SKNode? Create (string filename, NSSet classes, out NSError error) { // `filename` will be checked by `Create` later diff --git a/src/SpriteKit/SKShapeNode.cs b/src/SpriteKit/SKShapeNode.cs index d6dc552ce83a..66e7db69e008 100644 --- a/src/SpriteKit/SKShapeNode.cs +++ b/src/SpriteKit/SKShapeNode.cs @@ -15,8 +15,6 @@ namespace SpriteKit { public partial class SKShapeNode : SKNode { - -#if NET /// To be added. /// Creates a new shape node from the specified . /// To be added. @@ -25,7 +23,6 @@ public partial class SKShapeNode : SKNode { [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] -#endif public static SKShapeNode FromPoints (CGPoint [] points) { if (points is null) @@ -34,7 +31,6 @@ public static SKShapeNode FromPoints (CGPoint [] points) return FromPoints (ref points [0], (nuint) points.Length); } -#if NET /// To be added. /// To be added. /// To be added. @@ -45,7 +41,6 @@ public static SKShapeNode FromPoints (CGPoint [] points) [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] -#endif public static SKShapeNode FromPoints (CGPoint [] points, int offset, int length) { if (points is null) @@ -56,7 +51,6 @@ public static SKShapeNode FromPoints (CGPoint [] points, int offset, int length) return FromPoints (ref points [offset], (nuint) length); } -#if NET /// To be added. /// Creates a new shape node from the specified spline . /// To be added. @@ -65,7 +59,6 @@ public static SKShapeNode FromPoints (CGPoint [] points, int offset, int length) [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] -#endif public static SKShapeNode FromSplinePoints (CGPoint [] points) { if (points is null) @@ -74,7 +67,6 @@ public static SKShapeNode FromSplinePoints (CGPoint [] points) return FromSplinePoints (ref points [0], (nuint) points.Length); } -#if NET /// To be added. /// To be added. /// To be added. @@ -85,7 +77,6 @@ public static SKShapeNode FromSplinePoints (CGPoint [] points) [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] -#endif public static SKShapeNode FromSplinePoints (CGPoint [] points, int offset, int length) { if (points is null) diff --git a/src/SpriteKit/SKUniform.cs b/src/SpriteKit/SKUniform.cs deleted file mode 100644 index b73adac24359..000000000000 --- a/src/SpriteKit/SKUniform.cs +++ /dev/null @@ -1,293 +0,0 @@ -// -// SKUniform.cs: SKUniform class -// -// Authors: -// Vincent Dondain (vidondai@microsoft.com) -// -// Copyright 2016 Xamarin Inc. -// - -using System; -using Foundation; -using ObjCRuntime; - -#if NET -using Vector2 = global::System.Numerics.Vector2; -using Vector3 = global::System.Numerics.Vector3; -using Vector4 = global::System.Numerics.Vector4; -using MatrixFloat2x2 = global::CoreGraphics.NMatrix2; -using MatrixFloat3x3 = global::CoreGraphics.NMatrix3; -using MatrixFloat4x4 = global::CoreGraphics.NMatrix4; -#else -using Vector2 = global::OpenTK.Vector2; -using Vector3 = global::OpenTK.Vector3; -using Vector4 = global::OpenTK.Vector4; -using Matrix2 = global::OpenTK.Matrix2; -using Matrix3 = global::OpenTK.Matrix3; -using Matrix4 = global::OpenTK.Matrix4; -using MatrixFloat2x2 = global::OpenTK.NMatrix2; -using MatrixFloat3x3 = global::OpenTK.NMatrix3; -using MatrixFloat4x4 = global::OpenTK.NMatrix4; -#endif // NET - -#nullable enable - -namespace SpriteKit { - public partial class SKUniform { - - static bool? versionCheck = null; - - static bool CheckSystemVersion () - { - if (!versionCheck.HasValue) { -#if MONOMAC - versionCheck = SystemVersion.CheckmacOS (10, 12); -#elif TVOS || IOS - versionCheck = SystemVersion.CheckiOS (10, 0); -#else -#error Unknown platform -#endif - } - return versionCheck.Value; - } - - // Apple deprecated initWithName:floatVector2: in macOS10.12/iOS10.0 - // and made available initWithName:vectorFloat2: so we invoke - // the right one at runtime depending on which OS version we are running - public SKUniform (string name, Vector2 value) - { - if (CheckSystemVersion ()) - InitializeHandle (InitWithNameVectorFloat2 (name, value), "initWithName:vectorFloat2:"); - else - InitializeHandle (InitWithNameFloatVector2 (name, value), "initWithName:floatVector2:"); - } - - // Apple deprecated initWithName:floatVector3: in macOS10.12/iOS10.0 - // and made available initWithName:vectorFloat3: so we invoke - // the right one at runtime depending on which OS version we are running - public SKUniform (string name, Vector3 value) - { - if (CheckSystemVersion ()) - InitializeHandle (InitWithNameVectorFloat3 (name, value), "initWithName:vectorFloat3:"); - else - InitializeHandle (InitWithNameFloatVector3 (name, value), "initWithName:floatVector3:"); - } - - // Apple deprecated initWithName:floatVector4: in macOS10.12/iOS10.0 - // and made available initWithName:vectorFloat4: so we invoke - // the right one at runtime depending on which OS version we are running - public SKUniform (string name, Vector4 value) - { - if (CheckSystemVersion ()) - InitializeHandle (InitWithNameVectorFloat4 (name, value), "initWithName:vectorFloat4:"); - else - InitializeHandle (InitWithNameFloatVector4 (name, value), "initWithName:floatVector4:"); - } - -#if !NET - // Apple deprecated initWithName:floatMatrix2: in macOS10.12/iOS10.0 - // and made available initWithName:matrixFloat2x2: so we invoke - // the right one at runtime depending on which OS version we are running - // - // Unfortunately our 'initWithName:matrixFloat2x2:' implementation is - // incorrect (the matrix is transposed), but changing it would be a - // breaking change, so we obsolete this constructor and provide a new - // one which implements (only) 'initWithName:matrixFloat2x2:' - // correctly. However, this constructor still does the right thing for - // < macOS 10.12 / iOS 10.0 - [Obsolete ("Use the '(string, MatrixFloat2x2)' overload instead.")] - public SKUniform (string name, Matrix2 value) - { - if (CheckSystemVersion ()) - InitializeHandle (InitWithNameMatrixFloat2x2 (name, value), "initWithName:matrixFloat2x2:"); - else - InitializeHandle (InitWithNameFloatMatrix2 (name, value), "initWithName:floatMatrix2:"); - } - - // Apple deprecated initWithName:floatMatrix3: in macOS10.12/iOS10.0 - // and made available initWithName:matrixFloat3x3: so we invoke - // the right one at runtime depending on which OS version we are running - // - // Unfortunately our 'initWithName:matrixFloat3x3:' implementation is - // incorrect (the matrix is transposed), but changing it would be a - // breaking change, so we obsolete this constructor and provide a new - // one which implements (only) 'initWithName:matrixFloat3x3:' - // correctly. However, this constructor still does the right thing for - // < macOS 10.12 / iOS 10.0 - [Obsolete ("Use the '(string, MatrixFloat3x3)' overload instead.")] - public SKUniform (string name, Matrix3 value) - { - if (CheckSystemVersion ()) - InitializeHandle (InitWithNameMatrixFloat3x3 (name, value), "initWithName:matrixFloat3x3:"); - else - InitializeHandle (InitWithNameFloatMatrix3 (name, value), "initWithName:floatMatrix3:"); - } -#endif // !NET - -#if !NET - // Apple deprecated initWithName:floatMatrix4: in macOS10.12/iOS10.0 - // and made available initWithName:matrixFloat4x4: so we invoke - // the right one at runtime depending on which OS version we are running - // - // Unfortunately our 'initWithName:matrixFloat4x4:' implementation is - // incorrect (the matrix is transposed), but changing it would be a - // breaking change, so we obsolete this constructor and provide a new - // one which implements (only) 'initWithName:matrixFloat4x4:' - // correctly. However, this constructor still does the right thing for - // < macOS 10.12 / iOS 10.0 - [Obsolete ("Use the '(string, MatrixFloat4x4)' overload instead.")] - public SKUniform (string name, Matrix4 value) - { - if (CheckSystemVersion ()) - InitializeHandle (InitWithNameMatrixFloat4x4 (name, value), "initWithName:matrixFloat4x4:"); - else - InitializeHandle (InitWithNameFloatMatrix4 (name, value), "initWithName:floatMatrix4:"); - } -#endif // !NET - - // Apple deprecated floatVector2Value in macOS10.12/iOS10.0 - // and made available vectorFloat2Value so we invoke - // the right one at runtime depending on which OS version we are running - /// Gets or sets the uniform data as a vector of 2 floating point values. - /// To be added. - /// To be added. - public virtual Vector2 FloatVector2Value { - get { - if (CheckSystemVersion ()) - return _VectorFloat2Value; - else - return _FloatVector2Value; - } - set { - if (CheckSystemVersion ()) - _VectorFloat2Value = value; - else - _FloatVector2Value = value; - } - } - - // Apple deprecated floatVector3Value in macOS10.12/iOS10.0 - // and made available vectorFloat3Value so we invoke - // the right one at runtime depending on which OS version we are running - /// Gets or sets the uniform data as a vector of 3 floating point values. - /// To be added. - /// To be added. - public virtual Vector3 FloatVector3Value { - get { - if (CheckSystemVersion ()) - return _VectorFloat3Value; - else - return _FloatVector3Value; - } - set { - if (CheckSystemVersion ()) - _VectorFloat3Value = value; - else - _FloatVector3Value = value; - } - } - - // Apple deprecated floatVector4Value in macOS10.12/iOS10.0 - // and made available vectorFloat4Value so we invoke - // the right one at runtime depending on which OS version we are running - /// Gets or sets the uniform data as a vector of 4 floating point values. - /// To be added. - /// To be added. - public virtual Vector4 FloatVector4Value { - get { - if (CheckSystemVersion ()) - return _VectorFloat4Value; - else - return _FloatVector4Value; - } - set { - if (CheckSystemVersion ()) - _VectorFloat4Value = value; - else - _FloatVector4Value = value; - } - } - -#if !NET - // Apple deprecated floatMatrix2Value in macOS10.12/iOS10.0 - // and made available matrixFloat2x2Value so we invoke - // the right one at runtime depending on which OS version we are running - // - // Unfortunately our 'matrixFloat2x2Value' implementation is incorrect - // (we return a transposed matrix), but changing it would be a - // breaking change, so we obsolete this property and provide a new one - // which implements (only) 'matrixFloat4x4Value' correctly. However, - // this property still returns the correct matrix for < macOS 10.12 / - // iOS 10.0 - [Obsolete ("Use 'MatrixFloat2x2Value' instead.")] - public virtual Matrix2 FloatMatrix2Value { - get { - if (CheckSystemVersion ()) - return (Matrix2) MatrixFloat2x2.Transpose (MatrixFloat2x2Value); - else - return _FloatMatrix2Value; - } - set { - if (CheckSystemVersion ()) - MatrixFloat2x2Value = MatrixFloat2x2.Transpose ((MatrixFloat2x2) value); - else - _FloatMatrix2Value = value; - } - } - - // Apple deprecated floatMatrix3Value in macOS10.12/iOS10.0 - // and made available matrixFloat3x3Value so we invoke - // the right one at runtime depending on which OS version we are running - // - // Unfortunately our 'matrixFloat3x3Value' implementation is incorrect - // (we return a transposed matrix), but changing it would be a - // breaking change, so we obsolete this property and provide a new one - // which implements (only) 'matrixFloat3x3Value' correctly. However, - // this property still returns the correct matrix for < macOS 10.12 / - // iOS 10.0 - [Obsolete ("Use 'MatrixFloat3x3Value' instead.")] - public virtual Matrix3 FloatMatrix3Value { - get { - if (CheckSystemVersion ()) - return (Matrix3) MatrixFloat3x3.Transpose (MatrixFloat3x3Value); - else - return _FloatMatrix3Value; - } - set { - if (CheckSystemVersion ()) - MatrixFloat3x3Value = MatrixFloat3x3.Transpose ((MatrixFloat3x3) value); - else - _FloatMatrix3Value = value; - } - } -#endif // !NET - -#if !NET - // Apple deprecated floatMatrix4Value in macOS10.12/iOS10.0 - // and made available matrixFloat4x4Value so we invoke - // the right one at runtime depending on which OS version we are running - // - // Unfortunately our 'matrixFloat4x4Value' implementation is incorrect - // (we return a transposed matrix), but changing it would be a - // breaking change, so we obsolete this property and provide a new one - // which implements (only) 'matrixFloat4x4Value' correctly. However, - // this property still returns the correct matrix for < macOS 10.12 / - // iOS 10.0 - [Obsolete ("Use 'MatrixFloat4x4Value' instead.")] - public virtual Matrix4 FloatMatrix4Value { - get { - if (CheckSystemVersion ()) - return (Matrix4) MatrixFloat4x4.Transpose (MatrixFloat4x4Value); - else - return _FloatMatrix4Value; - } - set { - if (CheckSystemVersion ()) - MatrixFloat4x4Value = MatrixFloat4x4.Transpose ((MatrixFloat4x4) value); - else - _FloatMatrix4Value = value; - } - } -#endif // !NET - } -} diff --git a/src/SpriteKit/SKWarpGeometryGrid.cs b/src/SpriteKit/SKWarpGeometryGrid.cs index 59b6c453f9d3..093008990744 100644 --- a/src/SpriteKit/SKWarpGeometryGrid.cs +++ b/src/SpriteKit/SKWarpGeometryGrid.cs @@ -8,15 +8,10 @@ // using System; +using System.Numerics; using System.Runtime.InteropServices; using ObjCRuntime; -#if NET -using Vector2 = global::System.Numerics.Vector2; -#else -using Vector2 = global::OpenTK.Vector2; -#endif - #nullable enable namespace SpriteKit { diff --git a/src/frameworks.sources b/src/frameworks.sources index 775919e9b4f1..15ad0d04fc81 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -1677,7 +1677,6 @@ SPRITEKIT_SOURCES = \ SpriteKit/SKKeyframeSequence.cs \ SpriteKit/SKNode.cs \ SpriteKit/SKShapeNode.cs \ - SpriteKit/SKUniform.cs \ SpriteKit/SKVideoNode.cs \ SpriteKit/SKWarpGeometryGrid.cs \ diff --git a/src/spritekit.cs b/src/spritekit.cs index a98c1ee92dc7..99cd01d2c765 100644 --- a/src/spritekit.cs +++ b/src/spritekit.cs @@ -2009,51 +2009,17 @@ interface SKUniform : NSCopying, NSSecureCoding { [Export ("initWithName:float:")] NativeHandle Constructor (string name, float /* float, not CGFloat */ value); - [Internal] - [Deprecated (PlatformName.iOS, 10, 0)] - [Deprecated (PlatformName.TvOS, 10, 0)] - [Deprecated (PlatformName.MacOSX, 10, 12)] - [MacCatalyst (13, 1)] - [Deprecated (PlatformName.MacCatalyst, 13, 1)] - [Export ("initWithName:floatVector2:")] - IntPtr InitWithNameFloatVector2 (string name, Vector2 value); - - [MacCatalyst (13, 1)] [Export ("initWithName:vectorFloat2:")] [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] - [MarshalNativeExceptions] - [Internal] - IntPtr InitWithNameVectorFloat2 (string name, Vector2 value); + NativeHandle Constructor (string name, Vector2 value); - [Internal] - [Deprecated (PlatformName.iOS, 10, 0)] - [Deprecated (PlatformName.TvOS, 10, 0)] - [Deprecated (PlatformName.MacOSX, 10, 12)] - [MacCatalyst (13, 1)] - [Deprecated (PlatformName.MacCatalyst, 13, 1)] - [Export ("initWithName:floatVector3:")] - IntPtr InitWithNameFloatVector3 (string name, Vector3 value); - - [MacCatalyst (13, 1)] [Export ("initWithName:vectorFloat3:")] [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] - [Internal] - IntPtr InitWithNameVectorFloat3 (string name, Vector3 value); + NativeHandle Constructor (string name, Vector3 value); - [Internal] - [Deprecated (PlatformName.iOS, 10, 0)] - [Deprecated (PlatformName.TvOS, 10, 0)] - [Deprecated (PlatformName.MacOSX, 10, 12)] - [MacCatalyst (13, 1)] - [Deprecated (PlatformName.MacCatalyst, 13, 1)] - [Export ("initWithName:floatVector4:")] - IntPtr InitWithNameFloatVector4 (string name, Vector4 value); - - [MacCatalyst (13, 1)] [Export ("initWithName:vectorFloat4:")] [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] - [Internal] - IntPtr InitWithNameVectorFloat4 (string name, Vector4 value); + NativeHandle Constructor (string name, Vector4 value); [MacCatalyst (13, 1)] [Export ("initWithName:matrixFloat2x2:")] @@ -2083,57 +2049,27 @@ interface SKUniform : NSCopying, NSSecureCoding { [Export ("floatValue")] float FloatValue { get; set; } /* float, not CGFloat */ - [Internal] - [Deprecated (PlatformName.iOS, 10, 0)] - [Deprecated (PlatformName.TvOS, 10, 0)] - [Deprecated (PlatformName.MacOSX, 10, 12)] - [MacCatalyst (13, 1)] - [Deprecated (PlatformName.MacCatalyst, 13, 1)] - [Export ("floatVector2Value")] - Vector2 _FloatVector2Value { get; set; } - [MacCatalyst (13, 1)] [Export ("vectorFloat2Value", ArgumentSemantic.Assign)] - [Internal] - Vector2 _VectorFloat2Value { + Vector2 FloatVector2Value { [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] get; [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] set; } - [Internal] - [Deprecated (PlatformName.iOS, 10, 0)] - [Deprecated (PlatformName.TvOS, 10, 0)] - [Deprecated (PlatformName.MacOSX, 10, 12)] - [MacCatalyst (13, 1)] - [Deprecated (PlatformName.MacCatalyst, 13, 1)] - [Export ("floatVector3Value")] - Vector3 _FloatVector3Value { get; set; } - [MacCatalyst (13, 1)] [Export ("vectorFloat3Value", ArgumentSemantic.Assign)] - [Internal] - Vector3 _VectorFloat3Value { + Vector3 VectorFloat3Value { [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] get; [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] set; } - [Internal] - [Deprecated (PlatformName.iOS, 10, 0)] - [Deprecated (PlatformName.TvOS, 10, 0)] - [Deprecated (PlatformName.MacOSX, 10, 12)] - [MacCatalyst (13, 1)] - [Deprecated (PlatformName.MacCatalyst, 13, 1)] - [Export ("floatVector4Value")] - Vector4 _FloatVector4Value { get; set; } - [MacCatalyst (13, 1)] [Export ("vectorFloat4Value", ArgumentSemantic.Assign)] - [Internal] - Vector4 _VectorFloat4Value { + Vector4 VectorFloat4Value { [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] get; [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] diff --git a/tests/cecil-tests/ApiAvailabilityTest.KnownFailures.cs b/tests/cecil-tests/ApiAvailabilityTest.KnownFailures.cs index 254c14664a7a..fc125269347e 100644 --- a/tests/cecil-tests/ApiAvailabilityTest.KnownFailures.cs +++ b/tests/cecil-tests/ApiAvailabilityTest.KnownFailures.cs @@ -39,12 +39,6 @@ public partial class ApiAvailabilityTest { "/src/Foundation/NSUrlSessionHandler.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'SslProtocol.Tls_1_2' is obsoleted on: 'ios' 13.0 and later (Use 'TlsProtocolVersion' instead.), 'maccatalyst' 13.0 and later (Use 'TlsProtocolVersion' instead.), 'macOS/OSX' 10.15 and later (Use 'TlsProtocolVersion' instead.), 'tvos' 13.0 and later (Use 'TlsProtocolVersion' instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", "/src/Foundation/NSUrlSessionHandler.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'SslProtocol.Tls_1_3' is obsoleted on: 'ios' 13.0 and later (Use 'TlsProtocolVersion' instead.), 'maccatalyst' 13.0 and later (Use 'TlsProtocolVersion' instead.), 'macOS/OSX' 10.15 and later (Use 'TlsProtocolVersion' instead.), 'tvos' 13.0 and later (Use 'TlsProtocolVersion' instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", "/src/GameController/GCExtendedGamepadSnapshot.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'GCExtendedGamepadSnapShotDataV100' is obsoleted on: 'ios' 12.2 and later (Use 'GCExtendedGamepadSnapshotData' instead.), 'maccatalyst' 12.2 and later (Use 'GCExtendedGamepadSnapshotData' instead.), 'macOS/OSX' 10.14.4 and later (Use 'GCExtendedGamepadSnapshotData' instead.), 'tvos' 12.2 and later (Use 'GCExtendedGamepadSnapshotData' instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/SpriteKit/SKUniform.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'SKUniform.InitWithNameFloatVector2(string, Vector2)' is obsoleted on: 'ios' 10.0 and later, 'maccatalyst' 10.0 and later, 'macOS/OSX' 10.12 and later, 'tvos' 10.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/SpriteKit/SKUniform.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'SKUniform.InitWithNameFloatVector3(string, Vector3)' is obsoleted on: 'ios' 10.0 and later, 'maccatalyst' 10.0 and later, 'macOS/OSX' 10.12 and later, 'tvos' 10.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/SpriteKit/SKUniform.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'SKUniform.InitWithNameFloatVector4(string, Vector4)' is obsoleted on: 'ios' 10.0 and later, 'maccatalyst' 10.0 and later, 'macOS/OSX' 10.12 and later, 'tvos' 10.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/SpriteKit/SKUniform.cs has 8 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'SKUniform._FloatVector2Value' is obsoleted on: 'ios' 10.0 and later, 'maccatalyst' 10.0 and later, 'macOS/OSX' 10.12 and later, 'tvos' 10.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/SpriteKit/SKUniform.cs has 8 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'SKUniform._FloatVector3Value' is obsoleted on: 'ios' 10.0 and later, 'maccatalyst' 10.0 and later, 'macOS/OSX' 10.12 and later, 'tvos' 10.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/SpriteKit/SKUniform.cs has 8 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'SKUniform._FloatVector4Value' is obsoleted on: 'ios' 10.0 and later, 'maccatalyst' 10.0 and later, 'macOS/OSX' 10.12 and later, 'tvos' 10.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", "/src/StoreKit/SKReceiptProperty.cs has 8 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. '_SKReceiptProperty.IsExpired' is obsoleted on: 'ios' 18.0 and later, 'maccatalyst' 18.0 and later, 'macOS/OSX' 15.0 and later, 'tvos' 18.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", "/src/StoreKit/SKReceiptProperty.cs has 8 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. '_SKReceiptProperty.IsRevoked' is obsoleted on: 'ios' 18.0 and later, 'maccatalyst' 18.0 and later, 'macOS/OSX' 15.0 and later, 'tvos' 18.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", "/src/StoreKit/SKReceiptProperty.cs has 8 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. '_SKReceiptProperty.IsVolumePurchase' is obsoleted on: 'ios' 18.0 and later, 'maccatalyst' 18.0 and later, 'macOS/OSX' 15.0 and later, 'tvos' 18.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", diff --git a/tests/cecil-tests/ApiAvailabilityTest.cs b/tests/cecil-tests/ApiAvailabilityTest.cs index 520ef3726772..9889c5262d19 100644 --- a/tests/cecil-tests/ApiAvailabilityTest.cs +++ b/tests/cecil-tests/ApiAvailabilityTest.cs @@ -69,7 +69,7 @@ public void Warnings () } finally { Console.WriteLine ($"There's a total of {totalWarnings} warnings."); } - Assert.AreEqual (387, totalWarnings, "Total warnings"); // this is just to see how the warning count changes as issues are fixed. + Assert.AreEqual (351, totalWarnings, "Total warnings"); // this is just to see how the warning count changes as issues are fixed. } public record ObsoletedFailure : IComparable { diff --git a/tests/cecil-tests/ConstructorTest.KnownFailures.cs b/tests/cecil-tests/ConstructorTest.KnownFailures.cs index 54f84e8ebea6..5c67bc984fda 100644 --- a/tests/cecil-tests/ConstructorTest.KnownFailures.cs +++ b/tests/cecil-tests/ConstructorTest.KnownFailures.cs @@ -50,9 +50,6 @@ public partial class ConstructorTest { "NetworkExtension.NEHotspotConfiguration::.ctor(System.String,System.String,System.Boolean,System.Boolean)", "NetworkExtension.NEHotspotConfiguration::.ctor(System.String,System.String,System.Boolean)", "NetworkExtension.NEHotspotConfiguration::.ctor(System.String)", - "SpriteKit.SKUniform::.ctor(System.String,System.Numerics.Vector2)", - "SpriteKit.SKUniform::.ctor(System.String,System.Numerics.Vector3)", - "SpriteKit.SKUniform::.ctor(System.String,System.Numerics.Vector4)", "SpriteKit.SKVideoNode::.ctor(Foundation.NSUrl)", "SpriteKit.SKVideoNode::.ctor(System.String)", "SpriteKit.SKWarpGeometryGrid::.ctor(System.IntPtr,System.IntPtr,System.Numerics.Vector2[],System.Numerics.Vector2[])", diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt index b3647ebaac20..516b99ea7eda 100644 --- a/tests/cecil-tests/Documentation.KnownFailures.txt +++ b/tests/cecil-tests/Documentation.KnownFailures.txt @@ -15743,9 +15743,6 @@ M:SpriteKit.SKScene.Dispose(System.Boolean) M:SpriteKit.SKSpriteNode.Dispose(System.Boolean) M:SpriteKit.SKTileMapNode.Dispose(System.Boolean) M:SpriteKit.SKTileSet.Dispose(System.Boolean) -M:SpriteKit.SKUniform.#ctor(System.String,System.Numerics.Vector2) -M:SpriteKit.SKUniform.#ctor(System.String,System.Numerics.Vector3) -M:SpriteKit.SKUniform.#ctor(System.String,System.Numerics.Vector4) M:SpriteKit.SKView.Dispose(System.Boolean) M:SpriteKit.SKView.SKViewAppearance.#ctor(System.IntPtr) M:SpriteKit.SKWarpGeometryGrid.#ctor(System.IntPtr,System.IntPtr,System.Numerics.Vector2[],System.Numerics.Vector2[]) From fbb947f86f0e89f5d2cc2062d78e4ea927d2e3ad Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 25 Apr 2025 08:16:33 +0200 Subject: [PATCH 2/2] Fix breaking change --- src/spritekit.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spritekit.cs b/src/spritekit.cs index 99cd01d2c765..3285787be417 100644 --- a/src/spritekit.cs +++ b/src/spritekit.cs @@ -2060,7 +2060,7 @@ Vector2 FloatVector2Value { [MacCatalyst (13, 1)] [Export ("vectorFloat3Value", ArgumentSemantic.Assign)] - Vector3 VectorFloat3Value { + Vector3 FloatVector3Value { [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] get; [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] @@ -2069,7 +2069,7 @@ Vector3 VectorFloat3Value { [MacCatalyst (13, 1)] [Export ("vectorFloat4Value", ArgumentSemantic.Assign)] - Vector4 VectorFloat4Value { + Vector4 FloatVector4Value { [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] get; [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")]