Skip to content

Commit

Permalink
[Foundation] Add support for Xcode 15 beta 7. (#19007)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
  • Loading branch information
4 people authored Oct 17, 2023
1 parent f4a0ea9 commit b73cb11
Show file tree
Hide file tree
Showing 18 changed files with 263 additions and 398 deletions.
8 changes: 8 additions & 0 deletions src/Foundation/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ public enum NSNetServicesStatus : long {
MissingRequiredConfigurationError = -72008,
}

#if XAMCORE_5_0
[NoWatch]
#endif
[Flags]
[Native]
public enum NSNetServiceOptions : ulong {
Expand Down Expand Up @@ -279,6 +282,8 @@ public enum NSDataWritingOptions : ulong {
[Mac (11, 0)]
[MacCatalyst (13, 1)]
FileProtectionCompleteUntilFirstUserAuthentication = 0x40000000,
[iOS (17, 0), NoMac, MacCatalyst (17, 0), TV (17, 0), Watch (10, 0)]
FileProtectionCompleteWhenUserInactive = 0x50000000,
}

public delegate void NSSetEnumerator (NSObject obj, ref bool stop);
Expand Down Expand Up @@ -1382,5 +1387,8 @@ public enum NSFileProtectionType {
CompleteUntilFirstUserAuthentication,
[Field ("NSFileProtectionNone")]
None,
[Watch (10, 0), TV (17, 0), NoMac, iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSFileProtectionCompleteWhenUserInactive")]
CompleteWhenUserInactive,
}
}
205 changes: 205 additions & 0 deletions src/foundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,73 @@ public enum NSAttributedStringNameKey {

[Field ("NSReplacementIndexAttributeName")]
ReplacementIndex,

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSInflectionAgreementArgumentAttributeName")]
InflectionAgreementArgument,

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSInflectionAgreementConceptAttributeName")]
InflectionAgreementConcept,

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSInflectionReferentConceptAttributeName")]
InflectionReferentConcept,

}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Native]
public enum NSGrammaticalCase : long {
NotSet = 0,
Nominative,
Accusative,
Dative,
Genitive,
Prepositional,
Ablative,
Adessive,
Allative,
Elative,
Illative,
Essive,
Inessive,
Locative,
Translative,
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Native]
public enum NSGrammaticalPronounType : long {
NotSet = 0,
Personal,
Reflexive,
Possessive,
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Native]
public enum NSGrammaticalDefiniteness : long {
NotSet = 0,
Indefinite,
Definite,
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Native]
public enum NSGrammaticalDetermination : long {
NotSet = 0,
Independent,
Dependent,
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Native]
public enum NSGrammaticalPerson : long {
NotSet = 0,
First,
Second,
Third,
}

[NoWatch]
Expand Down Expand Up @@ -4460,6 +4527,10 @@ interface NSError : NSSecureCoding, NSCopying {
[Field ("NSNetServicesErrorDomain")]
NSString NSNetServicesErrorDomain { get; }

[NoWatch]
[Field ("NSNetServicesErrorCode")]
NSString NSNetServicesErrorCode { get; }

[Field ("NSStreamSocketSSLErrorDomain")]
NSString NSStreamSocketSSLErrorDomain { get; }

Expand Down Expand Up @@ -5233,6 +5304,14 @@ interface NSLocale : NSSecureCoding, NSCopying {
[Export ("localizedStringForCalendarIdentifier:")]
[return: NullAllowed]
string GetLocalizedCalendarIdentifier (string calendarIdentifier);

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("languageIdentifier")]
string LanguageIdentifier { get; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[NullAllowed, Export ("regionCode")]
string RegionCode { get; }
}

delegate void NSMatchEnumerator (NSTextCheckingResult result, NSMatchingFlags flags, ref bool stop);
Expand Down Expand Up @@ -6183,6 +6262,12 @@ partial interface NSUrl : NSSecureCoding, NSCopying
[Static]
NSUrl _FromStringRelative (string url, NSUrl relative);

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Static]
[Export ("URLWithString:encodingInvalidCharacters:")]
[return: NullAllowed]
NSUrl FromString (string url, bool encodingInvalidCharacters);

[Export ("absoluteString")]
[NullAllowed]
string AbsoluteString { get; }
Expand Down Expand Up @@ -6897,6 +6982,14 @@ partial interface NSUrl : NSSecureCoding, NSCopying
[Field ("NSURLFileProtectionCompleteUntilFirstUserAuthentication")]
NSString FileProtectionCompleteUntilFirstUserAuthentication { get; }

[Watch (10, 0), TV (17, 0), NoMac, iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSURLFileProtectionCompleteWhenUserInactive")]
NSString FileProtectionCompleteWhenUserInactive { get; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSURLDirectoryEntryCountKey")]
NSString DirectoryEntryCountKey { get; }

[Watch (7, 0)]
[TV (14, 0)]
[Mac (11, 0)]
Expand Down Expand Up @@ -7096,6 +7189,12 @@ partial interface NSUrlComponents : NSCopying {
[Static, Export ("componentsWithString:")]
NSUrlComponents FromString (string urlString);

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Static]
[Export ("componentsWithString:encodingInvalidCharacters:")]
[return: NullAllowed]
NSUrlComponents FromString (string url, bool encodingInvalidCharacters);

[Export ("URL")]
NSUrl Url { get; }

Expand Down Expand Up @@ -7743,6 +7842,17 @@ partial interface NSUrlSession {
[MacCatalyst (13, 1)]
[Export ("webSocketTaskWithRequest:")]
NSUrlSessionWebSocketTask CreateWebSocketTask (NSUrlRequest request);

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("uploadTaskWithResumeData:")]
[return: ForcedType]
NSUrlSessionUploadTask CreateUploadTask (NSData resumeData);

[Async (ResultTypeName = "NSUrlSessionUploadTaskResumeRequest")]
[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("uploadTaskWithResumeData:completionHandler:")]
[return: ForcedType]
NSUrlSessionUploadTask CreateUploadTask (NSData resumeData, Action<NSData, NSUrlResponse, NSError> completionHandler);
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -7930,6 +8040,15 @@ partial interface NSUrlSessionUploadTask {
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'NSURLSession.CreateUploadTask' instead.")]
[Export ("init")]
NativeHandle Constructor ();

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSURLSessionUploadTaskResumeData")]
NSString ResumeDataKey { get; }

[Async]
[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("cancelByProducingResumeData:")]
void CancelByProducingResumeData (Action<NSData> completionHandler);
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -8196,6 +8315,14 @@ partial interface NSUrlSessionTaskDelegate {
[MacCatalyst (16, 0)]
[Export ("URLSession:didCreateTask:")]
void DidCreateTask (NSUrlSession session, NSUrlSessionTask task);

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("URLSession:task:didReceiveInformationalResponse:")]
void DidReceiveInformationalResponse (NSUrlSession session, NSUrlSessionTask task, NSHttpUrlResponse response);

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("URLSession:task:needNewBodyStreamFromOffset:completionHandler:")]
void NeedNewBodyStream (NSUrlSession session, NSUrlSessionTask task, long offset, Action<NSInputStream> completionHandler);
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -17874,10 +18001,20 @@ interface NSMorphology : NSCopying, NSSecureCoding {
[Export ("number", ArgumentSemantic.Assign)]
NSGrammaticalNumber Number { get; set; }

[Obsoleted (PlatformName.MacOSX, 14, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.iOS, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.MacCatalyst, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.TvOS, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.WatchOS, 10, 0, message: "Use 'NSTermOfAddress' instead.")]
[Export ("customPronounForLanguage:")]
[return: NullAllowed]
NSMorphologyCustomPronoun GetCustomPronoun (string language);

[Obsoleted (PlatformName.MacOSX, 14, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.iOS, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.MacCatalyst, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.TvOS, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.WatchOS, 10, 0, message: "Use 'NSTermOfAddress' instead.")]
[Export ("setCustomPronoun:forLanguage:error:")]
bool SetCustomPronoun ([NullAllowed] NSMorphologyCustomPronoun features, string language, [NullAllowed] out NSError error);

Expand All @@ -17887,8 +18024,33 @@ interface NSMorphology : NSCopying, NSSecureCoding {
[Static]
[Export ("userMorphology")]
NSMorphology UserMorphology { get; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("grammaticalCase", ArgumentSemantic.Assign)]
NSGrammaticalCase GrammaticalCase { get; set; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("determination", ArgumentSemantic.Assign)]
NSGrammaticalDetermination Determination { get; set; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("grammaticalPerson", ArgumentSemantic.Assign)]
NSGrammaticalPerson GrammaticalPerson { get; set; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("pronounType", ArgumentSemantic.Assign)]
NSGrammaticalPronounType PronounType { get; set; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("definiteness", ArgumentSemantic.Assign)]
NSGrammaticalDefiniteness Definiteness { get; set; }
}

[Obsoleted (PlatformName.MacOSX, 14, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.iOS, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.MacCatalyst, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.TvOS, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.WatchOS, 10, 0, message: "Use 'NSTermOfAddress' instead.")]
[Watch (8, 0), TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15, 0)]
[BaseType (typeof (NSObject))]
interface NSMorphologyCustomPronoun : NSCopying, NSSecureCoding {
Expand Down Expand Up @@ -18033,4 +18195,47 @@ interface NSAttributedStringMarkdownSourcePosition : NSCopying, NSSecureCoding {
NSRange RangeInString (string @string);
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSTermOfAddress : NSCopying, NSSecureCoding {
[Static]
[Export ("neutral")]
NSTermOfAddress Neutral { get; }

[Static]
[Export ("feminine")]
NSTermOfAddress Feminine { get; }

[Static]
[Export ("masculine")]
NSTermOfAddress Masculine { get; }

[Static]
[Export ("localizedForLanguageIdentifier:withPronouns:")]
NSTermOfAddress GetLocalized (string language, NSMorphologyPronoun [] pronouns);

[NullAllowed, Export ("languageIdentifier")]
string LanguageIdentifier { get; }

[NullAllowed, Export ("pronouns", ArgumentSemantic.Copy)]
NSMorphologyPronoun [] Pronouns { get; }
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSMorphologyPronoun : NSCopying, NSSecureCoding {
[Export ("initWithPronoun:morphology:dependentMorphology:")]
NativeHandle Constructor (string pronoun, NSMorphology morphology, [NullAllowed] NSMorphology dependentMorphology);

[Export ("pronoun")]
string Pronoun { get; }

[Export ("morphology", ArgumentSemantic.Copy)]
NSMorphology Morphology { get; }

[NullAllowed, Export ("dependentMorphology", ArgumentSemantic.Copy)]
NSMorphology DependentMorphology { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@
!missing-field! NSMallocException not bound
!missing-field! NSMaximumKeyValueOperator not bound
!missing-field! NSMinimumKeyValueOperator not bound
!missing-field! NSNetServicesErrorCode not bound
!missing-field! NSObjectInaccessibleException not bound
!missing-field! NSObjectNotAvailableException not bound
!missing-field! NSOldStyleException not bound
Expand Down Expand Up @@ -1351,6 +1350,15 @@
!missing-selector! NSString::initWithValidatedFormat:validFormatSpecifiers:error: not bound
!missing-selector! NSString::initWithValidatedFormat:validFormatSpecifiers:locale:arguments:error: not bound
!missing-selector! NSString::initWithValidatedFormat:validFormatSpecifiers:locale:error: not bound
!missing-selector! NSAttributedString::initWithFormat:options:locale:context: not bound
!missing-selector! NSAttributedString::initWithFormat:options:locale:context:arguments: not bound
!missing-selector! NSAttributedString::initWithFormat:options:locale: not bound
!missing-selector! NSAttributedString::initWithFormat:options:locale:arguments: not bound
!missing-selector! +NSAttributedString::localizedAttributedStringWithFormat:context: not bound
!missing-selector! +NSAttributedString::localizedAttributedStringWithFormat:options:context: not bound
!missing-selector! +NSAttributedString::localizedAttributedStringWithFormat: not bound
!missing-selector! +NSAttributedString::localizedAttributedStringWithFormat:options: not bound
!missing-selector! NSMutableAttributedString::appendLocalizedFormat: not bound

# https://github.com/xamarin/xamarin-macios/issues/15577
!missing-selector! +NSOrderedCollectionChange::changeWithObject:type:index: not bound
Expand Down Expand Up @@ -1382,3 +1390,10 @@
!missing-selector! NSOrderedSet::orderedSetByApplyingDifference: not bound
!missing-type! NSOrderedCollectionChange not bound
!missing-type! NSOrderedCollectionDifference not bound

# we provide a static method instead of the constructor since there are two of them
!missing-selector! NSURL::initWithString:encodingInvalidCharacters: not bound
!missing-selector! NSURLComponents::initWithString:encodingInvalidCharacters: not bound

# it is used in the selectors that support vargs and thefore cannot be used with out bindings
!missing-field! NSInflectionConceptsKey not bound
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
!missing-selector! NSXPCInterface::setInterface:forSelector:argumentIndex:ofReply: not bound

## does not exists in iOS as a type - but some API refers to it (messy)
!unknown-type! NSPortMessage bound
!unknown-type! NSPortMessage bound
Loading

6 comments on commit b73cb11

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: b73cb11dc1440b17ce39322c2d3f30b4773a8d09 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Ventura (13.0) passed 💻

All tests on macOS M1 - Mac Ventura (13.0) passed.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻

All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ API diff for current PR / commit

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)

✅ API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: b73cb11dc1440b17ce39322c2d3f30b4773a8d09 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 [CI Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 [CI Build] Test results 🚀

Test results

✅ All tests passed on VSTS: simulator tests.

🎉 All 235 tests passed 🎉

Tests counts

✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 6 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 41 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: b73cb11dc1440b17ce39322c2d3f30b4773a8d09 [CI build]

Please sign in to comment.