Skip to content

Commit

Permalink
[xcode14.3] Update bidnings to Xcode 14.3 RC and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dalexsoto committed Mar 22, 2023
1 parent c18dbe2 commit 4ee9bf8
Show file tree
Hide file tree
Showing 38 changed files with 158 additions and 63 deletions.
4 changes: 2 additions & 2 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ MACCATALYST_NUGET_VERSION_FULL=$(MACCATALYST_NUGET_VERSION_NO_METADATA)+$(NUGET_

# Xcode version should have both a major and a minor version (even if the minor version is 0)
XCODE_VERSION=14.3
XCODE_URL=https://dl.internalx.com/internal-files/xcodes/Xcode_14.3_beta_2.xip
XCODE_DEVELOPER_ROOT=/Applications/Xcode_14.3.0-beta2.app/Contents/Developer
XCODE_URL=https://dl.internalx.com/internal-files/xcodes/Xcode_14.3_Release_Candidate.xip
XCODE_DEVELOPER_ROOT=/Applications/Xcode_14.3.0-rc.app/Contents/Developer
XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist 2>/dev/null || echo " $(shell tput setaf 1 2>/dev/null)The required Xcode ($(XCODE_VERSION)) is not installed in $(basename $(basename $(XCODE_DEVELOPER_ROOT)))$(shell tput sgr0 2>/dev/null)" >&2)

# Tell both Xcode and our build logic which Xcode we're using.
Expand Down
36 changes: 36 additions & 0 deletions src/AuthenticationServices/ASCompat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// ASCompat.cs
//
// Authors:
// Alex Soto <[email protected]>
//
// Copyright 2023 Microsoft Corporation
//
#if !XAMCORE_5_0

#nullable enable

using Foundation;
using ObjCRuntime;
using System;
using System.Threading.Tasks;

#if !NET
using NativeHandle = System.IntPtr;
#endif

