Skip to content

[Java.Interop-MonoAndroid.csproj] Add ProjectReference to 'jnienv-gen'. #990

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
merged 1 commit into from
Jun 8, 2022

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 pjcollins and jonpryor 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.

3 participants