From 2fcb1a51c1fb635d14af2cce9123a63e89d52c7f Mon Sep 17 00:00:00 2001 From: Gabriel Feo Date: Tue, 23 May 2023 21:32:15 +0100 Subject: [PATCH] Use a stable path for default HTTP cache dir (#71) Use the home directory as it's unpredictable when `tmpdir` contents are cleared. Makes it easier to identify when the cache max size is being hit, or a path isn't being properly cached. --- .../main/kotlin/com/gabrielfeo/gradle/enterprise/api/Config.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/main/kotlin/com/gabrielfeo/gradle/enterprise/api/Config.kt b/library/src/main/kotlin/com/gabrielfeo/gradle/enterprise/api/Config.kt index be1eca2b..21d0a1ed 100644 --- a/library/src/main/kotlin/com/gabrielfeo/gradle/enterprise/api/Config.kt +++ b/library/src/main/kotlin/com/gabrielfeo/gradle/enterprise/api/Config.kt @@ -134,7 +134,7 @@ data class Config( */ val cacheDir: File = env["GRADLE_ENTERPRISE_API_CACHE_DIR"]?.let(::File) - ?: File(System.getProperty("java.io.tmpdir"), "gradle-enterprise-api-kotlin-cache"), + ?: File(systemProperties["user.home"], ".gradle-enterprise-api-kotlin-cache"), /** * Max size of the HTTP cache. By default, uses environment variable