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

[CoreData] Add support for xcode 15 beta6. #18837

Merged
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
4 changes: 3 additions & 1 deletion src/CoreData/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public enum NSAttributeType : ulong {
[MacCatalyst (13, 1)]
Uri = 1200,
Transformable = 1800,
ObjectID = 2000
ObjectID = 2000,
[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0), MacCatalyst (17, 0)]
Copy link
Contributor

@tj-devel709 tj-devel709 Aug 28, 2023

Choose a reason for hiding this comment

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

Why use the old versions here? Specifically the Watch, TV, Mac, and iOS

https://developer.apple.com/documentation/coredata/nsattributetype/compositeattributetype?changes=__6

Copy link
Member Author

Choose a reason for hiding this comment

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

due to a yy.

CompositeAttributeType = 2100,
}

// NUInteger -> NSFetchRequest.h
Expand Down
113 changes: 113 additions & 0 deletions src/coredata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ interface UserInfoKeys {

[Field ("NSAffectedStoresErrorKey")]
NSString AffectedStoresForErrorKey { get; }

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

[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0), MacCatalyst (17, 0)]
[Field ("NSPersistentStoreDeferredLightweightMigrationOptionKey")]
NSString DeferredLightweightMigrationOptionKey { get; }
}

[NoWatch]
Expand Down Expand Up @@ -1371,6 +1379,16 @@ interface NSManagedObjectModel : NSCoding, NSCopying {
#else
NSDictionary EntityVersionHashesByName { get; }
#endif

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0)]
[Static]
[Export ("checksumsForVersionedModelAtURL:error:")]
[return: NullAllowed]
NSDictionary<NSString, NSString> ChecksumsForVersionedModel (NSUrl modelUrl, [NullAllowed] out NSError error);

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

[BaseType (typeof (NSObject))]
Expand Down Expand Up @@ -2346,6 +2364,14 @@ partial interface NSPersistentStoreCoordinator
[Export ("currentPersistentHistoryTokenFromStores:")]
[return: NullAllowed]
NSPersistentHistoryToken GetCurrentPersistentHistoryToken ([NullAllowed] NSObject [] stores);

[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0)]
[Export ("finishDeferredLightweightMigration:")]
bool FinishDeferredLightweightMigration ([NullAllowed] out NSError error);

[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0)]
[Export ("finishDeferredLightweightMigrationTask:")]
bool FinishDeferredLightweightMigrationTask ([NullAllowed] out NSError error);
Copy link
Contributor

Choose a reason for hiding this comment

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

These are old versions too but looks like they may actually be older? Just checking

Copy link
Member Author

Choose a reason for hiding this comment

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

This ones are correct. We probably forgot them in one of the . release.

}

interface NSPersistentStoreCoordinatorStoreChangeEventArgs {
Expand Down Expand Up @@ -2973,4 +2999,91 @@ interface NSPersistentCloudKitContainerEventResult {
NSPersistentCloudKitContainerEventResultType ResultType { get; }
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSStagedMigrationManager {
[Export ("stages", ArgumentSemantic.Strong)]
NSMigrationStage [] Stages { get; }

[NullAllowed, Export ("container", ArgumentSemantic.Strong)]
NSPersistentContainer Container { get; }

[Export ("initWithMigrationStages:")]
[DesignatedInitializer]
NativeHandle Constructor (NSMigrationStage [] stages);
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
interface NSMigrationStage {
[NullAllowed, Export ("label")]
string Label { get; set; }
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSManagedObjectModelReference {
[Export ("resolvedModel", ArgumentSemantic.Strong)]
NSManagedObjectModel ResolvedModel { get; }

[Export ("versionChecksum", ArgumentSemantic.Strong)]
string VersionChecksum { get; }

[Export ("initWithModel:versionChecksum:")]
NativeHandle Constructor (NSManagedObjectModel model, string versionChecksum);

[Export ("initWithFileURL:versionChecksum:")]
NativeHandle Constructor (NSUrl fileUrl, string versionChecksum);

[Export ("initWithEntityVersionHashes:inBundle:versionChecksum:")]
NativeHandle Constructor (NSDictionary versionHash, [NullAllowed] NSBundle bundle, string versionChecksum);

[Export ("initWithName:inBundle:versionChecksum:")]
NativeHandle Constructor (string modelName, [NullAllowed] NSBundle bundle, string versionChecksum);
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSMigrationStage))]
[DisableDefaultCtor]
interface NSLightweightMigrationStage {
[Export ("versionChecksums", ArgumentSemantic.Strong)]
string [] VersionChecksums { get; }

[Export ("initWithVersionChecksums:")]
[DesignatedInitializer]
NativeHandle Constructor (string [] versionChecksums);
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSAttributeDescription))]
interface NSCompositeAttributeDescription {
[Export ("elements", ArgumentSemantic.Copy)]
NSAttributeDescription [] Elements { get; set; }
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSMigrationStage))]
[DisableDefaultCtor]
interface NSCustomMigrationStage {
[Export ("currentModel", ArgumentSemantic.Strong)]
NSManagedObjectModelReference CurrentModel { get; }

[Export ("nextModel", ArgumentSemantic.Strong)]
NSManagedObjectModelReference NextModel { get; }

[NullAllowed]
[Export ("willMigrateHandler", ArgumentSemantic.Copy)]
Func<NSStagedMigrationManager, NSCustomMigrationStage, NSError, bool> WillMigrateHandler { get; set; }

[NullAllowed]
[Export ("didMigrateHandler", ArgumentSemantic.Copy)]
Func<NSStagedMigrationManager, NSCustomMigrationStage, NSError, bool> DidMigrateHandler { get; set; }

[Export ("initWithCurrentModelReference:nextModelReference:")]
[DesignatedInitializer]
NativeHandle Constructor (NSManagedObjectModelReference currentModel, NSManagedObjectModelReference nextModel);
}
}

3 changes: 3 additions & 0 deletions tests/introspection/iOS/iOSApiProtocolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,9 @@ protected override bool Skip (Type type, string protocolName)
case "VSUserAccount": // Conformance not in headers
case "PKInk":
return true;
// Xcode 15
case "NSCompositeAttributeDescription":
return true;
}
break;
case "NSCopying":
Expand Down
35 changes: 0 additions & 35 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreData.todo

This file was deleted.

35 changes: 0 additions & 35 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreData.todo

This file was deleted.

35 changes: 0 additions & 35 deletions tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreData.todo

This file was deleted.

35 changes: 0 additions & 35 deletions tests/xtro-sharpie/iOS-CoreData.todo

This file was deleted.

35 changes: 0 additions & 35 deletions tests/xtro-sharpie/macOS-CoreData.todo

This file was deleted.

Loading
Loading