Skip to content

Conversation

@jpobst
Copy link
Contributor

@jpobst jpobst commented Jun 7, 2022

Fixes a parallel build issue in Xamarin.Android by adding a project reference to jnienv-gen.csproj from Java.Interop-MonoAndroid.csproj. This ensures jnienv-gen.exe is available when building Java.Interop-MonoAndroid.csproj.

Java.Interop-MonoAndroid.csproj is built via the <MSBuild> task and was previously called with global properties specifying MonoAndroid1.0 target framework.

    <PropertyGroup>
      <_GlobalProperties>
        JavaInteropProfile=Net45;
        XAInstallPrefix=$(XAInstallPrefix);
        TargetFrameworkIdentifier=MonoAndroid;
        TargetFrameworkVersion=v1.0;
        TargetFrameworkRootPath=$(XAInstallPrefix)xbuild-frameworks;
      </_GlobalProperties>
    </PropertyGroup>
    <MSBuild
        Projects="$(JavaInteropFullPath)\src\Java.Interop\Java.Interop-MonoAndroid.csproj"
        Properties="$(_GlobalProperties)"
    />

However these properties flow to the jnienv-gen build, causing it to build as monoandroid10 instead of net472.

Move the TargetFramework* global properties from Mono.Android.targets to regular properties in Java.Interop-MonoAndroid.csproj so they are not passed to jnienv-gen.csproj.

This project will now be called with:

      <_GlobalProperties>
        JavaInteropProfile=Net45;
        XAInstallPrefix=$(XAInstallPrefix);
      </_GlobalProperties>

XA Companion PR: dotnet/android#7068

@jpobst jpobst marked this pull request as ready for review June 7, 2022 21:49
@jpobst jpobst requested review from jonpryor and pjcollins June 7, 2022 21:49
@jonpryor jonpryor merged commit 51c3dae into main Jun 8, 2022
@jonpryor jonpryor deleted the parallel-xa branch June 8, 2022 18:45
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants