Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Java.Interop] allow $(TargetFrameworkVersion) to be passed in #364

Merged
merged 1 commit into from
Aug 29, 2018

Conversation

jonathanpeppers
Copy link
Member

Context: dotnet/android#2105 (comment)

To build Java.Interop.csproj as MonoAndroid,v1.0, we need to set
the following properties:

<PropertyGroup>
    <TargetFrameworkIdentifier>MonoAndroid</TargetFrameworkIdentifier>
    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
    <TargetFrameworkRootPath>$(XAInstallPrefix)xbuild-frameworks</TargetFrameworkRootPath>
</PropertyGroup>

Currently it looks like $(TargetFrameworkVersion) is the only one we
can't modify downstream in xamarin-android.

Context: dotnet/android#2105 (comment)

To build `Java.Interop.csproj` as `MonoAndroid,v1.0`, we need to set
the following properties:

    <PropertyGroup>
        <TargetFrameworkIdentifier>MonoAndroid</TargetFrameworkIdentifier>
        <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
        <TargetFrameworkRootPath>$(XAInstallPrefix)xbuild-frameworks</TargetFrameworkRootPath>
    </PropertyGroup>

Currently it looks like `$(TargetFrameworkVersion)` is the only one we
can't modify downstream in `xamarin-android`.
@jonpryor
Copy link
Member

I'm torn here. :-(

On the one hand, I've long wanted to turn Mono.Android.dll into a PCL/.NETStandard library -- assuming that was possible, I haven't yet tried -- because:

  1. It's the future!!!!oneone!!!!eleventy!!!
  2. monodis Mono.Android.dll would actuall work.

(Never mind that monodis has been "replaced" with ikdasm; ikdasm is slow. monodis kinda/sorta works, if you override $MONO_PATH, but that's often flakey and fails at the drop of a hat due to mono/mscorlib mismatches.)

This PR moves us away from that idea. (Not permanently, of course, but it's the principal of the thing? Maybe?)

On the other hand...who knew that PCL/.NETStandard use would be so slow:

And the savings in build times for "Hello World", this is the Rebuild target:

  • Debug + PCL - 8.424s
  • Release + PCL - 13.651s
  • Debug + not PCL - 4.258s
  • Release + not PCL - 9.487s

Avoiding PCL's saves 30% (release) - 50% (debug). That's insane.

@jonathanpeppers
Copy link
Member Author

Yeah this looks like a huge percentage for “Hello World”, but a real app might have build times well over a minute. Then the ~5 sec saving isn’t quite so huge (but still good).

I also suspect the change won’t quite as dramatic if tested with a release build of our build tasks.

@jonpryor jonpryor merged commit 659711c into dotnet:master Aug 29, 2018
@jonathanpeppers jonathanpeppers deleted the tfv branch August 29, 2018 01:39
jonathanpeppers added a commit that referenced this pull request Sep 5, 2018
Context: http://work.devdiv.io/667174
Context: dotnet/android#2105
Context: 893562c

Turns Out™ that resolving PCL assemblies within Xamarin.Android is
not as fast as resolving `MonoAndroid`-profile assemblies; see commit
893562c, wherein we see that non-PCL use is 30-50% faster than PCL
assembly use -- shaving off ~4 seconds -- for unknown reasons.

Run with it: allow `Java.Interop.dll` to be built as a
`MonoAndroid,v1.0`-profile assembly in addition to a PCL.
To do this we need to allow `$(TargetFrameworkVersion)` to be
overridden "elsewhere" -- specifically in `Mono.Android.targets`
within the xamarin-android repo -- otherwise `Java.Interop.dll`
will be built for the *wrong* framework profile.
@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants