Created
October 14, 2024 11:45
-
-
Save gabrielfeo/419d6659a1afcb863b598b7f287b6dc1 to your computer and use it in GitHub Desktop.
Randomize Gradle remote cache path for benchmarking upload performance
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
// Randomizes the cache path so that builds always miss and push cache entries | |
// to the remote cache. Used to benchmark upload performance when making changes | |
// to a Develocity instance. Configuration cache must be disabled so that | |
// a random path is never re-used. | |
settingsEvaluated { settings -> | |
settings.with { | |
// This impl will only work with the Develocity build cache type | |
assert buildCache.remote.class.name.contains('com.gradle.develocity') | |
buildCache.remote.path = "cache/${UUID.randomUUID()}" | |
logger.lifecycle("[randomize-remote-cache-url] remote.path=${buildCache.remote.path}") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment