-
Notifications
You must be signed in to change notification settings - Fork 64
[Java.Interop, jnienv-gen] Add netcoreapp3.1 support #614
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1a30975 to
453cf0f
Compare
`Java.Interop.dll` is already a .NET Standard 2.0 library, which is already compatible with .NETCoreApp,Version=3.1. Why does it need to be built against `netcoreapp3.1` framework? Consistent Assembly References. `Java.Interop.dll` was originally a PCL, and before it became a .NET Standard 2.0 library in commit 85be94f, we added support to build `Java.Interop.dll` as a `MonoAndroid`-profile assembly in commit 893562c, as doing so reduced the assemblies referenced from the PCL version from 15 assemblies (`System.Runtime`, `System.Collections`, …) down to *3* assemblies: `mscorlib`, `System`, `System.Core`. Reducing the number of assemblies referenced improved build and deploy times. In the .NET Standard 2.0 world order, `Java.Interop.dll` now has *one* assembly reference: `netstandard`. However, within Xamarin.Android, `netstandard.dll` has 16 assembly references (as of mono/2020-02), which *might* matter, but very likely doesn't matter *that* much, as any large app will probably be pulling in .NET Standard libraries anyway. Why add `netcoreapp3.1` support to `Java.Interop.csproj`? While it's not strictly *needed*, it does increase consistency, replacing the `netstandard` assembly reference with "real" references which will be consistent with the [equivalent `Mono.Android.dll`][0]. To build `Java.Interop.dll` for `netcoreapp3.1`, also begin building `jnienv-gen` for netcoreapp3.1, and add the appropriate build system voodoo so that it can be executed. [0]: dotnet/android@e2854ee
453cf0f to
839ec73
Compare
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
Mar 27, 2020
Context: dotnet#4467 Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3590265&view=logs&j=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&t=7b19ceb3-907a-5a0d-b8ed-87e3f7335a58 When trying to integration test dotnet/java-interop#614, the `make all-tests` job fails: /usr/local/share/dotnet/sdk/2.2.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.1. [/Users/builder/azdo/_work/2/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop.csproj] Particularly odd about this is that we have an explicit job to install .NET Core 3.1.100, so why is .NET Core 2.2.402 being used at all?! Turns Out™ that while .NET Core 3.1.100 was installed, it was installed *into a different prefix*; from the `install .NET Core 3.1.100` job: ##[debug]set DOTNET_ROOT=/Users/builder/azdo/_work/_tool/dotnet and from the `make jenkins` job output: DOTNET_ROOT = /Users/builder/azdo/_work/_tool/dotnet Thus, the `install .NET Core 3.1.100` job is installing .NET Core into `$HOME/azdo/_work/_tool/_dotnet`, while `make all-tests` is only looking for .NET Core SDKs within `/usr/local/share/dotnet`, which does *not* contain .NET Core 3.1 at all. Where does the `make all-tests` path come from? It comes from `tools/xabuild`, which sets the `MSBuildSDKsPath` environment variable, and `xabuild` did not check `$DOTNET_ROOT`. Update `xabuild` so that `$DOTNET_ROOT` is also probed for .NET Core installation directories, and use the *latest* .NET Core SDK path found between `$DOTNET_ROOT` and `/usr/local/share/dotnet`.
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
Mar 27, 2020
Context: dotnet#4467 Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3590265&view=logs&j=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&t=7b19ceb3-907a-5a0d-b8ed-87e3f7335a58 When trying to integration test dotnet/java-interop#614, the `make all-tests` job fails: /usr/local/share/dotnet/sdk/2.2.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.1. [/Users/builder/azdo/_work/2/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop.csproj] Particularly odd about this is that we have an explicit job to install .NET Core 3.1.100, so why is .NET Core 2.2.402 being used at all?! Turns Out™ that while .NET Core 3.1.100 was installed, it was installed *into a different prefix*; from the `install .NET Core 3.1.100` job: ##[debug]set DOTNET_ROOT=/Users/builder/azdo/_work/_tool/dotnet and from the `make jenkins` job output: DOTNET_ROOT = /Users/builder/azdo/_work/_tool/dotnet Thus, the `install .NET Core 3.1.100` job is installing .NET Core into `$HOME/azdo/_work/_tool/dotnet`, while `make all-tests` is only looking for .NET Core SDKs within `/usr/local/share/dotnet`, which does *not* contain .NET Core 3.1 at all. Where does the `make all-tests` path come from? It comes from `tools/xabuild`, which sets the `MSBuildSDKsPath` environment variable, and `xabuild` did not check `$DOTNET_ROOT`. Update `xabuild` so that `$DOTNET_ROOT` is also probed for .NET Core installation directories, and use the *latest* .NET Core SDK path found between `$DOTNET_ROOT` and `/usr/local/share/dotnet`.
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
Mar 27, 2020
Context: dotnet#4467 Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3590265&view=logs&j=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&t=7b19ceb3-907a-5a0d-b8ed-87e3f7335a58 When trying to integration test dotnet/java-interop#614, the `make all-tests` job fails: /usr/local/share/dotnet/sdk/2.2.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.1. [/Users/builder/azdo/_work/2/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop.csproj] Particularly odd about this is that we have an explicit job to install .NET Core 3.1.100, so why is .NET Core 2.2.402 being used at all?! Turns Out™ that while .NET Core 3.1.100 was installed, it was installed *into a different prefix*; from the `install .NET Core 3.1.100` job: ##[debug]set DOTNET_ROOT=/Users/builder/azdo/_work/_tool/dotnet and from the `make jenkins` job output: DOTNET_ROOT = /Users/builder/azdo/_work/_tool/dotnet Thus, the `install .NET Core 3.1.100` job is installing .NET Core into `$HOME/azdo/_work/_tool/dotnet`, while `make all-tests` is only looking for .NET Core SDKs within `/usr/local/share/dotnet`, which does *not* contain .NET Core 3.1 at all. Where does the `make all-tests` path come from? It comes from `tools/xabuild`, which sets the `MSBuildSDKsPath` environment variable, and `xabuild` did not check `$DOTNET_ROOT`. Update `xabuild` so that `$DOTNET_ROOT` is also probed for .NET Core installation directories, and use the *latest* .NET Core SDK path found between `$DOTNET_ROOT` and `/usr/local/share/dotnet`.
jonpryor
added a commit
to dotnet/android
that referenced
this pull request
Mar 28, 2020
Context: #4467 Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3590265&view=logs&j=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&t=7b19ceb3-907a-5a0d-b8ed-87e3f7335a58 When trying to integration test dotnet/java-interop#614, the `make all-tests` job fails: /usr/local/share/dotnet/sdk/2.2.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.1. [/Users/builder/azdo/_work/2/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop.csproj] Particularly odd about this is that we have an explicit job to install .NET Core 3.1.100, so why is .NET Core 2.2.402 being used at all?! Turns Out™ that while .NET Core 3.1.100 was installed, it was installed *into a different prefix*; from the `install .NET Core 3.1.100` job: ##[debug]set DOTNET_ROOT=/Users/builder/azdo/_work/_tool/dotnet and from the `make jenkins` job output: DOTNET_ROOT = /Users/builder/azdo/_work/_tool/dotnet Thus, the `install .NET Core 3.1.100` job is installing .NET Core into `$HOME/azdo/_work/_tool/dotnet`, while `make all-tests` is only looking for .NET Core SDKs within `/usr/local/share/dotnet`, which does *not* contain .NET Core 3.1 at all. Where does the `make all-tests` path come from? It comes from `tools/xabuild`, which sets the `MSBuildSDKsPath` environment variable, and `xabuild` did not check `$DOTNET_ROOT`. Update `xabuild` so that `$DOTNET_ROOT` is also probed for .NET Core installation directories, and use the *latest* .NET Core SDK path found between `$DOTNET_ROOT` and `/usr/local/share/dotnet`.
jonpryor
added a commit
to dotnet/android
that referenced
this pull request
Mar 30, 2020
Context: #4467 Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3590265&view=logs&j=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&t=7b19ceb3-907a-5a0d-b8ed-87e3f7335a58 When trying to integration test dotnet/java-interop#614, the `make all-tests` job fails: /usr/local/share/dotnet/sdk/2.2.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.1. [/Users/builder/azdo/_work/2/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop.csproj] Particularly odd about this is that we have an explicit job to install .NET Core 3.1.100, so why is .NET Core 2.2.402 being used at all?! Turns Out™ that while .NET Core 3.1.100 was installed, it was installed *into a different prefix*; from the `install .NET Core 3.1.100` job: ##[debug]set DOTNET_ROOT=/Users/builder/azdo/_work/_tool/dotnet and from the `make jenkins` job output: DOTNET_ROOT = /Users/builder/azdo/_work/_tool/dotnet Thus, the `install .NET Core 3.1.100` job is installing .NET Core into `$HOME/azdo/_work/_tool/dotnet`, while `make all-tests` is only looking for .NET Core SDKs within `/usr/local/share/dotnet`, which does *not* contain .NET Core 3.1 at all. Where does the `make all-tests` path come from? It comes from `tools/xabuild`, which sets the `MSBuildSDKsPath` environment variable, and `xabuild` did not check `$DOTNET_ROOT`. Update `xabuild` so that `$DOTNET_ROOT` is also probed for .NET Core installation directories, and use the *latest* .NET Core SDK path found between `$DOTNET_ROOT` and `/usr/local/share/dotnet`.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Java.Interop.dllis already a .NET Standard 2.0 library, which isalready compatible with .NETCoreApp,Version=3.1. Why does it need to
be built against
netcoreapp3.1framework?Consistent Assembly References.
Java.Interop.dllwas originally a PCL, and before it became a.NET Standard 2.0 library in commit 85be94f, we added support to
build
Java.Interop.dllas aMonoAndroid-profile assembly in commit893562c, as doing so reduced the assemblies referenced from the PCL
version from 15 assemblies (
System.Runtime,System.Collections, …)down to 3 assemblies:
mscorlib,System,System.Core. Reducingthe number of assemblies referenced improved build and deploy times.
In the .NET Standard 2.0 world order,
Java.Interop.dllnow has oneassembly reference:
netstandard.However, within Xamarin.Android,
netstandard.dllhas 16 assemblyreferences (as of mono/2020-02), which might matter, but very likely
doesn't matter that much, as any large app will probably be pulling
in .NET Standard libraries anyway.
Why add
netcoreapp3.1support toJava.Interop.csproj? While it'snot strictly needed, it does increase consistency, replacing the
netstandardassembly reference with "real" references which will beconsistent with the equivalent
Mono.Android.dll.To build
Java.Interop.dllfornetcoreapp3.1, also begin buildingjnienv-genfor netcoreapp3.1, and add the appropriate build systemvoodoo so that it can be executed.