namespace AuthenticationServices {
#if MONOMAC
public partial class ASAuthorizationProviderExtensionRegistrationHandler {
public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.BrokenBinding);
#if !NET
public Task<ASAuthorizationProviderExtensionRegistrationResult> BeginDeviceRegistrationAsync (ASAuthorizationProviderExtensionLoginManager loginManager, ASAuthorizationProviderExtensionRequestOptions options) => throw new InvalidOperationException (Constants.BrokenBinding);
public Task<ASAuthorizationProviderExtensionRegistrationResult> BeginUserRegistrationAsync (ASAuthorizationProviderExtensionLoginManager loginManager, string userName, ASAuthorizationProviderExtensionAuthenticationMethod authenticationMethod, ASAuthorizationProviderExtensionRequestOptions options) => throw new InvalidOperationException (Constants.BrokenBinding);
#else
public virtual Task<ASAuthorizationProviderExtensionRegistrationResult> BeginDeviceRegistrationAsync (ASAuthorizationProviderExtensionLoginManager loginManager, ASAuthorizationProviderExtensionRequestOptions options) => throw new InvalidOperationException (Constants.BrokenBinding);
public virtual Task<ASAuthorizationProviderExtensionRegistrationResult> BeginUserRegistrationAsync (ASAuthorizationProviderExtensionLoginManager loginManager, string userName, ASAuthorizationProviderExtensionAuthenticationMethod authenticationMethod, ASAuthorizationProviderExtensionRequestOptions options) => throw new InvalidOperationException (Constants.BrokenBinding);
#endif // !NET
}
#endif // MONOMAC
}
#endif // !XAMCORE_5_0
1 change: 0 additions & 1 deletion src/GameKit/GameKit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ public enum GKError : long {
NotAuthorized = 32,
ConnectionTimeout = 33,
ApiObsolete = 34,
OptedOutOfGameCenter = 35,

FriendListDescriptionMissing = 100,
FriendListRestricted = 101,
Expand Down
4 changes: 2 additions & 2 deletions src/HealthKit/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,10 @@ public enum HKFhirResourceType {
[MacCatalyst (14, 0)]
[Field ("HKFHIRResourceTypeCoverage")]
Coverage,
[iOS (14, 6), MacCatalyst (14, 6), Mac (13, 3)]
[iOS (16, 4), MacCatalyst (16, 4), Mac (13, 3)]
[Field ("HKFHIRResourceTypeDiagnosticReport")]
DiagnosticReport,
[iOS (14, 6), MacCatalyst (14, 6), Mac (13, 3)]
[iOS (16, 4), MacCatalyst (16, 4), Mac (13, 3)]
[Field ("HKFHIRResourceTypeDocumentReference")]
DocumentReference,
}
Expand Down
9 changes: 9 additions & 0 deletions src/appkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23552,6 +23552,15 @@ partial interface NSWindow {
[MacCatalyst (13, 1)]
[NullAllowed, Export ("tabGroup", ArgumentSemantic.Weak)]
NSWindowTabGroup TabGroup { get; }

[Mac (13, 3), MacCatalyst (14, 6)]
[Async]
[Export ("transferWindowSharingToWindow:completionHandler:")]
void TransferWindowSharing (NSWindow window, Action<NSError> completionHandler);

[Mac (13, 3), MacCatalyst (14, 6)]
[Export ("hasActiveWindowSharingSession")]
bool HasActiveWindowSharingSession { get; }
}

partial interface NSPrintOperation {
Expand Down
11 changes: 9 additions & 2 deletions src/authenticationservices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,15 @@ interface ASAuthorizationPublicKeyCredentialAssertion : ASPublicKeyCredential {
NSData Signature { get; }
}

#if !XAMCORE_5_0 // Removed in Xcode 14.3 Beta 3
[Obsoleted (PlatformName.iOS, 16, 4, message: Constants.ApiRemovedGeneral)]
[Obsoleted (PlatformName.MacCatalyst, 16, 4, message: Constants.ApiRemovedGeneral)]
[Obsoleted (PlatformName.TvOS, 16, 4, message: Constants.ApiRemovedGeneral)]
[Obsoleted (PlatformName.WatchOS, 9, 4, message: Constants.ApiRemovedGeneral)]
[NoWatch, Mac (13, 3), iOS (15, 0), MacCatalyst (15, 0), TV (16, 0)]
#else
[NoWatch, NoTV, NoiOS, NoMacCatalyst, Mac (13, 3)]
#endif
[BaseType (typeof (ASAuthorizationRequest))]
[DisableDefaultCtor]
interface ASAuthorizationPlatformPublicKeyCredentialAssertionRequest : ASAuthorizationPublicKeyCredentialAssertionRequest {
Expand Down Expand Up @@ -1621,12 +1629,11 @@ interface ASAuthorizationProviderExtensionLoginManager {
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface ASAuthorizationProviderExtensionRegistrationHandler {
[Async]

[Abstract]
[Export ("beginDeviceRegistrationUsingLoginManager:options:completion:")]
void BeginDeviceRegistration (ASAuthorizationProviderExtensionLoginManager loginManager, ASAuthorizationProviderExtensionRequestOptions options, Action<ASAuthorizationProviderExtensionRegistrationResult> handler);

[Async]
[Abstract]
[Export ("beginUserRegistrationUsingLoginManager:userName:authenticationMethod:options:completion:")]
void BeginUserRegistration (ASAuthorizationProviderExtensionLoginManager loginManager, [NullAllowed] string userName, ASAuthorizationProviderExtensionAuthenticationMethod authenticationMethod, ASAuthorizationProviderExtensionRequestOptions options, Action<ASAuthorizationProviderExtensionRegistrationResult> handler);
Expand Down
4 changes: 2 additions & 2 deletions src/avrouting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ interface AVCustomRoutingActionItem {
string OverrideTitle { get; set; }
}

[NoWatch, NoTV, NoMac, iOS (16, 1)]
[NoWatch, NoTV, NoMac, iOS (16, 4), MacCatalyst (16, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface AVCustomRoutingPartialIP {
Expand All @@ -78,7 +78,7 @@ interface AVCustomRoutingController {
[Export ("authorizedRoutes")]
AVCustomDeviceRoute [] AuthorizedRoutes { get; }

[NoWatch, NoTV, NoMac, iOS (16, 1)]
[NoWatch, NoTV, NoMac, iOS (16, 4), MacCatalyst (16, 4)]
[Export ("knownRouteIPs", ArgumentSemantic.Strong)]
AVCustomRoutingPartialIP [] KnownRouteIPs { get; set; }

Expand Down
3 changes: 3 additions & 0 deletions src/backgroundassets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ interface BAAppExtensionInfo : NSSecureCoding {
[Protocol]
interface BADownloaderExtension {

[Deprecated (PlatformName.iOS, 16, 4, message: "'WillTerminate' will not be called in all applicable scenarios, do not rely on it.")]
[Deprecated (PlatformName.MacOSX, 13, 3, message: "'WillTerminate' will not be invoked in all applicable scenarios, do not rely on it.")]
[Deprecated (PlatformName.MacCatalyst, 16, 4, message: "'WillTerminate' will not be invoked in all applicable scenarios, do not rely on it.")]
[Export ("extensionWillTerminate")]
void WillTerminate ();

Expand Down
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ AUDIOUNIT_SOURCES = \
# AuthenticationServices

AUTHENTICATIONSERVICES_SOURCES = \
AuthenticationServices/ASCompat.cs \
AuthenticationServices/ASAuthorization.cs \
AuthenticationServices/ASAuthorizationRequest.cs \
AuthenticationServices/PublicPrivateKeyAuthentication.cs \
Expand Down
2 changes: 1 addition & 1 deletion src/javascriptcore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ partial interface JSContext {
[Export ("name")]
string Name { get; set; }

[Mac (13, 3), iOS (16, 4), TV (16, 4), MacCatalyst (13, 4)]
[Mac (13, 3), iOS (16, 4), TV (16, 4), MacCatalyst (16, 4)]
[Export ("inspectable")]
bool Inspectable { [Bind ("isInspectable")] get; set; }

Expand Down
20 changes: 20 additions & 0 deletions src/pdfkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,14 @@ interface PdfDocumentWriteOptionKeys {
[iOS (16, 0), Mac (13, 0), MacCatalyst (16, 0)]
[Field ("PDFDocumentSaveTextFromOCROption", "+PDFKit")]
NSString SaveTextFromOcrKey { get; }

[iOS (16, 4), Mac (13, 3), MacCatalyst (16, 4)]
[Field ("PDFDocumentSaveImagesAsJPEGOption", "+PDFKit")]
NSString SaveImagesAsJpegKey { get; }

[iOS (16, 4), Mac (13, 3), MacCatalyst (16, 4)]
[Field ("PDFDocumentOptimizeImagesForScreenOption", "+PDFKit")]
NSString OptimizeImagesForScreenKey { get; }
}

[Mac (10, 13)]
Expand All @@ -492,6 +500,18 @@ interface PdfDocumentWriteOptions {

[iOS (15, 0), Mac (12, 0), MacCatalyst (15, 0)]
string AccessPermissions { get; set; }

[iOS (16, 0), Mac (13, 0), MacCatalyst (16, 0)]
bool BurnInAnnotations { get; set; }

[iOS (16, 0), Mac (13, 0), MacCatalyst (16, 0)]
bool SaveTextFromOcr { get; set; }

[iOS (16, 4), Mac (13, 3), MacCatalyst (16, 4)]
bool SaveImagesAsJpeg { get; set; }

[iOS (16, 4), Mac (13, 3), MacCatalyst (16, 4)]
bool OptimizeImagesForScreen { get; set; }
}

[Mac (10, 13)]
Expand Down
19 changes: 19 additions & 0 deletions src/uikit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27317,5 +27317,24 @@ interface UIFontWidthConstants {
nfloat Compressed { get; }
}

[NoWatch, NoTV, iOS (16, 4), NoMacCatalyst]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface UITextInputContext {

[Export ("pencilInputExpected")]
bool PencilInputExpected { [Bind ("isPencilInputExpected")] get; set; }

[Export ("dictationInputExpected")]
bool DictationInputExpected { [Bind ("isDictationInputExpected")] get; set; }

[Export ("hardwareKeyboardInputExpected")]
bool HardwareKeyboardInputExpected { [Bind ("isHardwareKeyboardInputExpected")] get; set; }

[Static]
[Export ("current")]
UITextInputContext Current { get; }
}


}
24 changes: 24 additions & 0 deletions tests/common/TestRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,30 @@ public static bool CheckXcodeVersion (int major, int minor, int build = 0)
return CheckMacSystemVersion (13, 0);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 2:
#if __WATCHOS__
return CheckWatchOSSystemVersion (9, 1);
#elif __TVOS__
return ChecktvOSSystemVersion (16, 1);
#elif __IOS__
return CheckiOSSystemVersion (16, 2);
#elif MONOMAC
return CheckMacSystemVersion (13, 1);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
case 3:
#if __WATCHOS__
return CheckWatchOSSystemVersion (9, 4);
#elif __TVOS__
return ChecktvOSSystemVersion (16, 4);
#elif __IOS__
return CheckiOSSystemVersion (16, 4);
#elif MONOMAC
return CheckMacSystemVersion (13, 3);
#else
throw new NotImplementedException ($"Missing platform case for Xcode {major}.{minor}");
#endif
default:
throw new NotImplementedException ($"Missing version logic for checking for Xcode {major}.{minor}");
Expand Down
6 changes: 6 additions & 0 deletions tests/introspection/ApiProtocolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ protected virtual bool Skip (Type type, string protocolName)
case "PKPaymentTokenContext":
case "PKRecurringPaymentRequest":
case "PKShareablePassMetadataPreview":
// Xcode 14.3, Conformance not in headers
case "PKDeferredPaymentRequest":
return true;
}
break;
Expand Down Expand Up @@ -322,6 +324,8 @@ protected virtual bool Skip (Type type, string protocolName)
case "PKPaymentTokenContext":
case "PKRecurringPaymentRequest":
case "PKShareablePassMetadataPreview":
// Xcode 14.3, Conformance not in headers
case "PKDeferredPaymentRequest":
return true;
}
break;
Expand Down Expand Up @@ -475,6 +479,8 @@ protected virtual bool Skip (Type type, string protocolName)
case "PKPaymentTokenContext":
case "PKRecurringPaymentRequest":
case "PKShareablePassMetadataPreview":
// Xcode 14.3, Conformance not in headers
case "PKDeferredPaymentRequest":
return true;
}
break;
Expand Down
7 changes: 7 additions & 0 deletions tests/introspection/ApiSelectorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,13 @@ protected virtual bool Skip (Type type, string selectorName)
return true;
}
break;
case "CAEdrMetadata":
switch (selectorName) {
case "copyWithZone:":
case "encodeWithCoder:":
return !TestRuntime.CheckXcodeVersion (14, 3);
}
break;
}

// old binding mistake
Expand Down
9 changes: 9 additions & 0 deletions tests/introspection/iOS/iOSApiSelectorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,15 @@ protected override bool CheckResponse (bool value, Type actualType, MethodBase m
break;
}
break;
case "UIHoverGestureRecognizer":
switch (name) {
case "azimuthAngleInView:": // Only works on iPad and Desktop according to docs.
case "azimuthUnitVectorInView:":
if (TestRuntime.CheckXcodeVersion (14, 3) && UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
return true;
break;
}
break;
#endif
#if __WATCHOS__
case "INUserContext":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
!missing-enum! ASAuthorizationWebBrowserPublicKeyCredentialManagerAuthorizationState not bound
!missing-protocol! ASAuthorizationWebBrowserExternallyAuthenticatableRequest not bound
3 changes: 0 additions & 3 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-Metal.todo
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@
!missing-pinvoke! MTLIOCompressionContextDefaultChunkSize is not bound
!missing-protocol-member! MTLResourceStateCommandEncoder::moveTextureMappingsFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin: not found
!missing-enum! MTLCompileSymbolVisibility not bound
!missing-protocol-member! MTLDevice::maximumConcurrentCompilationTaskCount not found
!missing-protocol-member! MTLDevice::setShouldMaximizeConcurrentCompilation: not found
!missing-protocol-member! MTLDevice::shouldMaximizeConcurrentCompilation not found
!missing-protocol-member! MTLDevice::supportsBCTextureCompression not found
!missing-selector! MTLCompileOptions::allowReferencingUndefinedSymbols not bound
!missing-selector! MTLCompileOptions::compileSymbolVisibility not bound
Expand Down

This file was deleted.

10 changes: 0 additions & 10 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-UIKit.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,3 @@

!incorrect-protocol-member! UISearchSuggestion::localizedAttributedSuggestion is REQUIRED and should be abstract
!incorrect-protocol-member! UICalendarViewDelegate::calendarView:decorationForDateComponents: is OPTIONAL and should NOT be abstract

# Not binding for now, API_AVAILABLE(ios(17.0), macos(14.0))
!missing-selector! +UITextInputContext::current not bound
!missing-selector! UITextInputContext::isDictationInputExpected not bound
!missing-selector! UITextInputContext::isHardwareKeyboardInputExpected not bound
!missing-selector! UITextInputContext::isPencilInputExpected not bound
!missing-selector! UITextInputContext::setDictationInputExpected: not bound
!missing-selector! UITextInputContext::setHardwareKeyboardInputExpected: not bound
!missing-selector! UITextInputContext::setPencilInputExpected: not bound
!missing-type! UITextInputContext not bound
3 changes: 3 additions & 0 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-Metal.todo
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,6 @@
!missing-selector! MTLCompileOptions::setAllowReferencingUndefinedSymbols: not bound
!missing-selector! MTLCompileOptions::setCompileSymbolVisibility: not bound
!missing-selector! MTLCompileOptions::setMaxTotalThreadsPerThreadgroup: not bound
!missing-protocol-member! MTLDevice::maximumConcurrentCompilationTaskCount not found
!missing-protocol-member! MTLDevice::setShouldMaximizeConcurrentCompilation: not found
!missing-protocol-member! MTLDevice::shouldMaximizeConcurrentCompilation not found

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
!missing-enum! ASAuthorizationWebBrowserPublicKeyCredentialManagerAuthorizationState not bound
!missing-protocol! ASAuthorizationWebBrowserExternallyAuthenticatableRequest not bound
3 changes: 0 additions & 3 deletions tests/xtro-sharpie/api-annotations-dotnet/tvOS-Metal.todo
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,6 @@
!missing-type! MTLResourceStatePassSampleBufferAttachmentDescriptorArray not bound
!missing-type! MTLVisibleFunctionTableDescriptor not bound
!missing-enum! MTLCompileSymbolVisibility not bound
!missing-protocol-member! MTLDevice::maximumConcurrentCompilationTaskCount not found
!missing-protocol-member! MTLDevice::setShouldMaximizeConcurrentCompilation: not found
!missing-protocol-member! MTLDevice::shouldMaximizeConcurrentCompilation not found
!missing-protocol-member! MTLDevice::supportsBCTextureCompression not found
!missing-selector! MTLCompileOptions::allowReferencingUndefinedSymbols not bound
!missing-selector! MTLCompileOptions::compileSymbolVisibility not bound
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
!missing-enum-value! UICollectionLayoutListAppearance native value UICollectionLayoutListAppearanceSidebar = 3 not bound
!missing-enum-value! UICollectionLayoutListAppearance native value UICollectionLayoutListAppearanceSidebarPlain = 4 not bound

# Not binding for now, API_AVAILABLE(ios(17.0), macos(14.0))
# Not binding for now, does not make sense on tvOS
!missing-selector! +UITextInputContext::current not bound
!missing-selector! UITextInputContext::isDictationInputExpected not bound
!missing-selector! UITextInputContext::isHardwareKeyboardInputExpected not bound
Expand Down
1 change: 0 additions & 1 deletion tests/xtro-sharpie/iOS-AuthenticationServices.todo
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
!missing-enum! ASAuthorizationWebBrowserPublicKeyCredentialManagerAuthorizationState not bound
!missing-protocol! ASAuthorizationWebBrowserExternallyAuthenticatableRequest not bound
3 changes: 0 additions & 3 deletions tests/xtro-sharpie/iOS-Metal.todo
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@
!missing-pinvoke! MTLIOCompressionContextDefaultChunkSize is not bound
!missing-protocol-member! MTLResourceStateCommandEncoder::moveTextureMappingsFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin: not found
!missing-enum! MTLCompileSymbolVisibility not bound
!missing-protocol-member! MTLDevice::maximumConcurrentCompilationTaskCount not found
!missing-protocol-member! MTLDevice::setShouldMaximizeConcurrentCompilation: not found
!missing-protocol-member! MTLDevice::shouldMaximizeConcurrentCompilation not found
!missing-protocol-member! MTLDevice::supportsBCTextureCompression not found
!missing-selector! MTLCompileOptions::allowReferencingUndefinedSymbols not bound
!missing-selector! MTLCompileOptions::compileSymbolVisibility not bound
Expand Down
2 changes: 0 additions & 2 deletions tests/xtro-sharpie/iOS-SiriAudioIntentUtils.todo

This file was deleted.

Loading

0 comments on commit 4ee9bf8

Please sign in to comment.