-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.gradle.kts
59 lines (47 loc) · 1.54 KB
/
settings.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import org.gradle.kotlin.dsl.support.serviceOf
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
pluginManagement {
includeBuild("gradle/plugins")
repositories {
gradlePluginPortal()
}
}
plugins {
id("com.gradle.develocity").version("3.18.1")
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.0.2"
}
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}
val isCI = providers.environmentVariable("CI").presence()
val isCC = gradle.serviceOf<BuildFeatures>().configurationCache.active.getOrElse(false)
require(!isCC || isCI.not().get() ) { "Configuration-Cache should be disabled on CI" }
develocity {
server = "https://ge.gradle.org"
buildScan {
uploadInBackground = isCI.not()
publishing.onlyIf { it.isAuthenticated }
obfuscation {
ipAddresses { addresses -> addresses.map { "0.0.0.0" } }
}
}
}
buildCache {
local {
isEnabled = true
}
remote(develocity.buildCache) {
server = "https://eu-build-cache.gradle.org"
isEnabled = true
val hasAccessKey = providers.environmentVariable("DEVELOCITY_ACCESS_KEY").map { it.isNotBlank() }.orElse(false)
isPush = hasAccessKey.zip(isCI) { accessKey, ci -> ci && accessKey }.get()
}
}
rootProject.name = "cucumber-companion"
include("gradle-plugin")
include("maven-plugin")
include("companion-generator")
fun Provider<*>.presence(): Provider<Boolean> = map { true }.orElse(false)
fun Provider<Boolean>.not(): Provider<Boolean> = map { !it }