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

[mediasetup] Update for Xcode 12 beta 2 #9087

Merged
merged 3 commits into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Constants.iOS.cs.in
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ namespace ObjCRuntime {
public const string AutomaticAssessmentConfigurationLibrary = "/System/Library/Frameworks/AutomaticAssessmentConfiguration.framework/AutomaticAssessmentConfiguration";
// iOS 14.0
public const string AppClipLibrary = "/System/Library/Frameworks/AppClip.framework/AppClip";
public const string MediaSetupLibrary = "/System/Library/Frameworks/MediaSetup.framework/MediaSetup";
public const string UniformTypeIdentifiersLibrary = "/System/Library/Frameworks/UniformTypeIdentifiers.framework/UniformTypeIdentifiers";
}
}
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -1943,6 +1943,7 @@ IOS_FRAMEWORKS = \
MapKit \
MediaAccessibility \
MediaPlayer \
MediaSetup \
MediaToolbox \
Messages \
MessageUI \
Expand Down
70 changes: 70 additions & 0 deletions src/mediasetup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using System;
using Foundation;
using ObjCRuntime;
using UIKit;

namespace MediaSetup {

[NoTV][NoWatch][NoMac]
[iOS (14,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface MSServiceAccount {

[Export ("initWithServiceName:accountName:")]
[DesignatedInitializer]
IntPtr Constructor (string serviceName, string accountName);

[Export ("serviceName")]
string ServiceName { get; }

[Export ("accountName")]
string AccountName { get; }

[NullAllowed, Export ("clientID")]
string ClientId { get; set; }

[NullAllowed, Export ("clientSecret")]
string ClientSecret { get; set; }

[NullAllowed, Export ("configurationURL", ArgumentSemantic.Copy)]
NSUrl ConfigurationUrl { get; set; }

[NullAllowed, Export ("authorizationTokenURL", ArgumentSemantic.Copy)]
NSUrl AuthorizationTokenUrl { get; set; }

[NullAllowed, Export ("authorizationScope")]
string AuthorizationScope { get; set; }
}

interface IMSAuthenticationPresentationContext {}

[NoTV][NoWatch][NoMac]
[iOS (14,0)]
[Protocol]
interface MSAuthenticationPresentationContext {

[Abstract]
[NullAllowed, Export ("presentationAnchor")]
UIWindow PresentationAnchor { get; }
}

[NoTV][NoWatch][NoMac]
[iOS (14,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface MSSetupSession {

[Export ("initWithServiceAccount:")]
IntPtr Constructor (MSServiceAccount serviceAccount);

[Export ("startWithError:")]
bool Start ([NullAllowed] out NSError error);

[NullAllowed, Export ("presentationContext", ArgumentSemantic.Weak)]
IMSAuthenticationPresentationContext PresentationContext { get; set; }

[Export ("account", ArgumentSemantic.Strong)]
MSServiceAccount Account { get; }
}
}
7 changes: 7 additions & 0 deletions tests/introspection/ApiTypoTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,13 @@ public void ConstantsCheck ()
Assert.True (CheckLibrary (s), fi.Name);
break;
#endif
#if __IOS__
case "MediaSetupLibrary":
// Xcode 12 beta 2 does not ship this framework/headers for the simulator
if (Runtime.Arch == Arch.DEVICE)
Assert.True (CheckLibrary (s), fi.Name);
break;
#endif
#if __TVOS__
case "MetalPerformanceShadersLibrary":
// not supported in tvOS (12.1) simulator so load fails
Expand Down
6 changes: 6 additions & 0 deletions tests/introspection/iOS/iOSApiProtocolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ protected override bool Skip (Type type, string protocolName)
case "TVTopShelfSectionedItem":
return true;
#endif
// Xcode 12 beta 2
case "MSServiceAccount":
return true;
}
break;
case "NSSecureCoding":
Expand Down Expand Up @@ -614,6 +617,9 @@ protected override bool Skip (Type type, string protocolName)
case "TVTopShelfSectionedItem":
return true;
#endif
// Xcode 12 beta 2
case "MSServiceAccount":
return true;
}
break;
case "NSCopying":
Expand Down
2 changes: 2 additions & 0 deletions tests/xtro-sharpie/iOS-MediaSetup.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!missing-field! MediaSetupVersionNumber not bound
!missing-field! MediaSetupVersionString not bound
23 changes: 0 additions & 23 deletions tests/xtro-sharpie/iOS-MediaSetup.todo

This file was deleted.

1 change: 1 addition & 0 deletions tools/common/Frameworks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ public static Frameworks GetiOSFrameworks (Application app)
{ "AutomaticAssessmentConfiguration", "AutomaticAssessmentConfiguration", 13, 4 },

{ "AppClip", "AppClip", 14,0 },
{ "MediaSetup", "MediaSetup", new Version (14, 0), NotAvailableInSimulator /* no headers in beta 2 */ },
{ "UniformTypeIdentifiers", "UniformTypeIdentifiers", 14,0 },

// the above MUST be kept in sync with simlauncher
Expand Down