Skip to content

Commit

Permalink
[CoreData] Add support for Xcode 13 beta 3. (#12183)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque authored Jul 23, 2021
1 parent c14c07a commit de86250
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 97 deletions.
87 changes: 86 additions & 1 deletion src/coredata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ interface NSAttributeDescription {
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("preservesValueInHistoryOnDeletion")]
bool PreservesValueInHistoryOnDeletion { get; set; }

[Watch (8, 0), TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15,0)]
[Export ("allowsCloudEncryption")]
bool AllowsCloudEncryption { get; set; }
}

[BaseType (typeof (NSObject))]
Expand Down Expand Up @@ -1667,14 +1671,26 @@ interface NSPersistentHistoryTransaction : NSCopying
[DisableDefaultCtor] // NSInternalInconsistencyException Reason: NSCoreDataCoreSpotlightDelegate requires the use of the initializer initForStoreWithDescription:model:
interface NSCoreDataCoreSpotlightDelegate
{

[Notification]
[Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Field ("NSCoreDataCoreSpotlightDelegateIndexDidUpdateNotification")]
NSString IndexDidUpdateNotification { get; }

[Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("initForStoreWithDescription:coordinator:")]
[DesignatedInitializer]
IntPtr Constructor (NSPersistentStoreDescription description, NSPersistentStoreCoordinator psc);

[Export ("domainIdentifier")]
string DomainIdentifier { get; }

[NullAllowed, Export ("indexName")]
string IndexName { get; }

[Deprecated (PlatformName.iOS, 15,0, message: "Use the constructor that takes a NSPersistentStoreCoordinator instead.")]
[Deprecated (PlatformName.MacOSX, 12,0, message: "Use the constructor that takes a NSPersistentStoreCoordinator instead.")]
[Export ("initForStoreWithDescription:model:")]
[DesignatedInitializer]
IntPtr Constructor (NSPersistentStoreDescription description, NSManagedObjectModel model);

[Export ("attributeSetForObject:")]
Expand All @@ -1686,6 +1702,23 @@ interface NSCoreDataCoreSpotlightDelegate

[Export ("searchableIndex:reindexSearchableItemsWithIdentifiers:acknowledgementHandler:")]
void ReindexSearchableItems (CSSearchableIndex searchableIndex, string[] identifiers, Action acknowledgementHandler);

[Async]
[NoWatch, NoTV, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("deleteSpotlightIndexWithCompletionHandler:")]
void DeleteSpotlightIndex (Action<NSError> completionHandler);

[NoWatch, NoTV, Mac (12, 0), iOS (15, 0), MacCatalyst (15,0)]
[Export ("indexingEnabled")]
bool IndexingEnabled { [Bind ("isIndexingEnabled")] get; }

[NoWatch, NoTV, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("startSpotlightIndexing")]
void StartSpotlightIndexing ();

[NoWatch, NoTV, Mac (12,0), iOS (15,0),MacCatalyst (15,0)]
[Export ("stopSpotlightIndexing")]
void StopSpotlightIndexing ();
}
#endif

Expand Down Expand Up @@ -2640,6 +2673,21 @@ interface NSDerivedAttributeDescription : NSSecureCoding {
NSExpression DerivationExpression { get; set; }
}

