Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dotnet/java-interop
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b873e81
Choose a base ref
...
head repository: dotnet/java-interop
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9b390bc
Choose a head ref
  • 3 commits
  • 7 files changed
  • 1 contributor

Commits on Sep 5, 2018

  1. [build] option for Java.Interop to be built as non-PCL (#360)

    * [build] option for Java.Interop to be built as non-PCL
    
    Fixes: http://work.devdiv.io/667174
    
    When building a "Hello World" Xamarin.Android app, I noticed the
    following in the build log:
    
        Adding assembly reference for Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065, recursively...
            Adding assembly reference for System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.ComponentModel.Composition, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, recursively...
            Adding assembly reference for System.Diagnostics.Debug, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.Threading, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.Collections.Concurrent, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.Reflection, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.Linq.Expressions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.Reflection.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.Dynamic.Runtime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.ObjectModel, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.Linq, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.Runtime.InteropServices, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.Runtime.Extensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
            Adding assembly reference for System.Reflection.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, recursively...
        Adding assembly reference for Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065, recursively...
    
    It appears that Java.Interop is a PCL, and we end up having to work
    with lots of facade assemblies during our build!
    
    My thought is that we should build `Java.Interop.dll` the same as
    `Mono.Android.dll`:
    
        <PropertyGroup>
            <NoStdLib>true</NoStdLib>
        </PropertyGroup>
        <ItemGroup>
            <Reference Include="mscorlib">
                <HintPath>$(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\mscorlib.dll</HintPath>
                <Private>False</Private>
            </Reference>
            <Reference Include="System">
                <HintPath>$(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\System.dll</HintPath>
                <Private>False</Private>
            </Reference>
            <Reference Include="System.Core">
                <HintPath>$(XAInstallPrefix)xbuild-frameworks\MonoAndroid\v1.0\System.Core.dll</HintPath>
                <Private>False</Private>
            </Reference>
        </ItemGroup>
    
    I added a new property, `$(JavaInteropProfile)` we can set downstream
    in Xamarin.Android. We can set this with a
    `Configuration.Override.props` file that is already used in
    Xamarin.Android's build process.
    
    After doing this, the log now reads:
    
       Adding assembly reference for Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065, recursively...
       Adding assembly reference for Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065, recursively...
    
    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
    
    That does bring up a big question, however...
    
    Why are facade assemblies adding so much build time???
    
    This change is good: making `Java.Interop` have fewer dependencies.
    But I suspect there is more work to be done downstream in
    Xamarin.Android. I have a feeling referencing `netstandard` libraries
    cause the same problem to occur.
    
    * [build] $(JavaInteropProfile) now outputs to $(Configuration)Net45 folder
    
    This allows us to have two sets of outputs:
    - bin/Debug/Java.Interop.dll - referenced by MSBuild tasks
    - bin/DebugNet45/Java.Interop.dll - referenced by Mono.Android.dll and apps
    
    Other changes:
    - Fixed warning where file was getting imported twice
    - Updated `.gitignore` for `*.binlog` files
    
    * Whoops doc XML file was missing
    jonathanpeppers committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    c9c4e3c View commit details
    Browse the repository at this point in the history
  2. [Java.Interop] Allow $(TargetFrameworkVersion) to be overridden (#364)

    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.
    jonathanpeppers committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    a09932d View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2018

  1. [build] remove XAIntegrationDebug and XAIntegrationRelease (#361, #368)

    Context: dotnet/android#2157
    
    We believe that we need commit 80b4f4e -- which removes the
    `XAIntegrationDebug` and `XAIntegrationRelease` configurations --
    applied to xamarin/Java.Interop:d15-9 so that
    xamarin/xamarin-android:d15-9 will actually build.
    jonathanpeppers authored and jonpryor committed Sep 10, 2018
    Configuration menu
    Copy the full SHA
    9b390bc View commit details
    Browse the repository at this point in the history
Loading