Skip to content

Commit

Permalink
setup-jdk-variables ARM64 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jpobst committed Jan 14, 2025
1 parent f792b4e commit a29e99d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
parameters:
jdkMajorVersion: $(DefaultJavaSdkMajorVersion)
useAgentJdkPath: true
jdkMajorVersion: $(DefaultJavaSdkMajorVersion) # Generally 11|17|21
useAgentJdkPath: true # true to use preinstalled agent JDK, false to use 'android-toolchain/jdk-NN'

steps:
- pwsh: |
$agentOS="$(Agent.OS)"
$agentArch="$(Agent.OSArchitecture)"
$agentArch="$(Agent.OSArchitecture)" -eq "ARM64" ? "arm64" : "$(Agent.OSArchitecture)"
$jdkMajorVersion="${{ parameters.jdkMajorVersion }}"
$xaPrepareJdkPath="$env:HOME/android-toolchain/jdk-$jdkMajorVersion"
if ("$agentOS" -eq "Windows_NT") {
Expand Down
15 changes: 0 additions & 15 deletions build-tools/automation/yaml-templates/setup-test-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@ steps:
jdkMajorVersion: ${{ parameters.jdkMajorVersion }}
useAgentJdkPath: ${{ parameters.useAgentJdkPath }}

# If an explicit Java SDK path wasn't provided, choose JDK-17 for the appropriate architecture
- pwsh: |
Write-Host "##vso[task.setvariable variable=JI_JAVA_HOME]$env:JAVA_HOME_17_X64"
displayName: set JI_JAVA_HOME to JAVA_HOME_17_X64
condition: and(succeeded(), eq('${{ parameters.jdkTestFolder }}', ''), eq(variables['agent.osarchitecture'], 'X64'))

- pwsh: |
Write-Host "##vso[task.setvariable variable=JI_JAVA_HOME]$env:JAVA_HOME_17_arm64"
displayName: set JI_JAVA_HOME to JAVA_HOME_17_arm64
condition: and(succeeded(), eq('${{ parameters.jdkTestFolder }}', ''), eq(variables['agent.osarchitecture'], 'ARM64'))

- script: |
echo $(JI_JAVA_HOME)
displayName: print JI_JAVA_HOME

# Install latest .NET
- template: /build-tools/automation/yaml-templates/use-dot-net.yaml
parameters:
Expand Down

0 comments on commit a29e99d

Please sign in to comment.