File tree Expand file tree Collapse file tree 2 files changed +44
-31
lines changed Expand file tree Collapse file tree 2 files changed +44
-31
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
2
+ import groovy.lang.Closure
3
+ import org.gradle.kotlin.dsl.extra
4
+
5
+ plugins {
6
+ `java- library`
7
+ idea
8
+ }
9
+
10
+ val minJavaVersionForTests by extra(JavaVersion .VERSION_17 )
11
+
12
+ apply (from = " $rootDir /gradle/java.gradle" )
13
+
14
+ dependencies {
15
+ implementation(libs.slf4j)
16
+ implementation(project(" :internal-api" ))
17
+ implementation(libs.jnr.unixsocket)
18
+ testImplementation(files(sourceSets[" main_java17" ].output))
19
+ }
20
+
21
+ tasks.named<CheckForbiddenApis >(" forbiddenApisMain_java17" ) {
22
+ failOnMissingClasses = false
23
+ }
24
+
25
+ fun AbstractCompile.setJavaVersion (javaVersionInteger : Int ) {
26
+ (project.extra.get(" setJavaVersion" ) as Closure <* >).call(this , javaVersionInteger)
27
+ }
28
+
29
+ listOf (
30
+ tasks.named<JavaCompile >(" compileMain_java17Java" ),
31
+ tasks.named<JavaCompile >(" compileTestJava" ),
32
+ ).forEach {
33
+ it.configure {
34
+ setJavaVersion(17 )
35
+ sourceCompatibility = JavaVersion .VERSION_1_8 .toString()
36
+ targetCompatibility = JavaVersion .VERSION_1_8 .toString()
37
+ }
38
+ }
39
+
40
+ idea {
41
+ module {
42
+ jdkName = " 17"
43
+ }
44
+ }
You can’t perform that action at this time.
0 commit comments