Skip to content

Commit 1763e45

Browse files
authored
update node20 handler for XamarinAndroidV1 (#19298)
1 parent 6696851 commit 1763e45

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3183
-12
lines changed

Tasks/XamarinAndroidV1/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"author": "Microsoft Corporation",
1313
"version": {
1414
"Major": 1,
15-
"Minor": 230,
15+
"Minor": 231,
1616
"Patch": 0
1717
},
1818
"demands": [

Tasks/XamarinAndroidV1/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"author": "Microsoft Corporation",
1313
"version": {
1414
"Major": 1,
15-
"Minor": 230,
15+
"Minor": 231,
1616
"Patch": 0
1717
},
1818
"demands": [
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Default|1.230.0
2-
Node20-225|1.230.1
1+
Default|1.231.0
2+
Node20-225|1.231.1
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
function Get-JavaDevelopmentKitPath{
2+
[CmdletBinding()]
3+
param(
4+
[string]$Version,
5+
[string]$Arch)
6+
7+
Trace-VstsEnteringInvocation $MyInvocation
8+
try {
9+
# Check for JDK
10+
$jdkKeyName;
11+
if ($Version -eq '1.8') {
12+
$jdkKeyName = "Software\JavaSoft\Java Development Kit\1.8"
13+
}
14+
ElseIf ($Version -eq '1.7') {
15+
$jdkKeyName = "Software\JavaSoft\Java Development Kit\1.7"
16+
}
17+
ElseIf ($Version -eq '1.6') {
18+
$jdkKeyName = "Software\JavaSoft\Java Development Kit\1.6"
19+
}
20+
if($Arch -eq 'x64') {
21+
$view = "Registry64"
22+
}
23+
ElseIf ($Arch -eq 'x86') {
24+
$view = "Registry32"
25+
}
26+
27+
$jdkPath;
28+
if (-not [string]::IsNullOrEmpty($jdkKeyName)) {
29+
$jdkPath = Get-RegistryValue -Hive 'LocalMachine' -View $view -KeyName $jdkKeyName -ValueName 'JavaHome'
30+
}
31+
32+
Write-Verbose "jdkPath from registry = $jdkPath"
33+
if ([string]::IsNullOrEmpty($jdkPath)) {
34+
$jdkVersionShort = $jdkVersion.Substring(2)
35+
$javaHomeEnvVariable = "JAVA_HOME_" + $jdkVersionShort + "_" + $jdkArchitecture
36+
Write-Verbose "javaHomeEnvVariable = $javaHomeEnvVariable"
37+
try {
38+
$jdkPath = (Get-Item env:$javaHomeEnvVariable).Value
39+
} catch {
40+
throw "Failed to find the specified JDK version. Please ensure the specified JDK version is installed on the agent and the environment variable $javaHomeEnvVariable exists and is set to the location of a corresponding JDK or use the [Java Tool Installer](https://go.microsoft.com/fwlink/?linkid=875287) task to install the desired JDK."
41+
}
42+
}
43+
44+
Write-Verbose "jdkPath from environment variable $javaHomeEnvVariable = $jdkPath"
45+
if ([string]::IsNullOrEmpty($jdkPath)) {
46+
throw "Failed to find the specified JDK version. Please ensure the specified JDK version is installed on the agent or use the [Java Tool Installer](https://go.microsoft.com/fwlink/?linkid=875287) task to install the desired JDK."
47+
}
48+
return $jdkPath
49+
} finally {
50+
Trace-VstsLeavingInvocation $MyInvocation
51+
}
52+
}
53+
54+
function Get-RegistryValue {
55+
[CmdletBinding()]
56+
param(
57+
[Parameter(Mandatory = $true)]
58+
[ValidateSet('CurrentUser', 'LocalMachine')]
59+
[string]$Hive,
60+
61+
[Parameter(Mandatory = $true)]
62+
[ValidateSet('Default', 'Registry32', 'Registry64')]
63+
[string]$View,
64+
65+
[Parameter(Mandatory = $true)]
66+
[string]$KeyName,
67+
68+
[string]$ValueName)
69+
70+
Write-Verbose "Checking: hive '$Hive', view '$View', key name '$KeyName', value name '$ValueName'"
71+
if ($View -eq 'Registry64' -and !([System.Environment]::Is64BitOperatingSystem)) {
72+
Write-Verbose "Skipping."
73+
return
74+
}
75+
76+
$baseKey = $null
77+
$subKey = $null
78+
try {
79+
# Open the base key.
80+
$baseKey = [Microsoft.Win32.RegistryKey]::OpenBaseKey($Hive, $View)
81+
82+
# Open the sub key as read-only.
83+
$subKey = $baseKey.OpenSubKey($KeyName, $false)
84+
85+
# Check if the sub key was found.
86+
if (!$subKey) {
87+
Write-Verbose "Key not found."
88+
return
89+
}
90+
91+
# Get the value.
92+
$value = $subKey.GetValue($ValueName)
93+
94+
# Check if the value was not found or is empty.
95+
if ([System.Object]::ReferenceEquals($value, $null) -or
96+
($value -is [string] -and !$value)) {
97+
98+
Write-Verbose "Value not found or is empty."
99+
return
100+
}
101+
102+
# Return the value.
103+
Write-Verbose "Found $($value.GetType().Name) value: '$value'"
104+
return $value
105+
} finally {
106+
# Dispose the sub key.
107+
if ($subKey) {
108+
$null = $subKey.Dispose()
109+
}
110+
111+
# Dispose the base key.
112+
if ($baseKey) {
113+
$null = $baseKey.Dispose()
114+
}
115+
}
116+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"loc.friendlyName": "Xamarin.Android",
3+
"loc.helpMarkDown": "[Weitere Informationen zu dieser Aufgabe](https://go.microsoft.com/fwlink/?LinkID=613728) oder [Xamarin Android-Dokumentation anzeigen](https://docs.microsoft.com/xamarin/android/)",
4+
"loc.description": "Android-App mit Xamarin erstellen",
5+
"loc.instanceNameFormat": "Xamarin.Android-Projekt $(project) erstellen",
6+
"loc.group.displayName.msbuildOptions": "MSBuild-Optionen",
7+
"loc.group.displayName.jdkOptions": "JDK-Optionen",
8+
"loc.input.label.project": "Projekt",
9+
"loc.input.help.project": "Der relative Pfad vom Repositorystamm der zu erstellenden Xamarin.Android-Projekte. Platzhalter können verwendet werden ([weitere Informationen](https://go.microsoft.com/fwlink/?linkid=856077)). Beispiel: \"**/*.csproj\" für alle CSPROJ-Dateien in sämtlichen Unterordnern. Das Projekt muss ein PackageForAndroid-Ziel aufweisen, wenn \"App-Paket erstellen\" ausgewählt ist.",
10+
"loc.input.label.target": "Ziel",
11+
"loc.input.help.target": "Erstellt diese Ziele in diesem Projekt. Trennen Sie mehrere Ziele mit einem Semikolon.",
12+
"loc.input.label.outputDir": "Ausgabeverzeichnis",
13+
"loc.input.help.outputDir": "Geben Sie optional das Ausgabeverzeichnis für den Build an, z. B. \"$(build.binariesDirectory)/bin/Release\".",
14+
"loc.input.label.configuration": "Konfiguration",
15+
"loc.input.label.createAppPackage": "App-Paket erstellen",
16+
"loc.input.help.createAppPackage": "Übergibt das Ziel (/t:PackageForAndroid) bei der Erstellung, um ein APK zu generieren.",
17+
"loc.input.label.clean": "Bereinigen",
18+
"loc.input.help.clean": "Übergibt das clean-Ziel (/t:clean) während des Buildvorgangs.",
19+
"loc.input.label.msbuildLocationMethod": "MSBuild",
20+
"loc.input.label.msbuildVersion": "MSBuild-Version",
21+
"loc.input.help.msbuildVersion": "Wenn die bevorzugte Version nicht gefunden werden kann, wird stattdessen die neueste gefundene Version verwendet. Unter macOS wird xbuild (Mono) oder MSBuild (Visual Studio für Mac) verwendet.",
22+
"loc.input.label.msbuildLocation": "MSBuild-Speicherort",
23+
"loc.input.help.msbuildLocation": "Geben Sie optional den Pfad zu MSBuild (unter Windows) oder xbuild (unter macOS) an.",
24+
"loc.input.label.msbuildArchitecture": "MSBuild-Architektur",
25+
"loc.input.help.msbuildArchitecture": "Geben Sie optional die auszuführende MSBuild-Architektur an (x86, x64).",
26+
"loc.input.label.msbuildArguments": "Zusätzliche Argumente",
27+
"loc.input.help.msbuildArguments": "Zusätzliche Argumente, die an MSBuild (unter Windows) oder xbuild (unter macOS) übergeben werden.",
28+
"loc.input.label.jdkSelection": "Für den Build zu verwendendes JDK auswählen",
29+
"loc.input.help.jdkSelection": "Wählen Sie das während des Buildvorgangs zu verwendende JDK aus, indem Sie eine JDK-Version auswählen, die während des Buildvorgangs erkannt wird, oder indem Sie manuell einen JDK-Pfad eingeben.",
30+
"loc.input.label.jdkVersion": "JDK-Version",
31+
"loc.input.help.jdkVersion": "Verwendet während des Buildvorgangs die ausgewählte JDK-Version.",
32+
"loc.input.label.jdkUserInputPath": "JDK-Pfad",
33+
"loc.input.help.jdkUserInputPath": "Verwendet die JDK-Version im angegebenen Pfad beim Buildvorgang.",
34+
"loc.input.label.jdkArchitecture": "JDK-Architektur",
35+
"loc.input.help.jdkArchitecture": "Geben Sie optional die JDK-Architektur an (x86, x64).",
36+
"loc.messages.LocateJVMBasedOnVersionAndArch": "JAVA_HOME für Java %s %s finden",
37+
"loc.messages.UnsupportedJdkWarning": "JDK 9 und JDK 10 werden nicht unterstützt. Wechseln Sie in Ihrem Projekt und Ihrer Pipeline zu einer neueren Version. Es wird versucht, die Erstellung mit JDK 11 durchzuführen...",
38+
"loc.messages.FailedToLocateSpecifiedJVM": "Die angegebene JDK-Version wurde nicht gefunden. Stellen Sie sicher, dass die angegebene JDK-Version auf dem Agent installiert und die Umgebungsvariable \"%s\" vorhanden und auf den Speicherort eines entsprechenden JDK festgelegt ist. Sie können auch die Aufgabe [Installer für Java-Tools](https://go.microsoft.com/fwlink/?linkid=875287) verwenden, um das gewünschte JDK zu installieren.",
39+
"loc.messages.NoMatchingProjects": "Es wurden keine Dateien gefunden, die %s entsprechen.",
40+
"loc.messages.XamarinAndroidBuildFailed": "%s\nWeitere Informationen hierzu finden Sie unter https://go.microsoft.com/fwlink/?LinkId=760847.",
41+
"loc.messages.XamarinAndroidSucceeded": "Xamarin.Android-Aufgabenausführung ohne Fehler abgeschlossen.",
42+
"loc.messages.MSB_BuildToolNotFound": "MSBuild oder Xbuild (Mono) wurden auf dem MacOS oder Linux-Agent nicht gefunden."
43+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"loc.friendlyName": "Xamarin.Android",
3+
"loc.helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613728) or [see the Xamarin Android documentation](https://docs.microsoft.com/xamarin/android/)",
4+
"loc.description": "Build an Android app with Xamarin",
5+
"loc.instanceNameFormat": "Build Xamarin.Android project $(project)",
6+
"loc.group.displayName.msbuildOptions": "MSBuild Options",
7+
"loc.group.displayName.jdkOptions": "JDK Options",
8+
"loc.input.label.project": "Project",
9+
"loc.input.help.project": "Relative path from repo root of Xamarin.Android project(s) to build. Wildcards can be used ([more information](https://go.microsoft.com/fwlink/?linkid=856077)). For example, `**/*.csproj` for all csproj files in all subfolders. The project must have a PackageForAndroid target if `Create App Package` is selected.",
10+
"loc.input.label.target": "Target",
11+
"loc.input.help.target": "Build these targets in this project. Use a semicolon to separate multiple targets.",
12+
"loc.input.label.outputDir": "Output directory",
13+
"loc.input.help.outputDir": "Optionally provide the output directory for the build. Example: $(build.binariesDirectory)/bin/Release.",
14+
"loc.input.label.configuration": "Configuration",
15+
"loc.input.label.createAppPackage": "Create app package",
16+
"loc.input.help.createAppPackage": "Passes the target (/t:PackageForAndroid) during build to generate an APK.",
17+
"loc.input.label.clean": "Clean",
18+
"loc.input.help.clean": "Passes the clean target (/t:clean) during build.",
19+
"loc.input.label.msbuildLocationMethod": "MSBuild",
20+
"loc.input.label.msbuildVersion": "MSBuild version",
21+
"loc.input.help.msbuildVersion": "If the preferred version cannot be found, the latest version found will be used instead. On macOS, xbuild (Mono) or MSBuild (Visual Studio for Mac) will be used.",
22+
"loc.input.label.msbuildLocation": "MSBuild location",
23+
"loc.input.help.msbuildLocation": "Optionally supply the path to MSBuild (on Windows) or xbuild (on macOS).",
24+
"loc.input.label.msbuildArchitecture": "MSBuild architecture",
25+
"loc.input.help.msbuildArchitecture": "Optionally supply the architecture (x86, x64) of MSBuild to run.",
26+
"loc.input.label.msbuildArguments": "Additional arguments",
27+
"loc.input.help.msbuildArguments": "Additional arguments passed to MSBuild (on Windows) or xbuild (on macOS).",
28+
"loc.input.label.jdkSelection": "Select JDK to use for the build",
29+
"loc.input.help.jdkSelection": "Pick the JDK to be used during the build by selecting a JDK version that will be discovered during builds or by manually entering a JDK path.",
30+
"loc.input.label.jdkVersion": "JDK version",
31+
"loc.input.help.jdkVersion": "Use the selected JDK version during build.",
32+
"loc.input.label.jdkUserInputPath": "JDK path",
33+
"loc.input.help.jdkUserInputPath": "Use the JDK version at specified path during build.",
34+
"loc.input.label.jdkArchitecture": "JDK architecture",
35+
"loc.input.help.jdkArchitecture": "Optionally supply the architecture (x86, x64) of JDK.",
36+
"loc.messages.LocateJVMBasedOnVersionAndArch": "Locate JAVA_HOME for Java %s %s",
37+
"loc.messages.UnsupportedJdkWarning": "JDK 9 and JDK 10 are out of support. Please switch to a later version in your project and pipeline. Attempting to build with JDK 11...",
38+
"loc.messages.FailedToLocateSpecifiedJVM": "Failed to find the specified JDK version. Please ensure the specified JDK version is installed on the agent and the environment variable '%s' exists and is set to the location of a corresponding JDK or use the [Java Tool Installer](https://go.microsoft.com/fwlink/?linkid=875287) task to install the desired JDK.",
39+
"loc.messages.NoMatchingProjects": "No files were found matching: %s.",
40+
"loc.messages.XamarinAndroidBuildFailed": "%s\nSee https://go.microsoft.com/fwlink/?LinkId=760847.",
41+
"loc.messages.XamarinAndroidSucceeded": "Xamarin.Android task execution completed with no errors.",
42+
"loc.messages.MSB_BuildToolNotFound": "MSBuild or xbuild (Mono) were not found on the macOS or Linux agent."
43+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"loc.friendlyName": "Xamarin.Android",
3+
"loc.helpMarkDown": "[Obtener más información acerca de esta tarea](https://go.microsoft.com/fwlink/?LinkID=613728) o [consultar la documentación de Xamarin.Android](https://docs.microsoft.com/xamarin/android/)",
4+
"loc.description": "Compilar una aplicación de Android con Xamarin",
5+
"loc.instanceNameFormat": "Compilar proyecto Xamarin.Android $(project)",
6+
"loc.group.displayName.msbuildOptions": "Opciones de MSBuild",
7+
"loc.group.displayName.jdkOptions": "Opciones de JDK",
8+
"loc.input.label.project": "Proyecto",
9+
"loc.input.help.project": "Ruta de acceso relativa de la raíz del repositorio de los proyectos Xamarin.Android que se van a compilar. Se pueden usar caracteres comodín ([más información](https://go.microsoft.com/fwlink/?linkid=856077)). Por ejemplo, \"**\\*.csproj\" para todos los archivos csproj de todas las subcarpetas. El proyecto debe tener un destino PackageForAndroid si se seleccionó \"Crear paquete de aplicación\".",
10+
"loc.input.label.target": "Destino",
11+
"loc.input.help.target": "Compile estos destinos en este proyecto. Use puntos y comas para separar distintos destinos.",
12+
"loc.input.label.outputDir": "Directorio de salida",
13+
"loc.input.help.outputDir": "Si quiere, proporcione el directorio de salida de la compilación. Ejemplo: $(build.binariesDirectory)/bin/Release.",
14+
"loc.input.label.configuration": "Configuración",
15+
"loc.input.label.createAppPackage": "Crear paquete de aplicación",
16+
"loc.input.help.createAppPackage": "Pasa el destino (/t:PackageForAndroid) durante la compilación para generar un APK.",
17+
"loc.input.label.clean": "Limpiar",
18+
"loc.input.help.clean": "Pasa el destino clean (/t:clean) durante la compilación.",
19+
"loc.input.label.msbuildLocationMethod": "MSBuild",
20+
"loc.input.label.msbuildVersion": "Versión de MSBuild",
21+
"loc.input.help.msbuildVersion": "Si no se encuentra la versión preferida, se usará la versión más reciente que se encuentre. En macOS, se usará xbuild (Mono) o MSBuild (Visual Studio para Mac).",
22+
"loc.input.label.msbuildLocation": "Ubicación de MSBuild",
23+
"loc.input.help.msbuildLocation": "Si quiere, proporcione la ruta de acceso a MSBuild (en Windows) o xbuild (en macOS).",
24+
"loc.input.label.msbuildArchitecture": "Arquitectura MSBuild",
25+
"loc.input.help.msbuildArchitecture": "Indique opcionalmente la arquitectura (x86, x64) de MSBuild que se va a ejecutar.",
26+
"loc.input.label.msbuildArguments": "Argumentos adicionales",
27+
"loc.input.help.msbuildArguments": "Argumentos adicionales pasados a MSBuild (en Windows) o xbuild (en macOS).",
28+
"loc.input.label.jdkSelection": "Seleccionar JDK que se va a usar para la compilación",
29+
"loc.input.help.jdkSelection": "Elija el JDK que se usará durante la compilación seleccionando una versión de JDK que se detectará durante las compilaciones o escribiendo manualmente una ruta de acceso de JDK.",
30+
"loc.input.label.jdkVersion": "Versión de JDK",
31+
"loc.input.help.jdkVersion": "Use la versión de JDK seleccionada durante la compilación.",
32+
"loc.input.label.jdkUserInputPath": "Ruta de acceso de JDK",
33+
"loc.input.help.jdkUserInputPath": "Use la versión del JDK en la ruta de acceso especificada durante la compilación.",
34+
"loc.input.label.jdkArchitecture": "Arquitectura JDK",
35+
"loc.input.help.jdkArchitecture": "Indique opcionalmente la arquitectura (x86, x64) de JDK.",
36+
"loc.messages.LocateJVMBasedOnVersionAndArch": "Buscar JAVA_HOME para Java %s %s",
37+
"loc.messages.UnsupportedJdkWarning": "JDK 9 y JDK 10 no tienen soporte técnico. Cambie a una versión posterior del proyecto y la canalización. Intentando compilar con JDK 11...",
38+
"loc.messages.FailedToLocateSpecifiedJVM": "No se encontró la versión de JDK especificada. Asegúrese de que dicha versión está instalada en el agente y de que la variable de entorno \"%s\" existe y está establecida en la ubicación de un JDK correspondiente. En caso contrario, use la tarea de [Instalador de herramientas de Java](https://go.microsoft.com/fwlink/?linkid=875287) para instalar el JDK deseado.",
39+
"loc.messages.NoMatchingProjects": "No se han encontrado archivos que coincidan con %s.",
40+
"loc.messages.XamarinAndroidBuildFailed": "%s\nVea https://go.microsoft.com/fwlink/?LinkId=760847.",
41+
"loc.messages.XamarinAndroidSucceeded": "La ejecución de la tarea de Xamarin.Android ha finalizado sin errores.",
42+
"loc.messages.MSB_BuildToolNotFound": "No se ha encontrado MSBuild o xbuild (Mono) en el agente de macOS o Linux."
43+
}

0 commit comments

Comments
 (0)