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

Mono: support Xamarin.Android #135

Closed
jonorossi opened this issue Feb 26, 2016 · 16 comments
Closed

Mono: support Xamarin.Android #135

jonorossi opened this issue Feb 26, 2016 · 16 comments

Comments

@jonorossi
Copy link
Member

@jamesathey I know you've been doing a lot of work to make this happen to unblock Moq also running on Xamarin.Android. I'd like for this to also make it into v4, do you know how much change is involved to get Android supported? Could you put together a list of what you think needs to happen? What capacity do you have to help execute to get this finally sorted over the next 2 months? I apoligise for the massive delays, there are some details of why in #90.

I want to make sure you are aware of the conditional compilation options we've added as part of the .NET Core work that might be immediately useful for the Android work, I really don't want to see another platform conditional compilation symbol.

Anyone else that is interested in Xamarin.Android support and can help out in any capacity feel free to jump in and contribute to the discussion of making this happen.

@jamesathey
Copy link

@jonorossi I'll have some capacity within the next 2 months.

There will only be a couple of places where you'll see #if ANDROID, and that's automatically defined by the compiler, so there won't be any new build configurations.

There should not be any #if MONOCS in the code when I'm done, because it's the runtime that matters for Desktop Mono vs. .NET, not the compiler used to make the assembly.

@jonorossi
Copy link
Member Author

Do you happen to know more than me about how the netstandard stuff will work for Xamarin, because with us supporting dotnet5.4 (I assume soon to be a netstandardx.x) it might mean the API is already there. Our Mono build for the netcore branch is broken, however we should be able to sort that out or upgrade Mono before merging back to master.

@jamesathey
Copy link

I probably don't know more than you about netstandard. If we're talking about building Castle's source code using Mono's mcs compiler, then the way to do that is to use the NET45 build configuration. At least in my fork, the resulting assembly is effectively the same using mcs or Microsoft's Csc.exe.

When it comes to running Castle on Mono, it only works well using Mono 4.2 or later. Even then, there are a couple of places where a runtime check for Unix is required to make it work correctly. That has nothing to do with the Mono runtime and everything to do with platform differences.

@jonorossi
Copy link
Member Author

I was thinking we'd eventually be able to use the Roslyn compiled netstandard assembly on Mono and Xamarin.Android.

I did a bunch of work late last year in master to get Mono 4.0.2 working, all the unit tests pass except those still left to do in #94.

@jamesathey
Copy link

@jonorossi I will look into using the Roslyn-compiled netstandard assembly. I take it that you want my pull requests to be based on netcore instead of master?

@jonorossi
Copy link
Member Author

At the moment all the changes are in the netcore branch, we aren't yet targeting the netstandard TFM since those are new and not supported by any tooling yet, but we are supporting dotnet5.4, which likely won't work with Xamarin.Android like netstandard should based on those docs, so we might be a little too early to use it via the new tooling.

@jeremymeng
Copy link
Contributor

@jamesathey @jonorossi
dotnet5.4 is becoming netstandard1.3 in RC2 (see this issue). According to the Net Platform Standard doc, netstandard1.3 would run on Xamarin platforms. Though I don't know whether there would be some delay for the Xamarin tooling to be ready.

@igatanasov
Copy link

Hi guys,

any plans to update to .net core 1.0.0 official release and also nuget package that target "netstandard1.3"?

@jonorossi
Copy link
Member Author

@igatanasov yes, I've just merged some changes to use the latest .NET Core preview tooling and RTM packages, the Castle Core alpha001 package already supports netstandard1.3. If you find any problems please create new issues or report back here if it just works, we'll be releasing a non-prerelease package very soon.

@jonorossi
Copy link
Member Author

@igatanasov I should also point out that our Mono build for the .NET Core branch currently has some failing unit tests and there are some other open issues. Without contributions I'm not going to be able to sort any more of those issues out and will be pushing them to post-4.0.0.

@igatanasov
Copy link

Hi @jonorossi ,

Can you share the issues so I can take a look at them and try to apply some fixes?

@jonorossi
Copy link
Member Author

@igatanasov
Copy link

Hi @jonorossi

i will review them and see where I can help you.

@jonorossi jonorossi changed the title Support Xamarin.Android Mono: support Xamarin.Android Jul 22, 2016
@jonorossi
Copy link
Member Author

@igatanasov have you had a chance to try out our beta that supports netstandard1.3 on Xamarin.Android?

@malachib
Copy link

malachib commented Aug 23, 2016

I tried it out on Xamarin.Android and it was a bit gruesome with all the doubling-up of framework assemblies, but I bet there's a way around that... I think you can specify platform as a framework?

That said, I have had some successes. ProxyGenerator passes my tests...

@jonorossi
Copy link
Member Author

It sounds like our .NET Standard 1.3 build worked for Xamarin.Android a year ago however the tooling wasn't great. I'm going to close this as we can't do much about the .NET tooling, however Microsoft acquiring Xamarin and heaps of work being done on .NET tooling over the last year have hopefully improved this situation.

Please report new specific defects if things don't work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants