Skip to content

Commit b6c7985

Browse files
committed
Respect XDG_CONFIG_HOME environment variable
1 parent 201ac9f commit b6c7985

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,16 @@ jobs:
350350

351351
runs-on: ${{ matrix.runs-on }}
352352
steps:
353-
- uses: mxschmitt/action-tmate@v3 # FIXME
354353
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
355354
with:
356355
persist-credentials: false
357356
- name: Build and test
358357
run: ./Android/android.py ci --fast-ci ${{ matrix.arch }}-linux-android
359358

359+
# FIXME
360+
- if: ${{ failure() }}
361+
uses: mxschmitt/action-tmate@v3
362+
360363
build-ios:
361364
name: iOS
362365
needs: build-context

Android/testbed/app/build.gradle.kts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,11 @@ abstract class CreateEmulatorTask : DefaultTask() {
243243
}
244244

245245
private val avdDir by lazy {
246-
val userHome =
247-
System.getenv("ANDROID_USER_HOME") ?:
248-
(System.getProperty("user.home")!! + "/.android")
246+
// XDG_CONFIG_HOME is respected by both avdmanager and Gradle.
247+
val userHome = System.getenv("ANDROID_USER_HOME") ?: (
248+
(System.getenv("XDG_CONFIG_HOME") ?: System.getProperty("user.home")!!)
249+
+ "/.android"
250+
)
249251
File("$userHome/avd/gradle-managed", "$avdName.avd")
250252
}
251253

@@ -278,10 +280,6 @@ abstract class CreateEmulatorTask : DefaultTask() {
278280
if (!File(avdDir.parentFile.parentFile, iniName).renameTo(
279281
File(avdDir.parentFile, iniName)
280282
)) {
281-
// FIXME
282-
execOps.exec {
283-
commandLine("ls", "-lR", avdDir.parentFile.parentFile)
284-
}
285283
throw GradleException("Failed to rename $iniName")
286284
}
287285
}

0 commit comments

Comments
 (0)