Skip to content

Fix package for supported iOS/Android/UWP platforms#2378

Merged
ChrisMaddock merged 1 commit intomasterfrom
issue-2237
Aug 23, 2017
Merged

Fix package for supported iOS/Android/UWP platforms#2378
ChrisMaddock merged 1 commit intomasterfrom
issue-2237

Conversation

@ChrisMaddock
Copy link
Copy Markdown
Member

Fixes #2237

Unfortunately, I think we've been a bit liberal regarding adding new functionality to the .NET Standard builds, and assuming it will be available on all platforms. (Until I started looking in to this issue, I thought that was the POINT of .NET Standard - turns out it's not quite there yet.)

This PR includes a various changes to allow the package to be used on latest Android/iOS/UWP. I've upgraded and tested both the nunit.xamarin Android and UWP projects as a test. iOS I'm not set up to test, however NUnit 3.7.1 wasn't restoring in the same manner as the Android platform, so I assume the same fix applies. (NuGet now restores the package successfully, which it didn't previously.)

The first part of the issue, is that System.Runtime.Loader is available for .NET Standard 1.6, but not available on Android/iOS. To combat this, I altered the NuGet package to use the .NET Standard 1.3 build for these platforms, which doesn't have the System.Runtime.Loader dependency.

The next issue was that UWP doesn't support the System.Threading.Thread API, which was a dependency of NUnit's .NET Standard 1.3 build. Rather than create an entirely new build solely for UWP - I just removed the System.Threading.Thread dependency from .NET Standard 1.3. This is technically a breaking change - however given the build already wasn't working on the main platform we expect people to use the .NET Standard 1.3 build on - I don't think that's too much of a concern.

It would be good if we could test this stuff in CI. I had a quick experiment with the project.json, but couldn't get the build to fail - I don't have much more time to look in to that before the 3.8 release, so wanted to push this as is.

<file src="bin/netstandard13/nunit.framework.dll" target="lib\monoandroid" />
<file src="bin/netstandard13/nunit.framework.xml" target="lib\monoandroid" />
<file src="bin/netstandard13/nunit.framework.dll" target="lib\uap" />
<file src="bin/netstandard13/nunit.framework.xml" target="lib\uap" />
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

A separate UWP dir here isn't strictly necessary, as it would pull in the netstandard1.3 build anyway - but given the problems, I wanted to be explicit about the platforms we wanted to support.

@rprouse
Copy link
Copy Markdown
Member

rprouse commented Aug 23, 2017

This looks good to me. Thread related functionality was always intended to be part of the .NET Standard 1.6 build, not the 1.3 target and it was never available in the PCL which 1.3 replaces, so I think we are okay dropping it, especially since it isn't supported on the platforms that would likely pull in 1.3 anyway.

AppVeyor error is the typical .NET 3.5 message pump error. @jnm2 any chance you could look at that?

1) Failed : NUnit.Framework.Internal.ThreadUtilityTests.Kill
  Native message pump was not able to be interrupted to enable a managed thread abort.
  Expected: True
  But was:  False

The Travis build failure was another .NET 3.5 threading issue,

1) Failed : NUnit.Framework.Internal.Execution.TestWorkerTests.BusyExecuteIdleEventsCalledInSequence
  Expected: "BusyExecIdle" after 200 milliseconds delay
  But was:  <string.Empty>
  at NUnit.Framework.Internal.Execution.TestWorkerTests.BusyExecuteIdleEventsCalledInSequence () [0x0009f] in <a9dce29302ac4f1ba5dd3a44cd37ddc6>:0 

What is up with .NET 3.5? Both errors look unrelated to me.

@rprouse
Copy link
Copy Markdown
Member

rprouse commented Aug 23, 2017

New builds kicked off ☹️

@ChrisMaddock
Copy link
Copy Markdown
Member Author

Merging, based on Robs comments.

@ChrisMaddock ChrisMaddock merged commit a348201 into master Aug 23, 2017
@ChrisMaddock ChrisMaddock deleted the issue-2237 branch August 23, 2017 19:23
@jnm2
Copy link
Copy Markdown
Contributor

jnm2 commented Aug 25, 2017

Wow Chris, cool! 🎉

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.

System.Runtime.Loader not available for iOS/Android

3 participants