Skip to content

Commit

Permalink
allow remote cache to be turned off
Browse files Browse the repository at this point in the history
  • Loading branch information
barnhill committed Feb 18, 2024
1 parent fb05411 commit eba6f80
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ gradleEnterprise {
}
}

val cacheUrl: String? = if (System.getenv("REMOTE_CACHE_URL") == null) extra["REMOTE_CACHE_URL"] as String else System.getenv("REMOTE_CACHE_URL")
val remoteCacheUrl: String? by extra
val cacheUrl: String? = if (System.getenv("REMOTE_CACHE_URL") == null) remoteCacheUrl as String else System.getenv("REMOTE_CACHE_URL")

if (cacheUrl != null) {
buildCache {
Expand All @@ -45,9 +46,12 @@ if (cacheUrl != null) {
if (isEnabled) {
println("Using remote build cache: $cacheUrl")
}

val remoteCacheUser: String? by extra
val remoteCachePass: String? by extra
credentials {
username = if (System.getenv("REMOTE_CACHE_USER") == null) extra["REMOTE_CACHE_USER"] as String else System.getenv("REMOTE_CACHE_USER")
password = if (System.getenv("REMOTE_CACHE_PASS") == null) extra["REMOTE_CACHE_PASS"] as String else System.getenv("REMOTE_CACHE_PASS")
username = if (System.getenv("REMOTE_CACHE_USER") == null) remoteCacheUser as String else System.getenv("REMOTE_CACHE_USER")
password = if (System.getenv("REMOTE_CACHE_PASS") == null) remoteCachePass as String else System.getenv("REMOTE_CACHE_PASS")
}
}
}
Expand Down

0 comments on commit eba6f80

Please sign in to comment.