-
Notifications
You must be signed in to change notification settings - Fork 201
/
build.gradle.kts
92 lines (81 loc) · 2.37 KB
/
build.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
import org.gradle.api.JavaVersion.VERSION_1_8
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
import org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
import org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.dokka) apply false
alias(libs.plugins.ktlint)
alias(libs.plugins.plugin.publish) apply false
alias(libs.plugins.versions)
`java-gradle-plugin`
`java-library`
groovy
}
allprojects {
configurations.configureEach {
resolutionStrategy {
preferProjectModules()
enableDependencyVerification()
}
}
}
subprojects {
tasks.withType<Jar>().configureEach {
manifest {
attributes(
"Implementation-Title" to properties["POM_NAME"].toString(),
"Implementation-Version" to properties["VERSION_NAME"].toString(),
"Built-By" to System.getProperty("user.name"),
"Built-JDK" to System.getProperty("java.version"),
"Built-Gradle" to gradle.gradleVersion,
)
}
}
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget.set(JVM_1_8)
}
}
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = VERSION_1_8.toString()
targetCompatibility = VERSION_1_8.toString()
options.apply {
compilerArgs = compilerArgs +
listOf(
"-Xlint:all",
"-Xlint:-processing",
)
encoding = "utf-8"
isFork = true
}
}
tasks.withType<GroovyCompile>().configureEach {
sourceCompatibility = VERSION_1_8.toString()
targetCompatibility = VERSION_1_8.toString()
options.apply {
compilerArgs = compilerArgs +
listOf(
"-Xlint:all",
"-Xlint:-processing",
)
encoding = "utf-8"
isFork = true
}
}
tasks.withType<Test>().configureEach {
testLogging {
exceptionFormat = FULL
showCauses = true
showExceptions = true
showStackTraces = true
showStandardStreams = true
events = setOf(PASSED, FAILED, SKIPPED)
}
val maxWorkerCount = gradle.startParameter.maxWorkerCount
maxParallelForks = if (maxWorkerCount < 2) 1 else maxWorkerCount / 2
}
}