-
Notifications
You must be signed in to change notification settings - Fork 552
[Mono.Android] Build latest stable version against netcoreapp3.1 #4419
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
Conversation
5628ee2
to
1368144
Compare
Adds `netstandard2.1` to the set of target frameworks that Mono.Android will build against in preparation for .NET 5.
6b1a0ca
to
5b6afce
Compare
New build is here, not sure what's up with the duplicate element error above |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
src/Mono.Android/Mono.Android.csproj
Outdated
@@ -30,6 +30,11 @@ | |||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | |||
</PropertyGroup> | |||
|
|||
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' "> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation here is "wonky".
Where should netcoreapp3.1 output go?
Rando thought that I'm trying in PR #4376: place netcoreapp3.1 output into $(topdir)\bin\Debug-netcoreapp3.1
.
Better idea -- unimplemented because I don't know the details -- is for files to be included in the .NET 5 support package to follow the appropriate directory structure of the .NET 5 support package. The problem is that I don't know what the directory structure should be...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can find the rough destination package paths here:
I like the idea of better mirroring this output, though there's a couple of questions/concerns. To do this we'll need to only build the latest stable version of Mono.Android.dll
when targeting netstandard2.1
, and not every supported version. We also ultimately need Mono.Android.dll
in both targeting and runtime packs, so we'll need to account for that in the future as well.
I'm not sure how much of this should be considered for this PR. I took a quick look at attempting to only build the latest Mono.Android.dll
question and didn't find a great quick solution to that, but we may want to dedicate time to that aspect now at least so that we don't bloat our build times unnecessarily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't netstandard2.1 too restrictive? You won't be able to use any newer APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the second target to netcoreapp3.1
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the indentation, and changed the output path to use the TargetFramework
for now, now that only the latest stable version will be built when targeting netcoreapp3.1
I think we can improve this in the future to better mirror the eventual pack layout once we're compiling against netcoreapp5.0 or net5.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do this we'll need to only build the latest stable version of
Mono.Android.dll
when targetingnetstandard2.1
, and not every supported version.
The intention is that net5-android will redistribute only API-R/API-30 Mono.Android.dll
, and not one for every previous $(TargetFrameworkVersion)
value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest changes ensure that we only build the $(AndroidLatestStableFrameworkVersion )
version of Mono.Android.dll
when targeting netcoreapp3.1
.
src/Mono.Android/Mono.Android.csproj
Outdated
@@ -73,6 +78,11 @@ | |||
</Reference> | |||
</ItemGroup> | |||
|
|||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' "> | |||
<ProjectReference Include="..\..\external\Java.Interop\src\Java.Interop\Java.Interop.csproj" /> | |||
<PackageReference Include="System.Drawing.Common" Version="4.7.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that this reference was only needed to ensure this attribute compiled successfully:
This raises another question though, should we still be including these typeforwards, and the System.Drawing
sources when targeting netstandard2.1
(or net5
in the future)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to remove the System.Drawing.Common
reference when targeting netcoreapp3.1
, however I'm still not sure if we should be including the sources/typeforwards when building against this TargetFramework.
@@ -13,6 +13,7 @@ abstract class LinuxDebianCommon : Linux | |||
new DebianLinuxProgram ("cli-common-dev"), | |||
new DebianLinuxProgram ("curl"), | |||
new DebianLinuxProgram ("devscripts"), | |||
new DebianLinuxProgram ("dotnet-sdk-3.1"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one problem with this dependency - it's not in standard Debian/Ubuntu/etc repositories, so it will fail on an unprepared Debian machine. I think we should at least handle failure to detect or install it with a descriptive error message pointing to the dotnet website with instructions on how to add the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this, it looks like this .NET Core 3.1 installation issue is happening on other PRs as well, we can look to address this issue in a separate PR.
31c3080
to
cdd5772
Compare
cdd5772
to
c6bdcbc
Compare
Commit message:
|
Adds
netcoreapp3.1
to the set of target frameworks that Mono.Androidwill build against in preparation for .NET 5. Additionally, the project build
will effectively be a no-op when targeting
netcoreapp3.1
if$(AndroidFrameworkVersion)
is not equal to$(AndroidLatestStableFrameworkVersion)