xamarin / Essentials

Xamarin.Essentials is no longer supported. Migrate your apps to .NET MAUI, which includes Maui.Essentials.
https://aka.ms/xamarin-upgrade
Other
1.52k stars 505 forks source link

macOS support #111

Closed knocte closed 5 years ago

knocte commented 6 years ago

(Enhancement) Now that Xamarin.Mac is the same thing as Xamarin.iOS (xamarin-macios), supporting macOS should be low hanging fruit, right?

For example, with clipboard support.

Redth commented 6 years ago

It's certainly something we've talked about and want to look at in the future. For the first release we're focusing on iOS, Android, and UWP.

migueldeicaza commented 6 years ago

If people contribute the changes, we could certainly merge those changes in.

tzachshabtay commented 6 years ago

If you're specifically looking for mac support for the clipboard, you can use this: https://github.com/stavroskasidis/XamarinClipboardPlugin It has android + ios + mac + uwp.

(Note that what I really want is cross platform clipboard support which also includes win32 and linux, but it looks like it doesn't exist, which is very depressing).

knocte commented 6 years ago

cross platform clipboard support which also includes win32 and linux

UWP is Win32, and I contributed a PR recently to XamarinClipboardPlugin that adds gtk(linux) support ;)

tzachshabtay commented 6 years ago

UWP is win32? It works on windows 7?

knocte commented 6 years ago

Ah, good point, I just learned something today.

charles-esterbrook commented 6 years ago

Feels like a mismatch that Xamarin.Forms supports macOS while Xamarin.Essentials does not.

JunielKatarn commented 6 years ago

@Redth @migueldeicaza I'm interested in a macOS release, and would be happy to contribute changes.

Any pointers on where/how to start? Tests cases, dev environment...?

jamesmontemagno commented 6 years ago

We are not currently working on new platform support at this time for first release, but keeping these open when the time comes in the future.

ChristianKleineidam commented 5 years ago

Given that creating macOS for all packages at once is likely unfeasible, what are the steps to get it implemented?

Would a pull request that adds files with not implemented errors for all functions of Xamarin.Essentials be accepted?

mattleibow commented 5 years ago

There is nothing stopping you from forking and always merging from this repo into your fork. As you add features, we can watch the progress. If other community members want to contribute macOS features, they can do so on your fork.

A good way for us to measure interest is to see if anyone uses a particular package. I would personally recommend that you fork this repo, and start work on particular APIs. Then, you can just create a simple NuGet with just the macOS assembly. And, if set your NuGet dependencies to depend on the official Xamarin.Essentials package for netstandard2.0, but keep the xamarin.mac2.0 moniker empty, then you can always release your packages.

Samsung has been working on a fork for Tizen: https://github.com/xamarin/Essentials/pull/555

You could have a look at issue #23 and PR #555 to see how they are doing things.

Hopefully in the not-too-distant future, we will merge your PR.

JunielKatarn commented 5 years ago

@ChristianKleineidam if you are creating a fork to maintain a macOS version, I'm interested in helping with coding or devops.

mattleibow commented 5 years ago

I am sure I will also throw in a few lines of code... don't tell my boss! :)

ChristianKleineidam commented 5 years ago

I don't think my interest is strong enough to commit to organizing the fork myself (and I also don't have enough mac experience to be a good person to review code). If someone else picks up the task, I might contribute.

mattleibow commented 5 years ago

@ChristianKleineidam @JunielKatarn I have started an implementation for macOS: https://github.com/xamarin/Essentials/pull/653

I am working in a fork for now (https://github.com/mattleibow/Essentials/tree/macos). I will gladly accept pull requests to add APIs. As of now, I can only work on weekends and public holidays. 😄 But I have got the main fork in place with a few APIs, so adding APIs more will be very easy.

⚠️ IMPORTANT NOTICE ⚠️ This is not an official branch/platform. I am just starting this so the community can help contribute. It is my hope that Microsoft will see interest in this platform and merge this into the main branch. But, for now, I will use this fork to get all the code together for them.

jamesmontemagno commented 5 years ago

Placing this under: https://github.com/xamarin/Essentials/issues/662

CrosswiredStudios commented 5 years ago

I have a need for Connectivity for Mac. If i do just that tool and create the sample project scaffold will you guys merge it?

mattleibow commented 5 years ago

@mattwood2855 at this time, we are not doing much for macOS, but I am trying to get together the APIs so we can discuss a merge. You can open a PR on this fork: https://github.com/mattleibow/Essentials/tree/macos

At some point we may merge that fork into this repo, but there is nothing on paper just yet.

CrosswiredStudios commented 5 years ago

That works for us as long as we can keep that branch in sync with master :) Im in the middle of converting our xamarin native app to forms and the more shared code the better.

sushihangover commented 4 years ago

@mattwood2855

@mattwood2855 at this time, we are not doing much for macOS, but I am trying to get together the APIs so we can discuss a merge. You can open a PR on this fork: https://github.com/mattleibow/Essentials/tree/macos

At some point we may merge that fork into this repo, but there is nothing on paper just yet.

Matt,

I am working with VSfM and have read the FAQ:

But when setting "TargetFrameworks" to "Xamarin.Mac" and running: msbuild /restore Xamarin.Essentials/Xamarin.Essentials.csproj

I get "The specified language targets for Xamarin.Mac is missing. Ensure correct tooling is installed for 'Xamarin.Mac'. " (I have latest Xamarin/Mono/MSBuild installed).

"/Volumes/Code/code/github/Essentials/Xamarin.Essentials/Xamarin.Essentials.csproj" (default target) (1:11) ->
"/Volumes/Code/code/github/Essentials/Xamarin.Essentials/Xamarin.Essentials.csproj" (Build target) (1:12) ->
(_ShowMissingLanguageTargetsError target) ->
  /Users/Sushi/.nuget/packages/msbuild.sdk.extras/1.6.60/Build/LanguageTargets/CheckMissing.targets(36,5): error : The specified language targets for Xamarin.Mac is missing. Ensure correct tooling is installed for 'Xamarin.Mac'. Missing: '/Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets' [/Volumes/Code/code/github/Essentials/Xamarin.Essentials/Xamarin.Essentials.csproj]

I must be missing a step somewhere. The only line in Xamarin.Essentials.csproj that I changed is:

<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">Xamarin.Mac</TargetFrameworks>

Is there some other <Import ... /> block that I need to change/add?

Thanks for any help you can provide (and thanks for making your repo w/ the macOS code available)

-Robert