Skip to content

Commit

Permalink
allow building without remote cache
Browse files Browse the repository at this point in the history
  • Loading branch information
barnhill committed Feb 18, 2024
1 parent fd0dc46 commit 9636b6f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 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 else System.getenv("REMOTE_CACHE_URL")

if (cacheUrl != null) {
buildCache {
Expand All @@ -43,11 +44,14 @@ if (cacheUrl != null) {
isAllowUntrustedServer = true
isAllowInsecureProtocol = false
if (isEnabled) {
println("Using remote build cache: " + cacheUrl)
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 else System.getenv("REMOTE_CACHE_USER")
password = if (System.getenv("REMOTE_CACHE_PASS") == null) remoteCachePass else System.getenv("REMOTE_CACHE_PASS")
}
}
}
Expand Down

0 comments on commit 9636b6f

Please sign in to comment.