-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
92 lines (76 loc) · 3.2 KB
/
build.gradle
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 static org.gradle.jvm.toolchain.JavaLanguageVersion.of
import static org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
import static org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0
plugins {
id 'org.jetbrains.kotlin.jvm'
id 'java-library'
}
allprojects {
pluginManager.withPlugin('java') {
java {
toolchain {
languageVersion = of(javaVersion)
// Configure Gradle to use IBM J9 JDK toolchain.
// (You will need to install J9 manually first.)
//vendor = JvmVendorSpec.IBM
//implementation = JvmImplementation.J9
// Configure Gradle to use Azul JDK toolchain.
//vendor = JvmVendorSpec.AZUL
}
}
}
pluginManager.withPlugin('org.jetbrains.kotlin.jvm') {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
compilerOptions {
languageVersion = KOTLIN_2_0
apiVersion = KOTLIN_2_0
jvmTarget = JVM_11
allWarningsAsErrors = true
freeCompilerArgs.addAll([
'-Xjvm-default=all'
])
}
}
}
}
configurations {
testingLibraries {
canBeConsumed = false
}
}
dependencies {
api "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.slf4j:slf4j-api:$slf4j_version"
testImplementation "org.assertj:assertj-core:$assertj_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_jupiter_version"
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testRuntimeOnly "org.apache.logging.log4j:log4j-slf4j2-impl:$log4j_version"
testRuntimeOnly "org.apache.logging.log4j:log4j-core:$log4j_version"
testingLibraries "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testingLibraries "org.slf4j:slf4j-simple:$slf4j_version"
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
javaLauncher = javaToolchains.launcherFor {
languageVersion = of(testJavaVersion)
}
doFirst {
// Prevent the project from creating temporary files outside of the build directory.
systemProperty 'java.io.tmpdir', buildDir.absolutePath
systemProperty 'java.security.manager', 'allow'
systemProperty 'java.security.policy', file('permissive.policy').toURI().toURL()
systemProperty 'test.gradle.user.home', gradle.gradleUserHomeDir.toURI().path
systemProperty 'test.gradle.home', gradle.gradleHomeDir.toURI().path
systemProperty 'test.project.dir', projectDir.toURI().path
systemProperty 'testing-libraries.path', configurations.testingLibraries.asPath
systemProperty 'org.slf4j.simpleLogger.defaultLogLevel', 'info'
systemProperty 'org.slf4j.simpleLogger.dateTimeFormat', 'yyyy-MM-dd HH:mm:ss:SSS Z'
systemProperty 'org.slf4j.simpleLogger.showDateTime', true
systemProperty 'org.slf4j.simpleLogger.showShortLogName', true
systemProperty 'org.slf4j.simpleLogger.showThreadName', false
}
}
wrapper {
gradleVersion = '8.8'
}