Skip to content

Commit c67fbb9

Browse files
committed
Merge branch 'main' into blazor-hang
* main: [Xamarin.Android.Build.Tasks] introduce Eol.targets for .NET 6 (dotnet#8047) [Xamarin.Android.Build.Tasks] Add $(_BindingsToolsLocation) to allow overriding binding tool binaries. (dotnet#8069) [tests] new test for provisioning JDKs (dotnet#8059) Localized file check-in by OneLocBuild Task (dotnet#8065) [AndroidDependenciesTests] Use platform-tools 34.0.3 (dotnet#8062) Bump to xamarin/Java.Interop/main@93c50fe (dotnet#8060) [Xamarin.Android.Build.Tasks] Update XA5300 text (dotnet#8057)
2 parents 49b7d63 + ee90ad9 commit c67fbb9

25 files changed

Lines changed: 166 additions & 52 deletions

.external

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
xamarin/monodroid:main@5aed7eddb3c02148297606da2b9e3ede6141f8f4
1+
xamarin/monodroid:main@dbc9c67e7bd45744e5174dd7e94e5b642418bef9
22
mono/mono:2020-02@6dd9def57ce969ca04a0ecd9ef72c0a8f069112d

Documentation/guides/messages/xa5300.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ be located during the build.
1515
This can be fixed on the command-line by overriding either the
1616
`$(AndroidSdkDirectory)` or `$(JavaSdkDirectory)` MSBuild properties:
1717

18+
```sh
19+
dotnet build -p:AndroidSdkDirectory=path/to/android/sdk -p:JavaSdkDirectory=path/to/jdk
20+
```
21+
22+
Instructions to manually install the Android SDK or Java SDK are at: <https://aka.ms/dotnet-android-install-sdk>
23+
1824
This can also be fixed [within Visual Studio options][vs-sdk].
1925

2026
Consider submitting a [bug][bug] if you are getting this failure under

external/Java.Interop

src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.ClassParse.targets

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ This file is only used by binding projects.
1818
Inputs="@(EmbeddedJar);@(EmbeddedReferenceJar);@(InputJar);@(ReferenceJar);@(_AndroidMSBuildAllProjects)"
1919
Outputs="$(ApiOutputFile)">
2020

21+
<PropertyGroup>
22+
<!-- Allow $(_BindingsToolsLocation) to override where to find class-parse/generator -->
23+
<_BindingsToolsLocation Condition=" '$(_BindingsToolsLocation)' == '' ">$(MonoAndroidToolsDirectory)</_BindingsToolsLocation>
24+
</PropertyGroup>
25+
2126
<ItemGroup>
2227
<_AndroidDocumentationPath Include="@(_JavaSourceJavadocXml)" />
2328
<_AndroidDocumentationPath Include="@(JavaDocIndex->'%(RootDir)\%(Directory)')" />
@@ -32,7 +37,7 @@ This file is only used by binding projects.
3237
SourceJars="@(EmbeddedJar);@(InputJar)"
3338
DocumentationPaths="@(_AndroidDocumentationPath)"
3439
NetCoreRoot="$(NetCoreRoot)"
35-
ToolPath="$(MonoAndroidToolsDirectory)"
40+
ToolPath="$(_BindingsToolsLocation)"
3641
ToolExe="$(ClassParseToolExe)"
3742
/>
3843
<BindingsGenerator
@@ -44,7 +49,7 @@ This file is only used by binding projects.
4449
ReferencedManagedLibraries="@(ReferencePath);@(ReferenceDependencyPaths)"
4550
MonoAndroidFrameworkDirectories="$(_XATargetFrameworkDirectories)"
4651
NetCoreRoot="$(NetCoreRoot)"
47-
ToolPath="$(MonoAndroidToolsDirectory)"
52+
ToolPath="$(_BindingsToolsLocation)"
4853
ToolExe="$(BindingsGeneratorToolExe)"
4954
Nullable="$(Nullable)"
5055
UseJavaLegacyResolver="$(_AndroidUseJavaLegacyResolver)"

src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ It is shared between "legacy" binding projects and .NET 5 projects.
5555
Inputs="$(ApiOutputFile);@(TransformFile);@(ReferencePath);@(ReferenceDependencyPaths);@(_AndroidMSBuildAllProjects)"
5656
Outputs="$(_GeneratorStampFile)">
5757

58+
<PropertyGroup>
59+
<!-- Allow $(_BindingsToolsLocation) to override where to find class-parse/generator -->
60+
<_BindingsToolsLocation Condition=" '$(_BindingsToolsLocation)' == '' ">$(MonoAndroidToolsDirectory)</_BindingsToolsLocation>
61+
</PropertyGroup>
62+
5863
<!-- Delete previous generated files if they still exist -->
5964
<RemoveDirFixed Directories="$(GeneratedOutputPath)" Condition="Exists ('$(GeneratedOutputPath)')" />
6065

@@ -87,7 +92,7 @@ It is shared between "legacy" binding projects and .NET 5 projects.
8792
MonoAndroidFrameworkDirectories="$(_XATargetFrameworkDirectories)"
8893
TypeMappingReportFile="$(GeneratedOutputPath)type-mapping.txt"
8994
NetCoreRoot="$(NetCoreRoot)"
90-
ToolPath="$(MonoAndroidToolsDirectory)"
95+
ToolPath="$(_BindingsToolsLocation)"
9196
ToolExe="$(BindingsGeneratorToolExe)"
9297
LangVersion="$(LangVersion)"
9398
EnableBindingStaticAndDefaultInterfaceMethods="$(AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods)"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!--
2+
***********************************************************************************************
3+
Eol.targets
4+
5+
Imported only by .NET 6 EOL projects, contains settings to force the error:
6+
7+
error NETSDK1202: The workload 'android' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.
8+
9+
Things to note:
10+
11+
* $(WarningsAsErrors) includes NETSDK1202
12+
* Force $(TargetPlatformVersion) to just be 21.0, to make it past early error messages
13+
* _ClearMissingWorkloads prevents undesired extra error messages
14+
15+
***********************************************************************************************
16+
-->
17+
<Project InitialTargets="_ClearMissingWorkloads">
18+
<PropertyGroup>
19+
<!-- Force NETSDK1202 to be an error -->
20+
<WarningsAsErrors>$(WarningsAsErrors);NETSDK1202</WarningsAsErrors>
21+
<!--
22+
Along with @(SdkSupportedTargetPlatformVersion), prevents the error:
23+
Microsoft.NET.TargetFrameworkInference.targets(229,5):
24+
error NETSDK1140: 31.0 is not a valid TargetPlatformVersion for android. Valid versions include:
25+
-->
26+
<TargetPlatformSupported>true</TargetPlatformSupported>
27+
<TargetPlatformVersion>21.0</TargetPlatformVersion>
28+
</PropertyGroup>
29+
<ItemGroup>
30+
<SdkSupportedTargetPlatformVersion Include="21.0" />
31+
<EolWorkload Include="android" Url="https://aka.ms/maui-support-policy" />
32+
</ItemGroup>
33+
<Target Name="_ClearMissingWorkloads">
34+
<!--
35+
Prevents the error:
36+
Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147:
37+
To build this project, the following workloads must be installed: wasm-tools-net6
38+
To install these workloads, run the following command: dotnet workload restore
39+
-->
40+
<ItemGroup>
41+
<MissingWorkloadPack Remove="@(MissingWorkloadPack)" />
42+
</ItemGroup>
43+
</Target>
44+
</Project>

src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '8.0')) " />
55
<Import Project="Sdk.targets" Sdk="Microsoft.Android.Sdk.net7"
66
Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '7.0')) " />
7-
<Import Project="Sdk.targets" Sdk="Microsoft.Android.Sdk.net6"
7+
<Import Project="Eol.targets" Sdk="Microsoft.Android.Sdk.net8"
88
Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) " />
99
</ImportGroup>
1010

