Skip to content
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

[Xamarin.Android.Build.Tasks] default to only 64-bit targets #9179

Merged
merged 5 commits into from
Aug 16, 2024

Conversation

jonathanpeppers
Copy link
Member

We currently build for all 4 Android architectures by default. While modern apps are more likely to run on android-arm64 modern devices or android-x64 default emulator on x64 machines.

Let's drop 32-bit targets by default, and let customers opt into them. This could significatly help Release build times, etc.

Customers could opt into all 4 by adding in their .csproj:

<RuntimeIdentifiers>android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers>

Or in the case of a multi-targeted .NET MAUI project:

<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers>

We currently build for all 4 Android architectures by default. While
modern apps are more likely to run on `android-arm64` modern devices
or `android-x64` default emulator on x64 machines.

Let's drop 32-bit targets by default, and let customers opt into them.
This could significatly help `Release` build times, etc.

Customers could opt into all 4 by adding in their `.csproj`:

    <RuntimeIdentifiers>android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers>

Or in the case of a multi-targeted .NET MAUI project:

    <RuntimeIdentifiers Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers>
@jonathanpeppers jonathanpeppers marked this pull request as ready for review August 15, 2024 19:47
Comment on lines -285 to -292
<Target Name=""_CheckAbis"" BeforeTargets=""_DefineBuildTargetAbis"">
<PropertyGroup>
<AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis>
<AndroidSupportedAbis Condition=""Exists('$(MSBuildThisFileDirectory)..\..\..\..\Debug\lib\xamarin.android\xbuild\Xamarin\Android\lib\arm64-v8a\libmono-android.release.so')"">$(AndroidSupportedAbis);arm64-v8a</AndroidSupportedAbis>
<AndroidSupportedAbis Condition=""Exists('$(MSBuildThisFileDirectory)..\..\..\..\Debug\lib\xamarin.android\xbuild\Xamarin\Android\lib\x86_64\libmono-android.release.so')"">$(AndroidSupportedAbis);x86_64</AndroidSupportedAbis>
</PropertyGroup>
<Message Text=""$(AndroidSupportedAbis)"" />
</Target>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is really old. It detected when we used to only build some of the ABIs on PRs. Think we can just remove this now.

@jonpryor jonpryor merged commit 6be8531 into dotnet:main Aug 16, 2024
57 checks passed
@jonathanpeppers jonathanpeppers deleted the drop-32-by-default branch August 16, 2024 19:18
@github-actions github-actions bot locked and limited conversation to collaborators Sep 16, 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.

2 participants