mirror of
https://github.com/corda/corda.git
synced 2025-05-21 01:37:41 +00:00
Re-add build cache configuration.
This commit is contained in:
parent
b47d5ec5c7
commit
d049f8a6f3
16
buildCacheSettings.gradle
Normal file
16
buildCacheSettings.gradle
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Gradle Build Cache configuration recommendation: https://docs.gradle.org/current/userguide/build_cache.html
|
||||||
|
ext {
|
||||||
|
isCiServer = System.getenv().containsKey("CORDA_CI")
|
||||||
|
gradleBuildCacheURL = System.getenv().containsKey("GRADLE_BUILD_CACHE_URL") ? System.getenv().get("GRADLE_BUILD_CACHE_URL") : 'http://localhost:5071/cache/'
|
||||||
|
}
|
||||||
|
|
||||||
|
buildCache {
|
||||||
|
local {
|
||||||
|
enabled = !isCiServer
|
||||||
|
}
|
||||||
|
remote(HttpBuildCache) {
|
||||||
|
enabled = isCiServer
|
||||||
|
url = gradleBuildCacheURL
|
||||||
|
push = isCiServer
|
||||||
|
}
|
||||||
|
}
|
@ -122,24 +122,8 @@ include 'common-logging'
|
|||||||
project(":common-logging").projectDir = new File("$settingsDir/common/logging")
|
project(":common-logging").projectDir = new File("$settingsDir/common/logging")
|
||||||
// Common libraries - end
|
// Common libraries - end
|
||||||
|
|
||||||
|
apply from: 'buildCacheSettings.gradle'
|
||||||
|
|
||||||
include 'detekt-plugins'
|
include 'detekt-plugins'
|
||||||
include 'tools:error-tool'
|
include 'tools:error-tool'
|
||||||
|
|
||||||
buildCache {
|
|
||||||
local { enabled = false }
|
|
||||||
remote(HttpBuildCache) {
|
|
||||||
url = "${gradleEnterpriseUrl}/cache/"
|
|
||||||
credentials {
|
|
||||||
username = settings.ext.find('BUILD_CACHE_CREDENTIALS_USR') ?: System.getenv('BUILD_CACHE_CREDENTIALS_USR')
|
|
||||||
password = settings.ext.find('BUILD_CACHE_CREDENTIALS_PSW') ?: System.getenv('BUILD_CACHE_CREDENTIALS_PSW')
|
|
||||||
}
|
|
||||||
if (System.getenv().containsKey("JENKINS_URL")) {
|
|
||||||
push = true
|
|
||||||
enabled = true
|
|
||||||
} else {
|
|
||||||
push = false
|
|
||||||
enabled = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user