-
Notifications
You must be signed in to change notification settings - Fork 511
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
[homekit] Update for Xcode 9 beta 1 & 2 #2276
Conversation
|
||
partial class HMMutablePresenceEvent { | ||
|
||
public HMPresenceType PresenceType { |
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.
make it virtual
so we can replace this with normal bindings (once support is added to the generator)
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.
Mmh sure but I don't follow the logic. Why is virtual needed? Wound't we just remove the manual bindings?
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.
Because BindAs will generate a virtual member so making it virtual will be a breaking change, also we will need to use the same property name too so it is also not a breaking change
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.
Right to avoid a breaking change, fair enough. However that is in the eventuality the generator fix doesn't make it before our release of the Xcode 9 APIs right? We can break before that.
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.
yup we can break before it becomes stable, but we can keep the binary compat since now :)
|
||
partial class HMMutableSignificantTimeEvent { | ||
|
||
public HMSignificantEvent SignificantEvent { |
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/homekit.cs
Outdated
@@ -1227,7 +1326,7 @@ interface HMHomeAccessControl { | |||
[TV (10,0)] | |||
[BaseType (typeof (HMEvent))] | |||
[DisableDefaultCtor] | |||
interface HMLocationEvent : NSMutableCopying { | |||
interface HMLocationEvent : NSCopying, NSMutableCopying { |
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.
unneeded since NSMutableCopying
subclass NSCopying
src/homekit.cs
Outdated
[Watch (4,0), TV (11,0), iOS (11,0)] | ||
[BaseType (typeof(HMTimeEvent))] | ||
[DisableDefaultCtor] | ||
interface HMCalendarEvent : NSCopying, NSMutableCopying { |
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 NSCopying
not needed
src/homekit.cs
Outdated
IntPtr Constructor (NSDateComponents fireDateComponents); | ||
|
||
[Export ("fireDateComponents", ArgumentSemantic.Strong)] | ||
NSDateComponents FireDateComponents { get; set; } |
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.
don't you get warnings from this ? c# does not allow overriding properties that don't match (no setter vs setter)
the non-mutable version should have both a getter and a setter, the later should be decorated with [NotImplemented]
. That solves the issue and makes the code work like expected.
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.
Ok sounds good, but no I did not get any warning (make all
in /src
).
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.
Isn't the lack of warning due to the fact that we generate: public virtual NSDateComponents FireDateComponents
for HMMutableCalendarEvent.g.cs
? No override.
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.
weird, double check (with a simple test case) with csc
(since pmcs
is still mcs
based)
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 this is because @VincentDondain is missing [Override]
in the property of the mutable objects, he needs
[Export ("fireDateComponents", ArgumentSemantic.Strong)]
[Override]
NSDateComponents FireDateComponents { get; set; }
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.
Sounds like it could be indeed, I did not know of this attribute, never had to use it. Seemed weird to me that the generated code did not have override.
src/homekit.cs
Outdated
[Watch (4,0), TV (11,0), iOS (11,0)] | ||
[BaseType (typeof(HMTimeEvent))] | ||
[DisableDefaultCtor] | ||
interface HMDurationEvent : NSCopying, NSMutableCopying { |
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/homekit.cs
Outdated
IntPtr Constructor (double duration); | ||
|
||
[Export ("duration")] | ||
double Duration { get; set; } |
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 (lack of setter on non-mutable property)
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.
Also needs [Override]
src/homekit.cs
Outdated
|
||
// FIXME: Bug https://bugzilla.xamarin.com/show_bug.cgi?id=57870 | ||
// [Wrap ("HMPresenceTypeExtensions.GetValue (_PresenceType)")] | ||
// HMPresenceType PresenceType { get; set; } |
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 (non mutable should expose both)
src/homekit.cs
Outdated
[BaseType (typeof(HMSignificantTimeEvent))] | ||
interface HMMutableSignificantTimeEvent { | ||
|
||
[Internal] |
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 sure it should be internal, it might be needed in some cases (some NSString are user extensible).
Maybe just [Advanced]
to hide it (by default) from intelligence ?
src/homekit.cs
Outdated
|
||
// FIXME: Bug https://bugzilla.xamarin.com/show_bug.cgi?id=57870 | ||
// [Wrap ("HMSignificantEventExtensions.GetValue (_SignificantEvent)")] | ||
// HMSignificantEvent SignificantEvent { get; set; } |
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, non mutable version should match signature
Build failure |
Build failure |
1 similar comment
Build failure |
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.
@VincentDondain please verify you have [Override]
in your mutable properties
src/homekit.cs
Outdated
@@ -714,6 +735,10 @@ partial interface HMHomeDelegate { | |||
[Export ("homeDidUpdateName:")] | |||
void DidUpdateNameForHome (HMHome home); | |||
|
|||
[Watch (4,0), TV (11,0), iOS (11,0)] | |||
[Export ("homeDidUpdateAccessControlForCurrentUser:")] | |||
void DidUpdateAccessControl (HMHome home); |
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.
mmm this is kinda not making sense in my head if home
type parameter is ok then let's keep DidUpdateAccessControlForCurrentUser
since CurrentUser ctx is lost
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 guess you're right, I understood it as the "Home" is the user or represents the user if I give it a bit more thoughts I don't think it's actually the case.
@brief Informs the delegate when the access control for current user has been updated.
src/homekit.cs
Outdated
IntPtr Constructor (NSDateComponents fireDateComponents); | ||
|
||
[Export ("fireDateComponents", ArgumentSemantic.Strong)] | ||
NSDateComponents FireDateComponents { get; set; } |
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 this is because @VincentDondain is missing [Override]
in the property of the mutable objects, he needs
[Export ("fireDateComponents", ArgumentSemantic.Strong)]
[Override]
NSDateComponents FireDateComponents { get; set; }
src/homekit.cs
Outdated
IntPtr Constructor (double duration); | ||
|
||
[Export ("duration")] | ||
double Duration { get; set; } |
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.
Also needs [Override]
Build failure |
Unrelated test failure: https://bugzilla.xamarin.com/show_bug.cgi?id=57762 |
Reviewed iOS/watchOS/tvOS API diffs for beta 1 & 2.