-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build cache authorisation (#487)
* Change the way of remote build cache authorization. * Fixed build scan enabled flag
- Loading branch information
Showing
7 changed files
with
175 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
build-settings-logic/src/main/kotlin/atomicfu-develocity.settings.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// this is a settings convention plugin for Gradle Develocity | ||
|
||
// Based on https://github.com/JetBrains/kotlin/blob/c20f644ee4cd8d28b39b12ea5304b68c5639e531/repo/gradle-settings-conventions/develocity/src/main/kotlin/develocity.settings.gradle.kts | ||
// Because Atomicfu uses Composite Builds, Build Cache must be configured consistently on: | ||
// - the root settings.gradle.kts, | ||
// - and the settings.gradle.kts of any projects added with `pluginManagement { includedBuild("...") }` | ||
// The Content of this file should be kept in sync with the content at the end of: | ||
// `build-settings-logic/settings.gradle.kts` | ||
// useful links: | ||
// - develocity: https://docs.gradle.com/develocity/gradle-plugin/ | ||
// - build cache: https://docs.gradle.org/8.4/userguide/build_cache.html#sec:build_cache_composite | ||
plugins { | ||
id("com.gradle.develocity") | ||
} | ||
|
||
develocity { | ||
val buildScanEnabled = buildScanEnabled.get() | ||
if (buildScanEnabled) { | ||
val overriddenName = buildScanUsername.orNull | ||
server = "https://ge.jetbrains.com/" | ||
buildScan { | ||
publishing.onlyIf { buildScanEnabled } | ||
capture { | ||
fileFingerprints = buildScanEnabled | ||
buildLogging = buildScanEnabled | ||
uploadInBackground = buildScanEnabled | ||
} | ||
obfuscation { | ||
ipAddresses { _ -> listOf("0.0.0.0") } | ||
hostname { _ -> "concealed" } | ||
username { originalUsername -> | ||
when { | ||
buildingOnTeamCity -> "TeamCity" | ||
buildingOnGitHub -> "GitHub" | ||
buildingOnCi -> "CI" | ||
!overriddenName.isNullOrBlank() && overriddenName != DEFAULT_ATOMICFU_USER_NAME -> overriddenName | ||
overriddenName == DEFAULT_ATOMICFU_USER_NAME -> originalUsername | ||
else -> "unknown" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
buildCache { | ||
local { | ||
isEnabled = buildCacheLocalEnabled.get() | ||
if (buildCacheLocalDirectory.orNull != null) { | ||
directory = buildCacheLocalDirectory.get() | ||
} | ||
} | ||
remote(develocity.buildCache) { | ||
isPush = buildCachePushEnabled.get() | ||
} | ||
} |
66 changes: 0 additions & 66 deletions
66
build-settings-logic/src/main/kotlin/atomicfu-gradle-build-cache.settings.gradle.kts
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
build-settings-logic/src/main/kotlin/atomicfu-gradle-build-scan.settings.gradle.kts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters