Skip to content

Commit

Permalink
[release/7.0.1xx-rc2] Fix selectors from submission tests (#16045)
Browse files Browse the repository at this point in the history
Manual backport of #16042 to release/7.0.1xx-rc2

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
  • Loading branch information
chamons and rolfbjarne authored Sep 23, 2022
1 parent 8fab54b commit 48df7dd
Show file tree
Hide file tree
Showing 10 changed files with 454 additions and 466 deletions.
349 changes: 349 additions & 0 deletions src/Chip/ChipCompat.cs

Large diffs are not rendered by default.

105 changes: 62 additions & 43 deletions src/HomeKit/HMCompat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
using System.Threading.Tasks;
using Foundation;
using CoreFoundation;
using ObjCRuntime;

#if !NET
using NativeHandle = System.IntPtr;
#endif

#nullable enable
namespace HomeKit {

#if !NET
[Obsolete ("Use 'HMFetchRoomHandler' instead.")]
public delegate void FetchRoomHandler (NSArray<HMChipServiceRoom> rooms, NSError error);

Expand All @@ -26,84 +30,99 @@ namespace HomeKit {
[Register ("HMCHIPServiceRequestHandler", SkipRegistration = true)]
public class HMChipServiceRequestHandler : NSObject, INSExtensionRequestHandling {

public override IntPtr ClassHandle => throw new InvalidOperationException ();
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public HMChipServiceRequestHandler () => throw new InvalidOperationException ();
protected HMChipServiceRequestHandler (NSObjectFlag t) => throw new InvalidOperationException ();
protected HMChipServiceRequestHandler (IntPtr handle) => throw new InvalidOperationException ();
public HMChipServiceRequestHandler () => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMChipServiceRequestHandler (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMChipServiceRequestHandler (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public virtual void BeginRequestWithExtensionContext (NSExtensionContext context) => throw new InvalidOperationException ();
public virtual void ConfigureAccessory (string accessoryName, HMChipServiceRoom accessoryRoom, Action<NSError> completion) => throw new InvalidOperationException ();
public virtual Task ConfigureAccessoryAsync (string accessoryName, HMChipServiceRoom accessoryRoom) => throw new InvalidOperationException ();
public virtual void FetchRooms (HMChipServiceHome home, FetchRoomHandler completion) => throw new InvalidOperationException ();
public virtual Task<NSArray<HMChipServiceRoom>> FetchRoomsAsync (HMChipServiceHome home) => throw new InvalidOperationException ();
public virtual void PairAccessory (HMChipServiceHome home, string onboardingPayload, Action<NSError> completion) => throw new InvalidOperationException ();
public virtual Task PairAccessoryAsync (HMChipServiceHome home, string onboardingPayload) => throw new InvalidOperationException ();
public virtual void BeginRequestWithExtensionContext (NSExtensionContext context) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void ConfigureAccessory (string accessoryName, HMChipServiceRoom accessoryRoom, Action<NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task ConfigureAccessoryAsync (string accessoryName, HMChipServiceRoom accessoryRoom) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void FetchRooms (HMChipServiceHome home, FetchRoomHandler completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task<NSArray<HMChipServiceRoom>> FetchRoomsAsync (HMChipServiceHome home) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void PairAccessory (HMChipServiceHome home, string onboardingPayload, Action<NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task PairAccessoryAsync (HMChipServiceHome home, string onboardingPayload) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

} /* class HMChipServiceRequestHandler */

[Obsolete ("This class is removed, use 'HMMatterTopology' instead.")]
[Register ("HMCHIPServiceTopology", SkipRegistration = true)]
public class HMChipServiceTopology : NSObject, INSCoding, INSCopying, INSSecureCoding {

public override IntPtr ClassHandle => throw new InvalidOperationException ();
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

protected HMChipServiceTopology (IntPtr handle) => throw new InvalidOperationException ();
public HMChipServiceTopology (NSCoder coder) => throw new InvalidOperationException ();
protected HMChipServiceTopology (NSObjectFlag t) => throw new InvalidOperationException ();
public HMChipServiceTopology (HMChipServiceHome[] homes) => throw new InvalidOperationException ();
protected HMChipServiceTopology (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceTopology (NSCoder coder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMChipServiceTopology (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceTopology (HMChipServiceHome[] homes) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException ();
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException ();
public virtual HMChipServiceHome[] Homes => throw new InvalidOperationException ();
public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual HMChipServiceHome[] Homes => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

} /* class HMChipServiceTopology */

[Obsolete ("This class is removed, use 'HMMatterRoom' instead.")]
[Register("HMCHIPServiceRoom", SkipRegistration = true)]
public class HMChipServiceRoom : NSObject, INSCoding, INSCopying, INSSecureCoding {

public override IntPtr ClassHandle => throw new InvalidOperationException ();
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

protected HMChipServiceRoom (IntPtr handle) => throw new InvalidOperationException ();
public HMChipServiceRoom (NSCoder coder) => throw new InvalidOperationException ();
protected HMChipServiceRoom (NSObjectFlag t) => throw new InvalidOperationException ();
public HMChipServiceRoom (NSUuid uuid, string name) => throw new InvalidOperationException ();
protected HMChipServiceRoom (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceRoom (NSCoder coder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMChipServiceRoom (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceRoom (NSUuid uuid, string name) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public virtual NSObject Copy (NSZone? zone)=> throw new InvalidOperationException ();
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException ();
public virtual string Name => throw new InvalidOperationException ();
public virtual NSUuid Uuid => throw new InvalidOperationException ();
public virtual NSObject Copy (NSZone? zone)=> throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual string Name => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual NSUuid Uuid => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

} /* class HMChipServiceRoom */

[Obsolete ("This class is removed, use 'HMMatterHome' instead.")]
[Register("HMCHIPServiceHome", SkipRegistration = true)]
public partial class HMChipServiceHome : NSObject, INSCoding, INSCopying, INSSecureCoding {

public override IntPtr ClassHandle => throw new InvalidOperationException ();
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

protected HMChipServiceHome (IntPtr handle) => throw new InvalidOperationException ();
public HMChipServiceHome (NSCoder coder) => throw new InvalidOperationException ();
protected HMChipServiceHome (NSObjectFlag t) => throw new InvalidOperationException ();
protected HMChipServiceHome (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public HMChipServiceHome (NSCoder coder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMChipServiceHome (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public HMChipServiceHome (NSUuid uuid, string name) => throw new InvalidOperationException ();
public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException ();
public HMChipServiceHome (NSUuid uuid, string name) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException ();
public virtual string Name => throw new InvalidOperationException ();
public virtual NSUuid Uuid => throw new InvalidOperationException ();
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual string Name => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual NSUuid Uuid => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

} /* class HMChipServiceHome */

public partial class HMAccessorySetupManager {

#pragma warning disable CS0618 // HMChipServiceTopology and HMErrorHandler is obsolete
public virtual void AddAndSetUpAccessories (HMChipServiceTopology topology, HMErrorHandler completion) => throw new InvalidOperationException ();
public virtual Task AddAndSetUpAccessoriesAsync (HMChipServiceTopology topology) => throw new InvalidOperationException ();
public virtual void AddAndSetUpAccessories (HMChipServiceTopology topology, HMErrorHandler completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task AddAndSetUpAccessoriesAsync (HMChipServiceTopology topology) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
#pragma warning restore CS0618 // HMChipServiceTopology and HMErrorHandler is obsolete
}
#endif // !NET

} /* class HMAccessorySetupManager */

#if __IOS__ && !__MACCATALYST__
public unsafe partial class HMAccessorySetupManager : NSObject {
public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public HMAccessorySetupManager () : base (NSObjectFlag.Empty) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected HMAccessorySetupManager (NSObjectFlag t) : base (t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
protected internal HMAccessorySetupManager (NativeHandle handle) : base (handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);

public virtual void AddAndSetUpAccessories (HMMatterTopology topology, Action<NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task AddAndSetUpAccessoriesAsync (HMMatterTopology topology) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void PerformAccessorySetup (HMAccessorySetupRequest request, Action<HMAccessorySetupResult, NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task<HMAccessorySetupResult> PerformAccessorySetupAsync (HMAccessorySetupRequest request) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual void PerformMatterEcosystemAccessorySetup (HMAccessorySetupRequest request, HMMatterTopology topology, Action<NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
public virtual Task PerformMatterEcosystemAccessorySetupAsync (HMAccessorySetupRequest request, HMMatterTopology topology) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
}
#endif
}
#endif // !NET
3 changes: 3 additions & 0 deletions src/ObjCRuntime/ObsoleteConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ partial class Constants {
internal const string RemovedFromChip = "This API has been removed from the 'CHIP' framework.";

internal const string BrokenBinding = "This API was incorrectly bound and does not work correctly. Use the new version indicated in the associated Obsolete attribute.";

internal const string RemovedFromHomeKit = "This API has been removed from the 'HomeKit' framework.";

internal const string ApiRemovedGeneral = "This API has been removed from the framework.";
}
}
Loading

5 comments on commit 48df7dd

@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 on macOS Mac Catalina (10.15) passed 💻

All tests on macOS Mac Catalina (10.15) passed.

Pipeline on Agent
Hash: 48df7dda9cd08bef68a5298c419064449cbd29d6 [CI build]

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

✅ API diff for current PR / commit

Legacy Xamarin (No breaking changes)
  • iOS (no change detected)
  • tvOS (no change detected)
  • watchOS (no change detected)
  • macOS (no change detected)
.NET (No breaking changes)

✅ API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 48df7dda9cd08bef68a5298c419064449cbd29d6 [CI build]

@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 on macOS M1 - Mac Big Sur (11.5) failed ❌

Failed tests are:

  • introspection
  • linksdk

Pipeline on Agent
Hash: 48df7dda9cd08bef68a5298c419064449cbd29d6 [CI build]

@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] Artifacts 📚

Packages generated

View packages

Pipeline on Agent XAMMINI-050.Monterey'
Hash: 48df7dda9cd08bef68a5298c419064449cbd29d6 [CI build]

@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] Test results 🔥

Test results

❌ Tests failed on VSTS: simulator tests

1 tests crashed, 1 tests failed, 221 tests passed.

Failures

❌ dotnettests tests

🔥 Failed catastrophically on VSTS: simulator tests - dotnettests (no summary found).

Html Report (VSDrops) Download

❌ mtouch tests

1 tests failed, 0 tests passed.
  • MTouch tests/NUnit: Failed (Execution failed with exit code 3)

Html Report (VSDrops) Download

Successes

✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 23 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: [CI build]

Please sign in to comment.