[src/introspection] Adjust tests and availability attributes to work run on iOS/tvOS 12.4. Fixes #13957. (#14133)

Fixes https://github.com/xamarin/xamarin-macios/issues/13957.
This commit is contained in:
Rolf Bjarne Kvinge 2022-02-15 08:20:16 +01:00 коммит произвёл GitHub
Родитель 3cd78c0932
Коммит 3eb50804a3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
12 изменённых файлов: 94 добавлений и 8 удалений

Просмотреть файл

@ -135,10 +135,11 @@ namespace Network {
#if NET #if NET
[SupportedOSPlatform ("tvos13.0")] [SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")] [SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios12.0")] [SupportedOSPlatform ("ios13.0")]
#else #else
[TV (13,0)] [TV (13,0)]
[Mac (10,15)] [Mac (10,15)]
[iOS (13,0)]
#endif #endif
[DllImport (Constants.NetworkLibrary)] [DllImport (Constants.NetworkLibrary)]
static extern unsafe OS_nw_protocol_definition nw_framer_create_definition (string identifier, NWFramerCreateFlags flags, ref BlockLiteral start_handler); static extern unsafe OS_nw_protocol_definition nw_framer_create_definition (string identifier, NWFramerCreateFlags flags, ref BlockLiteral start_handler);

Просмотреть файл

@ -9908,6 +9908,7 @@ namespace AppKit {
[Export ("layerContentsForContentsScale:")] [Export ("layerContentsForContentsScale:")]
NSObject GetLayerContentsForContentsScale (nfloat layerContentsScale); NSObject GetLayerContentsForContentsScale (nfloat layerContentsScale);
[NoMacCatalyst]
[Mac (11,0)] [Mac (11,0)]
[Static] [Static]
[Export ("imageWithSystemSymbolName:accessibilityDescription:")] [Export ("imageWithSystemSymbolName:accessibilityDescription:")]

Просмотреть файл

@ -3119,6 +3119,7 @@ namespace AVFoundation {
string [] AvailableMediaCharacteristicsWithMediaSelectionOptions { get; } string [] AvailableMediaCharacteristicsWithMediaSelectionOptions { get; }
#if !MONOMAC #if !MONOMAC
[MacCatalyst (14,0)] // the headers lie, not usable until at least Mac Catalyst 14.0
[Export ("compatibleWithSavedPhotosAlbum")] [Export ("compatibleWithSavedPhotosAlbum")]
bool CompatibleWithSavedPhotosAlbum { [Bind ("isCompatibleWithSavedPhotosAlbum")] get; } bool CompatibleWithSavedPhotosAlbum { [Bind ("isCompatibleWithSavedPhotosAlbum")] get; }
#endif #endif

Просмотреть файл

@ -191,6 +191,7 @@ namespace ExternalAccessory {
#endif #endif
interface EAWiFiUnconfiguredAccessoryBrowser { interface EAWiFiUnconfiguredAccessoryBrowser {
[MacCatalyst (14,0)] // the headers lie, not usable until at least Mac Catalyst 14.0
[NoTV] [NoTV]
[Export ("initWithDelegate:queue:")] [Export ("initWithDelegate:queue:")]
[DesignatedInitializer] // according to header comment (but not in attributes) [DesignatedInitializer] // according to header comment (but not in attributes)
@ -208,15 +209,18 @@ namespace ExternalAccessory {
[Export ("unconfiguredAccessories", ArgumentSemantic.Copy)] [Export ("unconfiguredAccessories", ArgumentSemantic.Copy)]
NSSet UnconfiguredAccessories { get; } NSSet UnconfiguredAccessories { get; }
[MacCatalyst (14,0)] // the headers lie, not usable until at least Mac Catalyst 14.0
[NoTV] [NoTV]
[Export ("startSearchingForUnconfiguredAccessoriesMatchingPredicate:")] [Export ("startSearchingForUnconfiguredAccessoriesMatchingPredicate:")]
void StartSearchingForUnconfiguredAccessories ([NullAllowed] NSPredicate predicate); void StartSearchingForUnconfiguredAccessories ([NullAllowed] NSPredicate predicate);
[MacCatalyst (14,0)] // the headers lie, not usable until at least Mac Catalyst 14.0
[NoTV] [NoTV]
[Export ("stopSearchingForUnconfiguredAccessories")] [Export ("stopSearchingForUnconfiguredAccessories")]
void StopSearchingForUnconfiguredAccessories (); void StopSearchingForUnconfiguredAccessories ();
#if !MONOMAC #if !MONOMAC
[MacCatalyst (14,0)] // the headers lie, not usable until at least Mac Catalyst 14.0
[NoTV] [NoTV]
[Export ("configureAccessory:withConfigurationUIOnViewController:")] [Export ("configureAccessory:withConfigurationUIOnViewController:")]
void ConfigureAccessory (EAWiFiUnconfiguredAccessory accessory, UIViewController viewController); void ConfigureAccessory (EAWiFiUnconfiguredAccessory accessory, UIViewController viewController);

Просмотреть файл

@ -1661,6 +1661,7 @@ namespace GameKit {
[Async] [Async]
void LoadAchievementDescriptions ([NullAllowed] GKAchievementDescriptionHandler handler); void LoadAchievementDescriptions ([NullAllowed] GKAchievementDescriptionHandler handler);
[MacCatalyst (14,0)] // the headers lie, not usable until at least Mac Catalyst 14.0
[NoWatch] [NoWatch]
[Export ("loadImageWithCompletionHandler:")] [Export ("loadImageWithCompletionHandler:")]
[Async] [Async]
@ -1693,11 +1694,13 @@ namespace GameKit {
[NullAllowed] [NullAllowed]
UIImage Image { get; } UIImage Image { get; }
[MacCatalyst (14,0)] // the headers lie, not usable until at least Mac Catalyst 14.0
[NoWatch] [NoWatch]
[Static] [Static]
[Export ("incompleteAchievementImage")] [Export ("incompleteAchievementImage")]
UIImage IncompleteAchievementImage { get; } UIImage IncompleteAchievementImage { get; }
[MacCatalyst (14,0)] // the headers lie, not usable until at least Mac Catalyst 14.0
[NoWatch] [NoWatch]
[Static] [Static]
[Export ("placeholderCompletedAchievementImage")] [Export ("placeholderCompletedAchievementImage")]

Просмотреть файл

@ -736,6 +736,7 @@ namespace Metal {
nuint GetImageblockMemoryLength (MTLSize imageblockDimensions); nuint GetImageblockMemoryLength (MTLSize imageblockDimensions);
[TV (13, 0), Mac (11,0), iOS (13, 0)] [TV (13, 0), Mac (11,0), iOS (13, 0)]
[MacCatalyst (14, 0)]
#if NET #if NET
[Abstract] [Abstract]
#endif #endif
@ -2299,6 +2300,7 @@ namespace Metal {
nuint GetImageblockMemoryLength (MTLSize imageblockDimensions); nuint GetImageblockMemoryLength (MTLSize imageblockDimensions);
[Mac (10,14), iOS (12,0), TV (12,0)] [Mac (10,14), iOS (12,0), TV (12,0)]
[MacCatalyst (14, 0)]
#if NET #if NET
[Abstract] [Abstract]
#endif #endif
@ -3553,6 +3555,7 @@ namespace Metal {
[iOS (11, 0), Mac (11,0), NoWatch] [iOS (11, 0), Mac (11,0), NoWatch]
[TV (14,5)] [TV (14,5)]
[MacCatalyst (14, 0)]
[NullAllowed, Export ("tileArguments")] [NullAllowed, Export ("tileArguments")]
MTLArgument[] TileArguments { get; } MTLArgument[] TileArguments { get; }
} }
@ -3680,21 +3683,25 @@ namespace Metal {
[iOS (11, 0), NoWatch, Mac (11,0)] [iOS (11, 0), NoWatch, Mac (11,0)]
[TV (14,5)] [TV (14,5)]
[MacCatalyst (14,0)]
[Export ("imageblockSampleLength")] [Export ("imageblockSampleLength")]
nuint ImageblockSampleLength { get; set; } nuint ImageblockSampleLength { get; set; }
[iOS (11, 0), NoWatch, Mac (11,0)] [iOS (11, 0), NoWatch, Mac (11,0)]
[TV (14,5)] [TV (14,5)]
[MacCatalyst (14,0)]
[Export ("threadgroupMemoryLength")] [Export ("threadgroupMemoryLength")]
nuint ThreadgroupMemoryLength { get; set; } nuint ThreadgroupMemoryLength { get; set; }
[iOS (11, 0), NoWatch, Mac (11,0)] [iOS (11, 0), NoWatch, Mac (11,0)]
[TV (14,5)] [TV (14,5)]
[MacCatalyst (14,0)]
[Export ("tileWidth")] [Export ("tileWidth")]
nuint TileWidth { get; set; } nuint TileWidth { get; set; }
[iOS (11, 0), NoWatch, Mac (11,0)] [iOS (11, 0), NoWatch, Mac (11,0)]
[TV (14,5)] [TV (14,5)]
[MacCatalyst (14,0)]
[Export ("tileHeight")] [Export ("tileHeight")]
nuint TileHeight { get; set; } nuint TileHeight { get; set; }
@ -3960,6 +3967,7 @@ namespace Metal {
MTLPipelineBufferDescriptorArray Buffers { get; } MTLPipelineBufferDescriptorArray Buffers { get; }
[Mac (11,0), iOS (13, 0), TV (13,0)] [Mac (11,0), iOS (13, 0), TV (13,0)]
[MacCatalyst (14, 0)]
[Export ("supportIndirectCommandBuffers")] [Export ("supportIndirectCommandBuffers")]
bool SupportIndirectCommandBuffers { get; set; } bool SupportIndirectCommandBuffers { get; set; }

Просмотреть файл

@ -1037,7 +1037,6 @@ namespace SpriteKit {
[Export ("fieldBitMask")] [Export ("fieldBitMask")]
uint FieldBitMask { get; set; } /* uint32_t */ uint FieldBitMask { get; set; } /* uint32_t */
[iOS (8,0), Mac(10,10)]
[Deprecated (PlatformName.iOS, 8, 0)] [Deprecated (PlatformName.iOS, 8, 0)]
[Deprecated (PlatformName.TvOS, 8, 0)] [Deprecated (PlatformName.TvOS, 8, 0)]
[Deprecated (PlatformName.MacOSX, 10, 10)] [Deprecated (PlatformName.MacOSX, 10, 10)]

Просмотреть файл

@ -10776,6 +10776,7 @@ namespace UIKit {
CGPoint SnapPoint { get; set; } CGPoint SnapPoint { get; set; }
} }
[MacCatalyst (14,0)] // the headers lie, not usable until at least Mac Catalyst 14.0
[NoTV] [NoTV]
[BaseType (typeof (UIViewController))] [BaseType (typeof (UIViewController))]
// iOS6 returns the following (confusing) message with the default .ctor: // iOS6 returns the following (confusing) message with the default .ctor:
@ -17604,6 +17605,7 @@ namespace UIKit {
UIEdgeInsets PerPageContentInsets { get; set; } UIEdgeInsets PerPageContentInsets { get; set; }
} }
[MacCatalyst (14,0)] // the headers lie, not usable until at least Mac Catalyst 14.0
[NoTV] [NoTV]
[BaseType (typeof (UIPrintFormatter))] [BaseType (typeof (UIPrintFormatter))]
[DisableDefaultCtor] // nonfunctional (and it doesn't show up in the header anyway) [DisableDefaultCtor] // nonfunctional (and it doesn't show up in the header anyway)

Просмотреть файл

@ -471,6 +471,31 @@ namespace Introspection {
protected virtual bool SkipUnavailable (Type type, string memberName) protected virtual bool SkipUnavailable (Type type, string memberName)
{ {
switch (type.FullName) { switch (type.FullName) {
#if __MACOS__
case "AppKit.NSDrawer":
switch (memberName) {
case "AccessibilityChildrenInNavigationOrder":
case "get_AccessibilityChildrenInNavigationOrder":
case "set_AccessibilityChildrenInNavigationOrder":
case "AccessibilityCustomActions":
case "get_AccessibilityCustomActions":
case "set_AccessibilityCustomActions":
case "AccessibilityCustomRotors":
case "get_AccessibilityCustomRotors":
case "set_AccessibilityCustomRotors":
// NSDrawer was deprecated in macOS 10.13, but implements (and inlines) NSAccessibility, which added several new members in macOS 10.13, so ignore those members here.
return true;
}
break;
case "GLKit.GLKTextureLoader":
switch (memberName) {
case "GrayscaleAsAlpha":
case "get_GrayscaleAsAlpha":
// GLKTextureLoader is deprecated, but the GLKTextureLoaderGrayscaleAsAlpha value, which we've put inside the GLKTextureLoader class, isn't.
return true;
}
break;
#endif
#if __MACCATALYST__ #if __MACCATALYST__
case "AudioUnit.AudioComponent": case "AudioUnit.AudioComponent":
switch (memberName) { switch (memberName) {

Просмотреть файл

@ -355,6 +355,14 @@ namespace Introspection {
return true; return true;
} }
break; break;
case "SKNode":
switch (selectorName) {
case "focusItemContainer":
if (!TestRuntime.CheckXcodeVersion (12, 0))
return true;
break;
}
break;
case "INPriceRange": case "INPriceRange":
switch (selectorName) { switch (selectorName) {
case "initWithMaximumPrice:currencyCode:": case "initWithMaximumPrice:currencyCode:":
@ -658,6 +666,16 @@ namespace Introspection {
return true; return true;
} }
break; break;
case "NSMenu":
switch (selectorName) {
case "appearance":
case "setAppearance:":
case "effectiveAppearance":
if (!TestRuntime.CheckXcodeVersion (12, TestRuntime.MinorXcode12APIMismatch))
return true;
break;
}
break;
case "NSQueryGenerationToken": // A test was added in monotouch tests to ensure the selector works case "NSQueryGenerationToken": // A test was added in monotouch tests to ensure the selector works
switch (selectorName) { switch (selectorName) {
case "encodeWithCoder:": case "encodeWithCoder:":
@ -786,6 +804,12 @@ namespace Introspection {
if (!TestRuntime.CheckXcodeVersion (11, 0)) if (!TestRuntime.CheckXcodeVersion (11, 0))
return true; return true;
break; break;
case "objectWithItemProviderData:typeIdentifier:error:":
case "readableTypeIdentifiersForItemProvider":
// Conformance added in Xcode 12
if (!TestRuntime.CheckXcodeVersion (12, 0))
return true;
break;
} }
break; break;
case "MPSNNNeuronDescriptor": case "MPSNNNeuronDescriptor":
@ -807,7 +831,6 @@ namespace Introspection {
break; break;
} }
break; break;
#if __MACOS__ || __MACCATALYST__ || __WATCHOS__
case "MLDictionaryFeatureProvider": case "MLDictionaryFeatureProvider":
case "MLMultiArray": case "MLMultiArray":
case "MLFeatureValue": case "MLFeatureValue":
@ -819,7 +842,6 @@ namespace Introspection {
break; break;
} }
break; break;
#endif
case "BGTaskScheduler": case "BGTaskScheduler":
switch (selectorName) { switch (selectorName) {
case "sharedScheduler": case "sharedScheduler":
@ -879,6 +901,26 @@ namespace Introspection {
break; break;
} }
break; break;
case "UIControl":
#if __MACCATALYST__
switch (selectorName) {
case "contextMenuInteraction:configurationForMenuAtLocation:":
if (!TestRuntime.CheckXcodeVersion (12, 0))
return true;
break;
}
#endif
break;
case "UISceneConnectionOptions":
#if __MACCATALYST__
switch (selectorName) {
case "shortcutItem":
if (!TestRuntime.CheckXcodeVersion (12, 0))
return true;
break;
}
#endif
break;
} }
// old binding mistake // old binding mistake

Просмотреть файл

@ -392,6 +392,10 @@ namespace Introspection {
if (Mac.CheckSystemVersion (10, 13)) if (Mac.CheckSystemVersion (10, 13))
return true; return true;
break; break;
case "progress":
if (!TestRuntime.CheckXcodeVersion (12, TestRuntime.MinorXcode12APIMismatch))
return true;
break;
} }
break; break;
case "NSUrlSessionConfiguration": case "NSUrlSessionConfiguration":

Просмотреть файл

@ -832,10 +832,6 @@ namespace Introspection {
case "SKAttributeValue": case "SKAttributeValue":
return !TestRuntime.CheckXcodeVersion (7, 2); return !TestRuntime.CheckXcodeVersion (7, 2);
#endif #endif
case "MLDictionaryFeatureProvider":
case "MLMultiArray":
case "MLFeatureValue":
return !TestRuntime.CheckXcodeVersion (10,0);
} }
break; break;
case "mutableCopyWithZone:": case "mutableCopyWithZone:":