Skip to content

Commit 6e48f60

Browse files
[ci] set proper androidSdkRoot for macOS (#1154)
I'm still seeing the same error as bc19e52, and I noticed: -p:AndroidSdkDirectory=C:\Android\android-sdk Which is passed in on macOS... I setup the `androidSdkRoot` parameter to be set to this value on macOS: $(Agent.TempDirectory)/android-sdk I also moved the condition, so that `$ANDROID_SDK_ROOT` will be set. I also set `cleanDestinationDirectory: true` for the JDK
1 parent bc19e52 commit 6e48f60

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

azure-pipelines-public.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ stages:
3939
vmImage: macOS-15
4040
runDotnetNextTest: ${{ parameters.RunDotnetNextTest }}
4141
use1ESTemplate: false
42+
androidSdkRoot: $(Agent.TempDirectory)/android-sdk
4243

4344
- template: build/ci/stage-standard-tests.yml@self
4445
parameters:

build/ci/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ parameters:
99
runDotnetNextTest: false
1010
use1ESTemplate: true
1111
installAndroidDependencies: false
12+
androidSdkRoot: C:\Android\android-sdk
1213

1314
tools: # Additional .NET global tools to install
1415
- 'Cake.Tool': '5.0.0'
@@ -44,6 +45,7 @@ jobs:
4445
dotnetTools: ${{ parameters.tools }}
4546
runDotnetNextTest: ${{ parameters.runDotnetNextTest }}
4647
installAndroidDependencies: ${{ parameters.installAndroidDependencies }}
48+
androidSdkRoot: ${{ parameters.androidSdkRoot }}
4749

4850
- template: build-and-test.yml
4951
parameters:

build/ci/setup-environment.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ steps:
120120
-v:n -bl:output/install-android-dependencies.binlog
121121
retryCountOnTaskFailure: 3
122122

123-
- ${{ if eq(parameters.installAndroidDependencies, true) }}:
124-
- pwsh: |
125-
Write-Host "##vso[task.setvariable variable=ANDROID_SDK_ROOT]${{ parameters.androidSdkRoot }}"
126-
displayName: Set ANDROID_SDK_ROOT to ${{ parameters.androidSdkRoot }}
123+
- pwsh: |
124+
Write-Host "##vso[task.setvariable variable=ANDROID_SDK_ROOT]${{ parameters.androidSdkRoot }}"
125+
displayName: Set ANDROID_SDK_ROOT to ${{ parameters.androidSdkRoot }}
127126
127+
- ${{ if eq(parameters.installAndroidDependencies, true) }}:
128128
- pwsh: |
129129
$url = "https://aka.ms/download-jdk/microsoft-jdk-11.0.26-windows-x64.zip"
130130
if ($IsMacOS) {
@@ -144,3 +144,4 @@ steps:
144144
jdkSourceOption: LocalDirectory
145145
jdkFile: $(JDK_11_FILE_PATH)
146146
jdkDestinationDirectory: ${{ parameters.javaSdkRoot }}
147+
cleanDestinationDirectory: true

0 commit comments

Comments
 (0)