-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
54 lines (48 loc) · 1.2 KB
/
build.gradle.kts
File metadata and controls
54 lines (48 loc) · 1.2 KB
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
plugins {
base
java
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
allprojects {
group = "com.networknt.light-bot"
version = "1.0"
repositories {
mavenLocal() // mavenLocal must be added first.
mavenCentral()
}
}
subprojects {
apply(plugin = "java")
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
// Configure all test tasks to not fail when no tests are discovered
afterEvaluate {
tasks.withType<Test>().configureEach {
val testTask = this
doFirst {
// Check if there are any test classes with actual test methods
val hasTests = testTask.testClassesDirs.files.any { dir ->
dir.walkTopDown().any { file ->
file.name.endsWith(".class")
}
}
if (!hasTests) {
testTask.exclude("**/*")
}
}
}
}
}