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

[NSObject] Unify some code between iOS and macOS. #15302

Merged
merged 1 commit into from
Jun 27, 2022

Conversation

rolfbjarne
Copy link
Member

  • Add these methods to shared code so they're available on all platforms
    (they're already available on mobile platforms), since there's no reason to
    exclude them on macOS:
    • NSObject.Init
    • NSObject.Alloc
    • NSObject.InvokeInBackground
  • Remove unused usings.
  • Move identical code in platform-specific files to shared code.

* Add these methods to shared code so they're available on all platforms
  (they're already available on mobile platforms), since there's no reason to
  exclude them on macOS:
    * NSObject.Init
    * NSObject.Alloc
    * NSObject.InvokeInBackground
* Remove unused usings.
* Move identical code in platform-specific files to shared code.
@rolfbjarne rolfbjarne added the not-notes-worthy Ignore for release notes label Jun 20, 2022
@vs-mobiletools-engineering-service2
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent XAMBOT-1109.Monterey'
Hash: a3666a090af3233b6709c6ae80209b6f3a57c0de [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻

All tests on macOS Mac Catalina (10.15) passed.

Pipeline on Agent
Hash: a3666a090af3233b6709c6ae80209b6f3a57c0de [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌

Failed tests are:

  • introspection
  • monotouch-test

Pipeline on Agent
Hash: a3666a090af3233b6709c6ae80209b6f3a57c0de [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

Legacy Xamarin (No breaking changes)
  • iOS (no change detected)
  • tvOS (no change detected)
  • watchOS (no change detected)
  • macOS: vsdrops gist (No breaking changes)
.NET (No breaking changes)
  • iOS: (empty diff detected)
  • tvOS: (empty diff detected)
  • MacCatalyst: (empty diff detected)
  • macOS: vsdrops gist (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 is empty

Pipeline on Agent
Hash: a3666a090af3233b6709c6ae80209b6f3a57c0de [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌

Tests failed on VSTS: simulator tests iOS.

Test results

3 tests failed, 145 tests passed.

Failed tests

  • link sdk/iOS Unified 64-bits - simulator/Debug: Failed
  • introspection/watchOS 32-bits - simulator/Debug: Crashed
  • monotouch-test/watchOS 32-bits - simulator/Release (all optimizations): TimedOut

Pipeline on Agent XAMBOT-1103.Monterey'
Merge a3666a0 into e3bc284

@rolfbjarne
Copy link
Member Author

Test failures are unrelated:

@rolfbjarne rolfbjarne marked this pull request as ready for review June 22, 2022 09:28
@rolfbjarne rolfbjarne requested a review from chamons as a code owner June 22, 2022 09:28
// using the parameterized Thread.Start to avoid capturing
// the 'action' parameter (it'll needlessly create an extra
// object).
new System.Threading.Thread ((v) =>
Copy link
Contributor

@Therzok Therzok Jun 22, 2022

Choose a reason for hiding this comment

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

The whole create a thread for one callback is worrying. This API might end up in mis-use more often than correct use.

Suggested change
new System.Threading.Thread ((v) =>
new System.Threading.Thread (static (v) =>

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it's a somewhat useless and non-optimal API nowadays, but I think we should have the same API on all platforms.

Then we can deal with any problems with the API at the same time for all platforms (separately).

@rolfbjarne rolfbjarne merged commit a55557f into xamarin:main Jun 27, 2022
@rolfbjarne rolfbjarne deleted the foundation-simplify-nsobject branch June 27, 2022 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-notes-worthy Ignore for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants