From 4f461da56d7bd1df326cc138dfd6ad4cdbcae747 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Wed, 11 Oct 2023 13:47:17 +0300 Subject: [PATCH 1/3] Add `SkipAndroidAPK` property to allow skipping producing an APK --- .../targets/Microsoft.Android.Sdk.BuildOrder.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets index 24d8d93c9c4..c73ee2091fc 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets @@ -34,7 +34,7 @@ properties that determine build ordering. Outside IDEs: we need to produce an .apk/.aab and sign Inside IDEs: the Install target produces .apk/.aab files & signs --> - + $(BuildDependsOn); _CopyPackage; _Sign; From d508e4625552a6a832b3332c4005650af8b78770 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Wed, 11 Oct 2023 15:11:41 +0300 Subject: [PATCH 2/3] Rename property --- .../targets/Microsoft.Android.Sdk.BuildOrder.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets index c73ee2091fc..3eee32baa64 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets @@ -34,7 +34,7 @@ properties that determine build ordering. Outside IDEs: we need to produce an .apk/.aab and sign Inside IDEs: the Install target produces .apk/.aab files & signs --> - + $(BuildDependsOn); _CopyPackage; _Sign; From 1e9f588c3bfba1c472afe2cdd742b87ea5b795f6 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Wed, 11 Oct 2023 15:19:02 +0300 Subject: [PATCH 3/3] Update build-properties.md --- Documentation/guides/building-apps/build-properties.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/guides/building-apps/build-properties.md b/Documentation/guides/building-apps/build-properties.md index be7378f3c1a..a8551c26151 100644 --- a/Documentation/guides/building-apps/build-properties.md +++ b/Documentation/guides/building-apps/build-properties.md @@ -16,6 +16,11 @@ MSBuild properties control the behavior of the They're specified within the project file, for example **MyApp.csproj**, within an [MSBuild PropertyGroup](/visualstudio/msbuild/propertygroup-element-msbuild). +## AndroidSkipBuildApk + +By default, building an Android project has a different behavior between IDE and command-line build. When building in VS, building an APK (as well as some aapt2 and Java-related targets) are skipped. +On command-line, they are not skipped. The property `AndroidSkipBuildApk` can be used in command-line builds to get a behavior similar to the one found in the IDE. For more information, see [dotnet build & publish docs](https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/OneDotNet.md#dotnet-build--publish). + ## AdbTarget The `$(AdbTarget)` property specifies the Android target device the