From 8f387dc95f3b2a8f75606b811bafc06320d1aec8 Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Tue, 12 Sep 2023 10:57:33 -0700 Subject: [PATCH 1/6] [ShazamKit] Add support for Xcode 15 --- src/shazamkit.cs | 12 ++++++++ .../MacCatalyst-ShazamKit.todo | 10 ------- .../api-annotations-dotnet/iOS-ShazamKit.todo | 4 --- .../macOS-ShazamKit.todo | 4 --- .../tvOS-ShazamKit.todo | 4 --- tests/xtro-sharpie/iOS-ShazamKit.todo | 4 --- tests/xtro-sharpie/macOS-ShazamKit.todo | 4 --- tests/xtro-sharpie/tvOS-ShazamKit.todo | 4 --- tests/xtro-sharpie/watchOS-ShazamKit.todo | 29 ------------------- 9 files changed, 12 insertions(+), 63 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-ShazamKit.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/iOS-ShazamKit.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/macOS-ShazamKit.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/tvOS-ShazamKit.todo delete mode 100644 tests/xtro-sharpie/iOS-ShazamKit.todo delete mode 100644 tests/xtro-sharpie/macOS-ShazamKit.todo delete mode 100644 tests/xtro-sharpie/tvOS-ShazamKit.todo delete mode 100644 tests/xtro-sharpie/watchOS-ShazamKit.todo diff --git a/src/shazamkit.cs b/src/shazamkit.cs index 5212eec90f91..870a6389e5a9 100644 --- a/src/shazamkit.cs +++ b/src/shazamkit.cs @@ -23,6 +23,7 @@ public enum SHErrorCode : long { CustomCatalogInvalidURL = 301, MediaLibrarySyncFailed = 400, InternalError = 500, + MediaItemFetchFailed = 600 } [iOS (15, 0), Mac (12, 0), Watch (8, 0), TV (15, 0), MacCatalyst (15, 0)] @@ -62,6 +63,9 @@ enum SHMediaItemProperty { [Watch (9, 0), TV (16, 0), Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0)] [Field ("SHMediaItemFrequencySkewRanges")] FrequencySkewRanges, + [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Field("SHMediaItemCreationDate")] + SHMediaItemCreationDate, } [iOS (15, 0), Mac (12, 0), Watch (8, 0), TV (15, 0), MacCatalyst (15, 0)] @@ -190,9 +194,17 @@ interface SHMediaItem : NSSecureCoding, NSCopying { [Watch (9, 0), TV (16, 0), Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0)] [Export ("frequencySkewRanges", ArgumentSemantic.Strong)] SHRange [] FrequencySkewRanges { get; } + + [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [NullAllowed, Export("creationDate", ArgumentSemantic.Strong)] + NSDate CreationDate { get; } } [iOS (15, 0), Mac (12, 0), Watch (8, 0), TV (15, 0), MacCatalyst (15, 0)] + [Deprecated(PlatformName.MacOSX, 12, 0, message: "Use SHLibrary instead.")] + [Deprecated(PlatformName.iOS, 15, 0, message: "Use SHLibrary instead.")] + [Deprecated(PlatformName.TvOS, 15, 0, message: "Use SHLibrary instead.")] + [Deprecated(PlatformName.WatchOS, 8, 0, message: "Use SHLibrary instead.")] [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface SHMediaLibrary { diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-ShazamKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-ShazamKit.todo deleted file mode 100644 index aa8c963b8749..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-ShazamKit.todo +++ /dev/null @@ -1,10 +0,0 @@ -!missing-enum-value! SHErrorCode native value SHErrorCodeInternalError = 500 not bound -!missing-field! SHMediaItemTimeRanges not bound -!missing-selector! +SHRange::rangeWithLowerBound:upperBound: not bound -!missing-selector! +SHSignatureGenerator::generateSignatureFromAsset:completionHandler: not bound -!missing-selector! SHMediaItem::frequencySkewRanges not bound -!missing-selector! SHMediaItem::timeRanges not bound -!missing-selector! SHRange::initWithLowerBound:upperBound: not bound -!missing-selector! SHRange::lowerBound not bound -!missing-selector! SHRange::upperBound not bound -!missing-type! SHRange not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-ShazamKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-ShazamKit.todo deleted file mode 100644 index 14d4e91ff1e7..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-ShazamKit.todo +++ /dev/null @@ -1,4 +0,0 @@ -!deprecated-attribute-missing! SHMediaLibrary missing a [Deprecated] attribute -!missing-enum-value! SHErrorCode native value SHErrorCodeMediaItemFetchFailed = 600 not bound -!missing-field! SHMediaItemCreationDate not bound -!missing-selector! SHMediaItem::creationDate not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-ShazamKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-ShazamKit.todo deleted file mode 100644 index 14d4e91ff1e7..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-ShazamKit.todo +++ /dev/null @@ -1,4 +0,0 @@ -!deprecated-attribute-missing! SHMediaLibrary missing a [Deprecated] attribute -!missing-enum-value! SHErrorCode native value SHErrorCodeMediaItemFetchFailed = 600 not bound -!missing-field! SHMediaItemCreationDate not bound -!missing-selector! SHMediaItem::creationDate not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-ShazamKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-ShazamKit.todo deleted file mode 100644 index 14d4e91ff1e7..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-ShazamKit.todo +++ /dev/null @@ -1,4 +0,0 @@ -!deprecated-attribute-missing! SHMediaLibrary missing a [Deprecated] attribute -!missing-enum-value! SHErrorCode native value SHErrorCodeMediaItemFetchFailed = 600 not bound -!missing-field! SHMediaItemCreationDate not bound -!missing-selector! SHMediaItem::creationDate not bound diff --git a/tests/xtro-sharpie/iOS-ShazamKit.todo b/tests/xtro-sharpie/iOS-ShazamKit.todo deleted file mode 100644 index 14d4e91ff1e7..000000000000 --- a/tests/xtro-sharpie/iOS-ShazamKit.todo +++ /dev/null @@ -1,4 +0,0 @@ -!deprecated-attribute-missing! SHMediaLibrary missing a [Deprecated] attribute -!missing-enum-value! SHErrorCode native value SHErrorCodeMediaItemFetchFailed = 600 not bound -!missing-field! SHMediaItemCreationDate not bound -!missing-selector! SHMediaItem::creationDate not bound diff --git a/tests/xtro-sharpie/macOS-ShazamKit.todo b/tests/xtro-sharpie/macOS-ShazamKit.todo deleted file mode 100644 index 14d4e91ff1e7..000000000000 --- a/tests/xtro-sharpie/macOS-ShazamKit.todo +++ /dev/null @@ -1,4 +0,0 @@ -!deprecated-attribute-missing! SHMediaLibrary missing a [Deprecated] attribute -!missing-enum-value! SHErrorCode native value SHErrorCodeMediaItemFetchFailed = 600 not bound -!missing-field! SHMediaItemCreationDate not bound -!missing-selector! SHMediaItem::creationDate not bound diff --git a/tests/xtro-sharpie/tvOS-ShazamKit.todo b/tests/xtro-sharpie/tvOS-ShazamKit.todo deleted file mode 100644 index 14d4e91ff1e7..000000000000 --- a/tests/xtro-sharpie/tvOS-ShazamKit.todo +++ /dev/null @@ -1,4 +0,0 @@ -!deprecated-attribute-missing! SHMediaLibrary missing a [Deprecated] attribute -!missing-enum-value! SHErrorCode native value SHErrorCodeMediaItemFetchFailed = 600 not bound -!missing-field! SHMediaItemCreationDate not bound -!missing-selector! SHMediaItem::creationDate not bound diff --git a/tests/xtro-sharpie/watchOS-ShazamKit.todo b/tests/xtro-sharpie/watchOS-ShazamKit.todo deleted file mode 100644 index 8c37ca2975c5..000000000000 --- a/tests/xtro-sharpie/watchOS-ShazamKit.todo +++ /dev/null @@ -1,29 +0,0 @@ -!unknown-field! SHErrorDomain bound -!unknown-field! SHMediaItemAppleMusicID bound -!unknown-field! SHMediaItemAppleMusicURL bound -!unknown-field! SHMediaItemArtist bound -!unknown-field! SHMediaItemArtworkURL bound -!unknown-field! SHMediaItemExplicitContent bound -!unknown-field! SHMediaItemFrequencySkew bound -!unknown-field! SHMediaItemFrequencySkewRanges bound -!unknown-field! SHMediaItemGenres bound -!unknown-field! SHMediaItemISRC bound -!unknown-field! SHMediaItemMatchOffset bound -!unknown-field! SHMediaItemShazamID bound -!unknown-field! SHMediaItemSubtitle bound -!unknown-field! SHMediaItemTimeRanges bound -!unknown-field! SHMediaItemTitle bound -!unknown-field! SHMediaItemVideoURL bound -!unknown-field! SHMediaItemWebURL bound -!unknown-native-enum! SHErrorCode bound -!unknown-protocol! SHSessionDelegate bound -!unknown-type! SHCatalog bound -!unknown-type! SHCustomCatalog bound -!unknown-type! SHMatch bound -!unknown-type! SHMatchedMediaItem bound -!unknown-type! SHMediaItem bound -!unknown-type! SHMediaLibrary bound -!unknown-type! SHRange bound -!unknown-type! SHSession bound -!unknown-type! SHSignature bound -!unknown-type! SHSignatureGenerator bound From c9351bf2af5a92e9da4bf82eab0c14a414c2ea8c Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Tue, 12 Sep 2023 18:05:18 +0000 Subject: [PATCH 2/6] Auto-format source code --- src/shazamkit.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/shazamkit.cs b/src/shazamkit.cs index 870a6389e5a9..6ca40173f8e4 100644 --- a/src/shazamkit.cs +++ b/src/shazamkit.cs @@ -63,8 +63,8 @@ enum SHMediaItemProperty { [Watch (9, 0), TV (16, 0), Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0)] [Field ("SHMediaItemFrequencySkewRanges")] FrequencySkewRanges, - [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Field("SHMediaItemCreationDate")] + [Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Field ("SHMediaItemCreationDate")] SHMediaItemCreationDate, } @@ -195,16 +195,16 @@ interface SHMediaItem : NSSecureCoding, NSCopying { [Export ("frequencySkewRanges", ArgumentSemantic.Strong)] SHRange [] FrequencySkewRanges { get; } - [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [NullAllowed, Export("creationDate", ArgumentSemantic.Strong)] + [Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [NullAllowed, Export ("creationDate", ArgumentSemantic.Strong)] NSDate CreationDate { get; } } [iOS (15, 0), Mac (12, 0), Watch (8, 0), TV (15, 0), MacCatalyst (15, 0)] - [Deprecated(PlatformName.MacOSX, 12, 0, message: "Use SHLibrary instead.")] - [Deprecated(PlatformName.iOS, 15, 0, message: "Use SHLibrary instead.")] - [Deprecated(PlatformName.TvOS, 15, 0, message: "Use SHLibrary instead.")] - [Deprecated(PlatformName.WatchOS, 8, 0, message: "Use SHLibrary instead.")] + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use SHLibrary instead.")] + [Deprecated (PlatformName.iOS, 15, 0, message: "Use SHLibrary instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use SHLibrary instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use SHLibrary instead.")] [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface SHMediaLibrary { From 76675d61159751da21cbb795c7ddb93a41543f90 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 12 Sep 2023 15:02:23 -0400 Subject: [PATCH 3/6] Update src/shazamkit.cs --- src/shazamkit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shazamkit.cs b/src/shazamkit.cs index 6ca40173f8e4..4cf88939a54c 100644 --- a/src/shazamkit.cs +++ b/src/shazamkit.cs @@ -23,7 +23,7 @@ public enum SHErrorCode : long { CustomCatalogInvalidURL = 301, MediaLibrarySyncFailed = 400, InternalError = 500, - MediaItemFetchFailed = 600 + MediaItemFetchFailed = 600, } [iOS (15, 0), Mac (12, 0), Watch (8, 0), TV (15, 0), MacCatalyst (15, 0)] From 13d238aa2b2a2fd95d699c5bcfbb3cb9fba4ce96 Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Tue, 12 Sep 2023 16:48:55 -0700 Subject: [PATCH 4/6] add ignore --- tests/xtro-sharpie/watchOS-ShazamKit.ignore | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/xtro-sharpie/watchOS-ShazamKit.ignore diff --git a/tests/xtro-sharpie/watchOS-ShazamKit.ignore b/tests/xtro-sharpie/watchOS-ShazamKit.ignore new file mode 100644 index 000000000000..2cfc9f7cff64 --- /dev/null +++ b/tests/xtro-sharpie/watchOS-ShazamKit.ignore @@ -0,0 +1,31 @@ +## xtro being not recognizing +!unknown-field! SHErrorDomain bound +!unknown-field! SHMediaItemAppleMusicID bound +!unknown-field! SHMediaItemAppleMusicURL bound +!unknown-field! SHMediaItemArtist bound +!unknown-field! SHMediaItemArtworkURL bound +!unknown-field! SHMediaItemExplicitContent bound +!unknown-field! SHMediaItemFrequencySkew bound +!unknown-field! SHMediaItemFrequencySkewRanges bound +!unknown-field! SHMediaItemGenres bound +!unknown-field! SHMediaItemISRC bound +!unknown-field! SHMediaItemMatchOffset bound +!unknown-field! SHMediaItemShazamID bound +!unknown-field! SHMediaItemSubtitle bound +!unknown-field! SHMediaItemTimeRanges bound +!unknown-field! SHMediaItemTitle bound +!unknown-field! SHMediaItemVideoURL bound +!unknown-field! SHMediaItemWebURL bound +!unknown-native-enum! SHErrorCode bound +!unknown-protocol! SHSessionDelegate bound +!unknown-type! SHCatalog bound +!unknown-type! SHCustomCatalog bound +!unknown-type! SHMatch bound +!unknown-type! SHMatchedMediaItem bound +!unknown-type! SHMediaItem bound +!unknown-type! SHMediaLibrary bound +!unknown-type! SHRange bound +!unknown-type! SHSession bound +!unknown-type! SHSignature bound +!unknown-type! SHSignatureGenerator bound +!unknown-field! SHMediaItemCreationDate bound \ No newline at end of file From 04139881559b4fdc65418e168c2b20e0ff02b3c8 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 13 Sep 2023 12:15:17 -0400 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: Rolf Bjarne Kvinge --- src/shazamkit.cs | 3 ++- tests/xtro-sharpie/watchOS-ShazamKit.ignore | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shazamkit.cs b/src/shazamkit.cs index 4cf88939a54c..e54b160a057e 100644 --- a/src/shazamkit.cs +++ b/src/shazamkit.cs @@ -65,7 +65,7 @@ enum SHMediaItemProperty { FrequencySkewRanges, [Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] [Field ("SHMediaItemCreationDate")] - SHMediaItemCreationDate, + CreationDate, } [iOS (15, 0), Mac (12, 0), Watch (8, 0), TV (15, 0), MacCatalyst (15, 0)] @@ -205,6 +205,7 @@ interface SHMediaItem : NSSecureCoding, NSCopying { [Deprecated (PlatformName.iOS, 15, 0, message: "Use SHLibrary instead.")] [Deprecated (PlatformName.TvOS, 15, 0, message: "Use SHLibrary instead.")] [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use SHLibrary instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use SHLibrary instead.")] [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface SHMediaLibrary { diff --git a/tests/xtro-sharpie/watchOS-ShazamKit.ignore b/tests/xtro-sharpie/watchOS-ShazamKit.ignore index 2cfc9f7cff64..6339e31d1dff 100644 --- a/tests/xtro-sharpie/watchOS-ShazamKit.ignore +++ b/tests/xtro-sharpie/watchOS-ShazamKit.ignore @@ -28,4 +28,4 @@ !unknown-type! SHSession bound !unknown-type! SHSignature bound !unknown-type! SHSignatureGenerator bound -!unknown-field! SHMediaItemCreationDate bound \ No newline at end of file +!unknown-field! SHMediaItemCreationDate bound From ff464a1a256616c9c56ec89ec8403894fbd30116 Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Thu, 14 Sep 2023 14:02:42 -0700 Subject: [PATCH 6/6] fix versions for SHMediaLibrary deprecated attrs --- src/shazamkit.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shazamkit.cs b/src/shazamkit.cs index e54b160a057e..88bb8284fa19 100644 --- a/src/shazamkit.cs +++ b/src/shazamkit.cs @@ -201,11 +201,11 @@ interface SHMediaItem : NSSecureCoding, NSCopying { } [iOS (15, 0), Mac (12, 0), Watch (8, 0), TV (15, 0), MacCatalyst (15, 0)] - [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use SHLibrary instead.")] - [Deprecated (PlatformName.iOS, 15, 0, message: "Use SHLibrary instead.")] - [Deprecated (PlatformName.TvOS, 15, 0, message: "Use SHLibrary instead.")] - [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use SHLibrary instead.")] - [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use SHLibrary instead.")] + [Deprecated (PlatformName.MacOSX, 14, 0, message: "Use SHLibrary instead.")] + [Deprecated (PlatformName.iOS, 17, 0, message: "Use SHLibrary instead.")] + [Deprecated (PlatformName.TvOS, 17, 0, message: "Use SHLibrary instead.")] + [Deprecated (PlatformName.WatchOS, 10, 0, message: "Use SHLibrary instead.")] + [Deprecated (PlatformName.MacCatalyst, 17, 0, message: "Use SHLibrary instead.")] [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface SHMediaLibrary {