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

Xamarin.Mac support #1576

Merged

Conversation

nor0x
Copy link
Contributor

@nor0x nor0x commented Sep 27, 2021

Description

Hello AppCenter Team 👋

after email discussion with @DmitriyKirakosyan and @wisdeom here is my pull-request to start adding Xamarin.Mac support to appcenter-sdk-dotnet. This work is mostly based on my repository https://github.com/nor0x/AppCenter-XMac where i have added macOS projects and bindings and excluded some non-Xamarin.Mac related things.

I have now started by forking the latest version of this repository and adding my Xamarin.Mac related additions - this is probably ongoing, that's why i'm creating this PR as a draft for now. The goal of this PR would be to have everything related to Xamarin.Mac support here in the official repository.

I'm very much looking forward to collaborate on the Xamarin.Mac feature with support from the team :-)

Things to consider before you submit the PR:

  • Has CHANGELOG.md been updated?
  • Are tests passing locally?
  • Are the files formatted correctly?
  • Did you add unit tests if this modifies the Windows code?
  • Did you test your change with either the sample apps that are included in the repository or with a blank app that uses your change?

Related PRs or issues

List related PRs and other issues.

Misc

As discussed via Email the strategy would be to have Xamarin.Mac support in this official repository, starting with this PR - once this is completed i will archive https://github.com/nor0x/AppCenter-XMac which is currently at version 4.4.0.

@ghost
Copy link

ghost commented Sep 27, 2021

CLA assistant check
All CLA requirements met.

i'm not sure if the non "MacAppCenter..." files should be updated as well since we cannot build the Xamarin.Mac bits on Windows
@wisdeom
Copy link

wisdeom commented Sep 27, 2021

Super excited for this. Thanks @nor0x!

@DmitriyKirakosyan
Copy link
Contributor

Hi @nor0x ,

Thank you so much for your contribution! 👍 🚀
We will prioritize this feature and will handle further work on this PR.
In case of any uncertainty we will ask you to help us resolving it.

Does it sound good to you?

@nor0x
Copy link
Contributor Author

nor0x commented Sep 27, 2021

thank you @DmitriyKirakosyan and @wisdeom 🥳

sounds good, i'm available and happy to help

@AnastasiaKubova AnastasiaKubova changed the base branch from develop to feature/support-xamarin-mac September 29, 2021 09:04
@AnastasiaKubova AnastasiaKubova merged commit f429f13 into microsoft:feature/support-xamarin-mac Sep 29, 2021
@DmitriyKirakosyan
Copy link
Contributor

Hi @nor0x! We have a couple of questions about your Xamarin MacOS implementation. Could you please help us to understand it?

  1. We are facing an issue that App Center SDK doesn't catch C# exceptions. It can catch native exceptions only, like this:

NSNull.Null.PerformSelector(new ObjCRuntime.Selector("isEqualToString:"));

Is your implementation intended to be able to catch C# unhandled crashes? For example crash like this:


throw new ArgumentOutOfRangeException(null, "It's over 9000!");

How did you achieve it if so?

  1. Why did you add files like these?


https://github.com/microsoft/appcenter-sdk-dotnet/pull/1576/files#diff-d211b03797bb78d763fec96718b21f075e5ca60574070b426f808fd0c274fb11R41

https://github.com/microsoft/appcenter-sdk-dotnet/pull/1576/files#diff-49aaa2b172550284b30bda8b0a378a53274c6621bc7ee13c5263481c55395ba8R3

We checked the build with App Center SDK dependencies for Xamarin macOS in release and debug mode and all works correctly. What issues were these files fixing? Could you please share the repro steps?

@nor0x
Copy link
Contributor Author

nor0x commented Oct 6, 2021

hi @DmitriyKirakosyan! i have not figured a way to deal with unhandled crashes - in my demo i have wrapped the NSApplication.Main(args); with a try catch block to track crashes with AppCenter.

files like AppCenter.framework.linkwith.cs or other linkwith.cs are artifacts from me trying to make the SDK linker-safe, those files can probably be deleted.

Regarding the .targets files in the nuspec package definition - those files contain something like the following:

<Project>
    <Target Name="FixAppCenterAnalyticsSymlink" AfterTargets="_CollectFrameworks">
        <Message Text="symlinking AppCenterAnalytics" />
        <Exec Command="cd $(AppBundleDir)\Contents\Frameworks\AppCenterAnalytics.framework\ ; rm AppCenterAnalytics ; ln -s Versions\A\AppCenterAnalytics AppCenterAnalytics" />
    </Target>
</Project>

it's manually creating symlinks within the .framework because of an older issue in Xamarin-macios (xamarin/xamarin-macios#5213)

this should also be resolved by now

@DmitriyKirakosyan
Copy link
Contributor

Thank you for the answers!

@DmitriyKirakosyan
Copy link
Contributor

Hi @nor0x , we finished the migration of your implementation into this repository and just released a new version of App Center Xamarin SDK with support of Xamarin.Mac!
Nugets of AppCenter@4.5.0, AppCenterAnalytics@4.5.0 and AppCenterCrashes@4.5.0 for Xamarin.Mac projects are publicly available now!

I believe it is time to archive https://github.com/nor0x/AppCenter-XMac and start using the Microsoft nugets.

I would like to thank you again, @nor0x , for your contribution and making the App Center SDK better by adding the missing Xamarin.Mac platform it its Xamarin family. Great job! 👍🍻

cc @wisdeom

@nor0x
Copy link
Contributor Author

nor0x commented Jan 14, 2022

thank you @DmitriyKirakosyan 🥳 glad to see that Xamarin.Mac is now available in the official packages. I have archived https://github.com/nor0x/AppCenter-XMac and deprecated the NuGet packages. For anyone interested in the journey of my bindings project - here is a quick summary

https://johnnys.news/2022/01/AppCenter-XMac-is-dead-long-live-Microsoft-AppCenter/

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.

4 participants