Skip to content

Commit

Permalink
Align build cache config across builds (#7151)
Browse files Browse the repository at this point in the history
* Align build cache config across builds

* Add a reminder to synchronise buildCache config between builds
  • Loading branch information
3flex committed Apr 9, 2024
1 parent 6d0faa5 commit 42bd630
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
13 changes: 6 additions & 7 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
rootProject.name = "build-logic"

plugins {
id("com.gradle.develocity") version "3.17"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

Expand All @@ -14,17 +15,15 @@ dependencyResolutionManagement {

val isCiBuild = providers.environmentVariable("CI").isPresent

// Ensure buildCache config is kept in sync with all builds (root, build-logic & detekt-gradle-plugin)
buildCache {
local {
isEnabled = !isCiBuild
}
remote<HttpBuildCache> {
isPush = isCiBuild
remote(develocity.buildCache) {
server = "https://ge.detekt.dev"
isEnabled = true
url = uri("https://ge.detekt.dev/cache/")
credentials {
username = providers.environmentVariable("GRADLE_CACHE_USERNAME").orNull
password = providers.environmentVariable("GRADLE_CACHE_PASSWORD").orNull
}
val accessKey = System.getenv("DEVELOCITY_ACCESS_KEY")
isPush = isCiBuild && !accessKey.isNullOrEmpty()
}
}
12 changes: 5 additions & 7 deletions detekt-gradle-plugin/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ plugins {

val isCiBuild = providers.environmentVariable("CI").isPresent

// Ensure buildCache config is kept in sync with all builds (root, build-logic & detekt-gradle-plugin)
buildCache {
local {
isEnabled = !isCiBuild
}
remote<HttpBuildCache> {
isPush = isCiBuild
remote(develocity.buildCache) {
server = "https://ge.detekt.dev"
isEnabled = true
url = uri("https://ge.detekt.dev/cache/")
credentials {
username = providers.environmentVariable("GRADLE_CACHE_USERNAME").orNull
password = providers.environmentVariable("GRADLE_CACHE_PASSWORD").orNull
}
val accessKey = System.getenv("DEVELOCITY_ACCESS_KEY")
isPush = isCiBuild && !accessKey.isNullOrEmpty()
}
}
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ develocity {
}
}

// Ensure buildCache config is kept in sync with all builds (root, build-logic & detekt-gradle-plugin)
buildCache {
local {
isEnabled = !isCiBuild
}
remote(develocity.buildCache) {
server = "https://ge.detekt.dev"
isEnabled = true
val accessKey = System.getenv("DEVELOCITY_ACCESS_KEY")
isPush = isCiBuild && !accessKey.isNullOrEmpty()
Expand Down

0 comments on commit 42bd630

Please sign in to comment.