forked from junit-team/junit5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle.kts
135 lines (120 loc) · 4 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures
pluginManagement {
repositories {
gradlePluginPortal()
maven(url = "https://repo.gradle.org/gradle/enterprise-libs-release-candidates-local/")
}
plugins {
id("com.gradle.enterprise") version "3.6.2"
id("com.gradle.enterprise.test-distribution") version "2.1.1-rc-2"
id("com.gradle.common-custom-user-data-gradle-plugin") version "1.3"
id("net.nemerosa.versioning") version "2.14.0"
id("com.github.ben-manes.versions") version "0.39.0"
id("com.diffplug.spotless") version "5.12.5"
id("org.ajoberstar.git-publish") version "3.0.0"
kotlin("jvm") version "1.5.0"
// Check if workaround in documentation.gradle.kts can be removed when upgrading
id("org.asciidoctor.jvm.convert") version "3.3.2"
id("org.asciidoctor.jvm.pdf") version "3.3.2"
id("me.champeau.jmh") version "0.6.5"
id("io.spring.nohttp") version "0.0.8"
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
}
plugins {
id("com.gradle.enterprise")
id("com.gradle.enterprise.test-distribution")
id("com.gradle.common-custom-user-data-gradle-plugin")
}
val gradleEnterpriseServer = "https://ge.junit.org"
val isCiServer = System.getenv("CI") != null
val junitBuildCacheUsername: String? by extra
val junitBuildCachePassword: String? by extra
gradleEnterprise {
buildScan {
isCaptureTaskInputFiles = true
isUploadInBackground = !isCiServer
fun accessKeysAreMissingOrBlank() = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY").isNullOrBlank()
if (gradle.startParameter.isBuildScan || (isCiServer && accessKeysAreMissingOrBlank())) {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
} else {
server = gradleEnterpriseServer
publishAlways()
this as BuildScanExtensionWithHiddenFeatures
publishIfAuthenticated()
}
if (isCiServer) {
publishAlways()
termsOfServiceAgree = "yes"
}
obfuscation {
if (isCiServer) {
username { "github" }
} else {
hostname { null }
ipAddresses { emptyList() }
}
}
val enableTestDistribution = providers.gradleProperty("enableTestDistribution")
.forUseAtConfigurationTime()
.map(String::toBoolean)
.getOrElse(false)
if (enableTestDistribution) {
tag("test-distribution")
}
}
}
buildCache {
local {
isEnabled = !isCiServer
}
remote<HttpBuildCache> {
url = uri("$gradleEnterpriseServer/cache/")
isPush = isCiServer && !junitBuildCacheUsername.isNullOrEmpty() && !junitBuildCachePassword.isNullOrEmpty()
credentials {
username = junitBuildCacheUsername?.ifEmpty { null }
password = junitBuildCachePassword?.ifEmpty { null }
}
}
}
val javaVersion = JavaVersion.current()
require(javaVersion.isJava11Compatible) {
"The JUnit 5 build requires Java 11 or higher. Currently executing with Java ${javaVersion.majorVersion}."
}
rootProject.name = "junit5"
include("documentation")
include("junit-jupiter")
include("junit-jupiter-api")
include("junit-jupiter-engine")
include("junit-jupiter-migrationsupport")
include("junit-jupiter-params")
include("junit-platform-commons")
include("junit-platform-console")
include("junit-platform-console-standalone")
include("junit-platform-engine")
include("junit-platform-jfr")
include("junit-platform-launcher")
include("junit-platform-reporting")
include("junit-platform-runner")
include("junit-platform-suite")
include("junit-platform-suite-api")
include("junit-platform-suite-commons")
include("junit-platform-suite-engine")
include("junit-platform-testkit")
include("junit-vintage-engine")
include("platform-tests")
include("platform-tooling-support-tests")
include("junit-bom")
// check that every subproject has a custom build file
// based on the project name
rootProject.children.forEach { project ->
project.buildFileName = "${project.name}.gradle"
if (!project.buildFile.isFile) {
project.buildFileName = "${project.name}.gradle.kts"
}
require(project.buildFile.isFile) {
"${project.buildFile} must exist"
}
}
enableFeaturePreview("VERSION_CATALOGS")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")