@@ -16,7 +16,7 @@
1616
/>
1717
</ItemGroup>
1818

19-
<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '6.0')) ">
19+
<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '7.0')) ">
2020
<SdkSupportedTargetPlatformIdentifier Include="android" DisplayName="Android" />
2121
</ItemGroup>
2222
</Project>

src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,11 +881,13 @@ In this message, the term "handheld app" means "app for handheld devices."
881881
{3} - The Android SDK installer program name</comment>
882882
</data>
883883
<data name="XA5300_Android_SDK" xml:space="preserve">
884-
<value>Nepovedlo se najít adresář sady Android SDK. Zkontrolujte, jestli Správce sady Android SDK v sadě Visual Studio zobrazuje platnou instalaci. Pokud chcete použít vlastní cestu sady SDK pro sestavení z příkazového řádku, nastavte vlastnost AndroidSdkDirectory nástroje MSBuild na danou vlastní cestu.</value>
884+
<value>The Android SDK directory could not be found. Install the Android SDK by following the instructions at: https://aka.ms/dotnet-android-install-sdk
885+
To use a custom SDK path for a command line build, set the 'AndroidSdkDirectory' MSBuild property to the custom path.</value>
885886
<comment>The following terms should not be translated: AndroidSdkDirectory</comment>
886887
</data>
887888
<data name="XA5300_Java_SDK" xml:space="preserve">
888-
<value>Nepovedlo se najít adresář sady Java SDK. Zajistěte, aby byl v možnostech sady Visual Studio v části Android nakonfigurovaný platný adresář sady Java SDK. Pokud chcete použít vlastní cestu sady SDK pro sestavení z příkazového řádku, nastavte vlastnost JavaSdkDirectory nástroje MSBuild na danou vlastní cestu.</value>
889+
<value>The Java SDK directory could not be found. Install the Java SDK by following the instructions at: https://aka.ms/dotnet-android-install-sdk
890+
To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MSBuild property to the custom path.</value>
889891
<comment>The following terms should not be translated: JavaSdkDirectory</comment>
890892
</data>
891893
<data name="XA5301" xml:space="preserve">