[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
delegate void NSPersistentCloudKitContainerShareManagedObjectsHandler (NSSet<NSManagedObjectID> sharedObjectIds, CKShare share, CKContainer container, NSError error);

[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
delegate void NSPersistentCloudKitContainerFetchParticipantsMatchingLookupInfosHandler (NSArray<CKShareParticipant> fetchedParticipants, NSError error);

[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
delegate void NSPersistentCloudKitContainerPersistUpdatedShareHandler (CKShare persistedShare, NSError error);

[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
delegate void NSPersistentCloudKitContainerPurgeObjectsAndRecordsInZoneHandler (CKRecordZoneID purgedZoneId, NSError error);

[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
delegate void NSPersistentCloudKitContainerAcceptShareInvitationsHandler (NSArray<CKShareMetadata> acceptedShareMetadatas, NSError error);

[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[BaseType (typeof(NSPersistentContainer))]
[DisableDefaultCtor]
Expand Down Expand Up @@ -2677,6 +2725,43 @@ interface NSPersistentCloudKitContainer {
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[Export ("canModifyManagedObjectsInStore:")]
bool CanModifyManagedObjects (NSPersistentStore store);

// NSPersistentCloudKitContainer_Sharing
[Async (ResultTypeName = "NSPersistentCloudKitContainerAcceptShareInvitationsResult")]
[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("acceptShareInvitationsFromMetadata:intoPersistentStore:completion:")]
void AcceptShareInvitations (CKShareMetadata[] metadata, NSPersistentStore persistentStore, [NullAllowed] NSPersistentCloudKitContainerAcceptShareInvitationsHandler handler);

[Async (ResultTypeName = "NSPersistentCloudKitContainerPurgeObjectsAndRecordsInZone")]
[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("purgeObjectsAndRecordsInZoneWithID:inPersistentStore:completion:")]
void PurgeObjectsAndRecordsInZone (CKRecordZoneID zoneId, [NullAllowed] NSPersistentStore persistentStore, [NullAllowed] NSPersistentCloudKitContainerPurgeObjectsAndRecordsInZoneHandler handler);

[Async (ResultTypeName = "NSPersistentCloudKitContainerPersistUpdatedShareResult")]
[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("persistUpdatedShare:inPersistentStore:completion:")]
void PersistUpdatedShare (CKShare share, NSPersistentStore persistentStore, [NullAllowed] NSPersistentCloudKitContainerPersistUpdatedShareHandler handler);

[Async (ResultTypeName = "NSPersistentCloudKitContainerFetchParticipantsMatchingLookupInfosResult")]
[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("fetchParticipantsMatchingLookupInfos:intoPersistentStore:completion:")]
void FetchParticipantsMatchingLookupInfos (CKUserIdentityLookupInfo[] lookupInfos, NSPersistentStore persistentStore, NSPersistentCloudKitContainerFetchParticipantsMatchingLookupInfosHandler handler);

[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("fetchSharesMatchingObjectIDs:error:")]
[return: NullAllowed]
NSDictionary<NSManagedObjectID, CKShare> FetchSharesMatchingObjectIds (NSManagedObjectID[] objectIDs, [NullAllowed] out NSError error);

[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("fetchSharesInPersistentStore:error:")]
[return: NullAllowed]
CKShare[] FetchSharesInPersistentStore ([NullAllowed] NSPersistentStore persistentStore, [NullAllowed] out NSError error);

[Async (ResultTypeName = "NSPersistentCloudKitContainerShareManagedObjectsResult")]
[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Export ("shareManagedObjects:toShare:completion:")]
void ShareManagedObjects (NSManagedObject[] managedObjects, [NullAllowed] CKShare share, NSPersistentCloudKitContainerShareManagedObjectsHandler handler);

}

[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
Expand Down
14 changes: 14 additions & 0 deletions tests/xtro-sharpie/MacCatalyst-CoreData.ignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# NSInternalInconsistencyException Reason: -init results in undefined behavior for NSBatchInsertRequest
!missing-selector! NSBatchInsertRequest::init not bound

# ignored as well in macOS
!missing-field! NSBinaryExternalRecordType not bound
!missing-field! NSEntityNameInPathKey not bound
!missing-field! NSExternalRecordExtensionOption not bound
!missing-field! NSExternalRecordsDirectoryOption not bound
!missing-field! NSExternalRecordsFileFormatOption not bound
!missing-field! NSModelPathKey not bound
!missing-field! NSObjectURIKey not bound
!missing-field! NSStorePathKey not bound
!missing-field! NSStoreUUIDInPathKey not bound
!missing-field! NSValidateXMLStoreOption not bound
!missing-field! NSXMLExternalRecordType not bound
!missing-field! NSXMLStoreType not bound
34 changes: 0 additions & 34 deletions tests/xtro-sharpie/MacCatalyst-CoreData.todo

This file was deleted.

8 changes: 8 additions & 0 deletions tests/xtro-sharpie/common-CoreData.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@

# by-ref argument, cannot be null
!extra-null-allowed! 'System.Boolean CoreData.NSManagedObject::ValidateValue(Foundation.NSObject&,System.String,Foundation.NSError&)' has a extraneous [NullAllowed] on parameter #0

# waiting for changes in foundation which are not trivial
!missing-protocol-member! NSFetchedResultsControllerDelegate::controller:didChangeContentWithDifference: not found
!missing-protocol-member! NSFetchedResultsControllerDelegate::controller:didChangeContentWithSnapshot: not found

!missing-selector! +NSPersistentStoreCoordinator::elementsDerivedFromExternalRecordURL: not bound
!missing-selector! +NSPersistentStoreCoordinator::metadataForPersistentStoreWithURL:error: not bound
!missing-selector! NSPersistentStoreCoordinator::importStoreWithIdentifier:fromExternalRecordsDirectory:toURL:options:withType:error: not bound
3 changes: 0 additions & 3 deletions tests/xtro-sharpie/iOS-CoreData.ignore

This file was deleted.

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

This file was deleted.

2 changes: 0 additions & 2 deletions tests/xtro-sharpie/macOS-CoreData.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
!missing-protocol! NSFetchedResultsControllerDelegate not bound
!missing-protocol! NSFetchedResultsSectionInfo not bound
!missing-selector! +NSFetchedResultsController::deleteCacheWithName: not bound
!missing-selector! +NSPersistentStoreCoordinator::elementsDerivedFromExternalRecordURL: not bound
!missing-selector! NSFetchedResultsController::cacheName not bound
!missing-selector! NSFetchedResultsController::delegate not bound
!missing-selector! NSFetchedResultsController::fetchedObjects not bound
Expand All @@ -27,5 +26,4 @@
!missing-selector! NSFetchedResultsController::sectionNameKeyPath not bound
!missing-selector! NSFetchedResultsController::sections not bound
!missing-selector! NSFetchedResultsController::setDelegate: not bound
!missing-selector! NSPersistentStoreCoordinator::importStoreWithIdentifier:fromExternalRecordsDirectory:toURL:options:withType:error: not bound
!missing-type! NSFetchedResultsController not bound
16 changes: 0 additions & 16 deletions tests/xtro-sharpie/macOS-CoreData.todo

This file was deleted.

3 changes: 0 additions & 3 deletions tests/xtro-sharpie/tvOS-CoreData.ignore

This file was deleted.

9 changes: 0 additions & 9 deletions tests/xtro-sharpie/tvOS-CoreData.todo

This file was deleted.

3 changes: 0 additions & 3 deletions tests/xtro-sharpie/watchOS-CoreData.ignore

This file was deleted.

9 changes: 0 additions & 9 deletions tests/xtro-sharpie/watchOS-CoreData.todo

This file was deleted.

7 comments on commit de86250

@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 failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

Packages generated

View packages

Test results

2 tests failed, 222 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Debug [dotnet]: Failed (Tests run: 2629 Passed: 2486 Inconclusive: 35 Failed: 2 Ignored: 141)
  • Documentation/All: Failed

Pipeline on Agent XAMBOT-1023.BigSur'
[CoreData] Add support for Xcode 13 beta 3. (#12183)

@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.

🔥 Tests failed catastrophically on VSTS: device tests tvOS 🔥

Not enough free space in the host.

Pipeline on Agent
[CoreData] Add support for Xcode 13 beta 3. (#12183)

@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.

⚠️ Tests were not ran (VSTS: device tests tvOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[CoreData] Add support for Xcode 13 beta 3. (#12183)

@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.

⚠️ Tests were not ran (VSTS: device tests iOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[CoreData] Add support for Xcode 13 beta 3. (#12183)

@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.

✅ Tests passed on macOS Mac Catalina (10.15) ✅

Tests passed

All tests on macOS X Mac Catalina (10.15) passed.

Pipeline on Agent
[CoreData] Add support for Xcode 13 beta 3. (#12183)

@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.

✅ Tests passed on macOS Mac Mojave (10.14) ✅

Tests passed

All tests on macOS X Mac Mojave (10.14) passed.

Pipeline on Agent
[CoreData] Add support for Xcode 13 beta 3. (#12183)

@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.

✅ Tests passed on macOS Mac High Sierra (10.13) ✅

Tests passed

All tests on macOS X Mac High Sierra (10.13) passed.

Pipeline on Agent
[CoreData] Add support for Xcode 13 beta 3. (#12183)

Please sign in to comment.