-
Notifications
You must be signed in to change notification settings - Fork 514
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] Updated bindings for xcode9. #2210
[CoreData] Updated bindings for xcode9. #2210
Conversation
Build failure |
src/CoreData/Enums.cs
Outdated
@@ -51,6 +51,10 @@ public enum NSAttributeType : nuint { | |||
Boolean = 800, | |||
Date = 900, | |||
Binary = 1000, | |||
[iOS (11,0), TV (11,0), Mac (10,3), Watch (4,0)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Un likely to be mac 10,3
src/CoreData/Enums.cs
Outdated
@@ -51,6 +51,10 @@ public enum NSAttributeType : nuint { | |||
Boolean = 800, | |||
Date = 900, | |||
Binary = 1000, | |||
[iOS (11,0), TV (11,0), Mac (10,3), Watch (4,0)] | |||
Uuid = 1100, | |||
[iOS (11,0), TV (11,0), Mac (10,3), Watch (4,0)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
src/CoreData/Enums.cs
Outdated
StringPatternMatching = 1680 | ||
StringPatternMatching = 1680, | ||
[iOS (11,0), TV (11,0), Mac (10,13), Watch (4,0)] | ||
InvalidUri = 1690 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comma
It makes future diff cleaner and the compiler allows it
src/CoreData/Enums.cs
Outdated
ExternalRecordImport = 134200 | ||
ExternalRecordImport = 134200, | ||
[iOS (11,0), TV (11,0), Mac (10,3), Watch (4,0)] | ||
HistoryTokenExpired = 134301 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
src/coredata.cs
Outdated
interface NSPersistentHistoryChange : NSCopying | ||
{ | ||
[Export ("changeID")] | ||
long ChangeID { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ID inconsistant with next api
Iirc we use Id (abbrev not acronym)
[NoWatch][NoTV] | ||
[Since (7,0), Mavericks] | ||
[Field ("NSPersistentStoreUbiquitousContainerIdentifierKey")] | ||
NSString UbiquitousContainerIdentifierKey { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, we should add this test in intro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want me to add an intro test that makes sure that the Fields are correctly expelled? Or to add it for this one in particular?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a separate pr you can add a check that public fields (all members in fact) should start with an uppercase letter unless it has an obsolete attribute
src/coredata.cs
Outdated
|
||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] | ||
[Field ("NSPersistentHistoryTrackingKey")] | ||
NSString TrackingKey { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are not we losing History from the full name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding it.
src/coredata.cs
Outdated
{ | ||
[Static] | ||
[Export ("fetchHistoryAfterDate:")] | ||
NSPersistentHistoryChangeRequest FetchHistoryAfterDate (NSDate date); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can do FetchHistoryAfter
so this and the next 3 can be overloads
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfectly valid idea. Doing so.
src/coredata.cs
Outdated
|
||
[Static] | ||
[Export ("deleteHistoryBeforeDate:")] | ||
NSPersistentHistoryChangeRequest DeleteHistoryBeforeDate (NSDate date); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, I think these 3 can ve overloads DeleteHistoryBefore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto as with the previous one.
long TransactionNumber { get; } | ||
|
||
[Export ("storeID")] | ||
string StoreId { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to keep here as ID
instead of Id
to keep consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spouliot so I forgot an ID to Id, yet @dalexsoto has this comment. I'm +1 on Id (did it everywhere but one that I forgot). What do you guys prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah @spouliot is right we use ID not as an acronym so it should be Id
totally my bad
src/coredata.cs
Outdated
@@ -263,12 +309,22 @@ interface NSEntityDescription : NSCoding, NSCopying { | |||
[Since(5,0)] | |||
[NullAllowed] // by default this property is null | |||
[Export ("compoundIndexes", ArgumentSemantic.Retain)] | |||
[Availability (Introduced = Platform.iOS_5_0 | Platform.Mac_10_7, Deprecated = Platform.iOS_11_0 | Platform.Mac_10_13, Message = "Use NSEntityDescription.Indexes instead.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use apostrophes in your message (:
Use 'NSEntityDescription.Indexes' instead.
https://github.com/xamarin/xamarin-macios/wiki/BINDINGS#rule-2
src/coredata.cs
Outdated
@@ -1947,6 +2172,7 @@ interface NSPropertyDescription : NSCoding, NSCopying { | |||
NSDictionary UserInfo { get; set; } | |||
|
|||
[Export ("indexed")] | |||
[Availability (Introduced = Platform.iOS_3_0 | Platform.Mac_10_5 , Deprecated = Platform.iOS_11_0 | Platform.Mac_10_13, Message = "Use NSEntityDescription.Indexes instead")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/coredata.cs
Outdated
@@ -1966,6 +2192,7 @@ interface NSPropertyDescription : NSCoding, NSCopying { | |||
|
|||
[Since (5,0)] | |||
[Export ("storedInExternalRecord")] | |||
[Availability (Introduced = Platform.iOS_3_0 | Platform.Mac_10_5 , Deprecated = Platform.iOS_11_0 | Platform.Mac_10_13, Message = "Spotlight integration is deprecated. Use CoreSpotlight integration instead.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put CoreSpotlight between apostrophes. 'CoreSpotlight'
Build failure |
@mandel pretty sure Id is what the FXDG promotes |
Build failure |
is supported. A radar has been created on Apples side: https://trello.com/c/y87bjnr9/69-32761925-nspersistenthistorytoken-supports-nssecurecoding-yet-supportssecurecoding-returns-false
The new revision has the test changed to pass a radar has been filed regarding the issues found by the introspection tests: |
|
||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] | ||
[BaseType (typeof (NSObject))] | ||
interface NSPersistentHistoryToken : NSCopying //, NSSecureCoding TODO: The class does state that it supports the NSSecureCoding YET SupportsSecureCoding returns false, radar 32761925 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spouliot @rolfbjarne is this the correct way? I updated the tests, maybe is not needed to comment it out. Your call :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine, make sure to tag the Trello card (for the radar) that an action is needed once apple fix it (with a link to the pr / comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added it already, just added the line in the comments: https://trello.com/c/y87bjnr9/69-32761925-nspersistenthistorytoken-supports-nssecurecoding-yet-supportssecurecoding-returns-false
Build failure |
Build failure |
Build success |
src/coredata.cs
Outdated
|
||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] | ||
[BaseType (typeof(NSPersistentStoreRequest))] | ||
interface NSPersistentHistoryChangeRequest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the default ctor is usable ? Considering all the static methods to create instances
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless it make sense (base types) I think we should disable the default .ctor
Easier to add later than to remove a broken API
@@ -752,7 +756,6 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<EmbeddedResource Include="Security\openssl_crt.der"> | |||
<LogicalName>monotouchtest.Security.openssl_crt.der</LogicalName> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks like a mistake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, That is visual studio doing something in my back.. cheeky..
[Test] | ||
public void EncodeWithCoderTest () | ||
{ | ||
if (!PlatformInfo.Host.IsArch32 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simpler to check if intptr == 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe our check for Xcode 9 should only return true on 64 bits (on iOS only) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spouliot PlatformInfo.Host.IsArch32
does the IntPtr.Size
check so why not use it? just curious 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not critical but it avoids adding another file + consistant with other tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mandel that test also need a version check for Xcode 9 or it will fail on older versions
src/coredata.cs
Outdated
@@ -1818,8 +2029,24 @@ partial interface NSPersistentStoreCoordinator | |||
[NoWatch][NoTV] | |||
[Since (7,0), Mavericks] | |||
[Field ("NSPersistentStoreUbiquitousContainerIdentifierKey")] | |||
[Obsolete ("Use UbiquitousContainerIdentifierKey instead.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be "Use 'UbiquitousContainerIdentifierKey' instead."
Build failure |
Build success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thingy
src/CoreData/Enums.cs
Outdated
TransactionsOnly = 3, | ||
ChangesOnly = 4, | ||
TransactionsAndChanges = 5 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
public void EncodeWithCoderTest () | ||
{ | ||
// Added test to ensure we do support NSCoding even when introspection fails. | ||
if (IntPtr == 8 && if (TestRuntime.CheckExactXcodeVersion (11, 0, beta: 1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have an if
inside the if
condition, that shouldn't compile...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yet it did.. WEIRD!
@@ -1,4 +1,4 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<?xml version="1.0" encoding="utf-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file only has whitespace changes, you don't need it in the diff at all.
is supported. A radar has been created on Apples side: https://trello.com/c/y87bjnr9/69-32761925-nspersistenthistorytoken-supports-nssecurecoding-yet-supportssecurecoding-returns-false
…acios into coredata-xcode9
131395d
to
e73bfa0
Compare
Build failure |
1 similar comment
Build failure |
e73bfa0
to
1512ab1
Compare
Build failure |
1512ab1
to
cdaebe1
Compare
Build failure |
public void EncodeWithCoderTest () | ||
{ | ||
// Added test to ensure we do support NSCoding even when introspection fails. | ||
if (IntPtr.Size == 8 && TestRuntime.CheckExactXcodeVersion (9, 0, beta: 1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add an exact check for Xcode 9 b1?
In your case it means this test won't run on any other Xcode version (usually exact Xcode checks like this are used to skip a test for a specific Xcode version, so that the test runs in later Xcode versions, which allows us to manually verify if an SDK bug was fixed (or not)).
Also: is this API available on watchOS? In which case this API would still be 32-bit.
I think you'll just want to do this:
if (TestRuntime.CheckXcodeVersion (9, 0))
Build failure |
0e15e4b
to
39a6c93
Compare
Build failure |
Build success |
No description provided.