src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,11 +881,13 @@ In this message, the term "handheld app" means "app for handheld devices."
881881
{3} - The Android SDK installer program name</comment>
882882
</data>
883883
<data name="XA5300_Android_SDK" xml:space="preserve">
884-
<value>Das Android SDK-Verzeichnis wurde nicht gefunden. Überprüfen Sie, ob der Android SDK-Manager in Visual Studio eine gültige Installation anzeigt. Legen Sie die MSBuild-Eigenschaft "AndroidSdkDirectory" auf den benutzerdefinierten Pfad fest, um einen benutzerdefinierten SDK-Pfad für einen Befehlszeilenbuild zu verwenden.</value>
884+
<value>The Android SDK directory could not be found. Install the Android SDK by following the instructions at: https://aka.ms/dotnet-android-install-sdk
885+
To use a custom SDK path for a command line build, set the 'AndroidSdkDirectory' MSBuild property to the custom path.</value>
885886
<comment>The following terms should not be translated: AndroidSdkDirectory</comment>
886887
</data>
887888
<data name="XA5300_Java_SDK" xml:space="preserve">
888-
<value>Das Java SDK-Verzeichnis wurde nicht gefunden. Überprüfen Sie, ob im Abschnitt "Android" der Visual Studio-Optionen ein gültiges Java SDK-Verzeichnis konfiguriert ist. Legen Sie die MSBuild-Eigenschaft "JavaSdkDirectory" auf den benutzerdefinierten Pfad fest, um einen benutzerdefinierten SDK-Pfad für einen Befehlszeilenbuild zu verwenden.</value>
889+
<value>The Java SDK directory could not be found. Install the Java SDK by following the instructions at: https://aka.ms/dotnet-android-install-sdk
890+
To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MSBuild property to the custom path.</value>
889891
<comment>The following terms should not be translated: JavaSdkDirectory</comment>
890892
</data>
891893
<data name="XA5301" xml:space="preserve">

src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,11 +881,13 @@ In this message, the term "handheld app" means "app for handheld devices."
881881
{3} - The Android SDK installer program name</comment>
882882
</data>
883883
<data name="XA5300_Android_SDK" xml:space="preserve">
884-
<value>No se encontró el directorio de Android SDK. Compruebe que el Administrador de Android SDK en Visual Studio muestre una instalación válida. Para usar una ruta de acceso de SDK personalizada para una compilación de línea de comandos, establezca la propiedad "AndroidSdkDirectory" de MSBuild en la ruta de acceso personalizada.</value>
884+
<value>The Android SDK directory could not be found. Install the Android SDK by following the instructions at: https://aka.ms/dotnet-android-install-sdk
885+
To use a custom SDK path for a command line build, set the 'AndroidSdkDirectory' MSBuild property to the custom path.</value>
885886
<comment>The following terms should not be translated: AndroidSdkDirectory</comment>
886887
</data>
887888
<data name="XA5300_Java_SDK" xml:space="preserve">
888-
<value>No se encontró el directorio del SDK de Java. Asegúrese de que la sección de Android de las opciones de Visual Studio tenga configurado un directorio válido del SDK de Java. Para usar una ruta de acceso del SDK personalizada para una compilación de línea de comandos, establezca la propiedad "JavaSdkDirectory" de MSBuild en la ruta de acceso personalizada.</value>
889+
<value>The Java SDK directory could not be found. Install the Java SDK by following the instructions at: https://aka.ms/dotnet-android-install-sdk
890+
To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MSBuild property to the custom path.</value>
889891
<comment>The following terms should not be translated: JavaSdkDirectory</comment>
890892
</data>
891893
<data name="XA5301" xml:space="preserve">

0 commit comments

Comments
 (0)