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

[homekit] Update for Xcode 9 beta 1 & 2 #2276

Merged
merged 4 commits into from
Jul 5, 2017

Conversation

VincentDondain
Copy link
Contributor

Reviewed iOS/watchOS/tvOS API diffs for beta 1 & 2.


partial class HMMutablePresenceEvent {

public HMPresenceType PresenceType {
Copy link
Contributor

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)

Copy link
Contributor Author

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?

Copy link
Member

@dalexsoto dalexsoto Jun 30, 2017

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

Copy link
Contributor Author

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.

Copy link
Member

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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; }
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Contributor

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)

Copy link
Member

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; }

Copy link
Contributor Author

@VincentDondain VincentDondain Jun 30, 2017

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 {
Copy link
Contributor

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; }
Copy link
Contributor

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)

Copy link
Member

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; }
Copy link
Contributor

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]
Copy link
Contributor

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; }
Copy link
Contributor

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

@monojenkins
Copy link
Collaborator

Build failure

@monojenkins
Copy link
Collaborator

Build failure

1 similar comment
@monojenkins
Copy link
Collaborator

Build failure

Copy link
Member

@dalexsoto dalexsoto left a 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);
Copy link
Member

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

Copy link
Contributor Author

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; }
Copy link
Member

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; }
Copy link
Member

Choose a reason for hiding this comment

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

Also needs [Override]

@monojenkins
Copy link
Collaborator

Build failure

@VincentDondain
Copy link
Contributor Author

Unrelated test failure: https://bugzilla.xamarin.com/show_bug.cgi?id=57762

@VincentDondain VincentDondain merged commit 9866d3a into xamarin:xcode9 Jul 5, 2017
@VincentDondain VincentDondain deleted the homekit-b2 branch July 5, 2017 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants