-
Notifications
You must be signed in to change notification settings - Fork 333
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
44 lines (36 loc) · 1.01 KB
/
build.gradle.kts
File metadata and controls
44 lines (36 loc) · 1.01 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
import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
import groovy.lang.Closure
import org.gradle.kotlin.dsl.extra
plugins {
`java-library`
idea
}
val minJavaVersionForTests by extra(JavaVersion.VERSION_17)
apply(from = "$rootDir/gradle/java.gradle")
dependencies {
implementation(libs.slf4j)
implementation(project(":internal-api"))
implementation(libs.jnr.unixsocket)
testImplementation(files(sourceSets["main_java17"].output))
}
tasks.named<CheckForbiddenApis>("forbiddenApisMain_java17") {
failOnMissingClasses = false
}
fun AbstractCompile.setJavaVersion(javaVersionInteger: Int) {
(project.extra.get("setJavaVersion") as Closure<*>).call(this, javaVersionInteger)
}
listOf(
tasks.named<JavaCompile>("compileMain_java17Java"),
tasks.named<JavaCompile>("compileTestJava"),
).forEach {
it.configure {
setJavaVersion(17)
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}
}
idea {
module {
jdkName = "17"
}
}