forked from openrewrite/rewrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
78 lines (63 loc) · 2.14 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
plugins {
id("org.openrewrite.build.language-library")
id("jvm-test-suite")
}
val compiler = javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(8))
}
val tools = compiler.get().metadata.installationPath.file("lib/tools.jar")
dependencies {
compileOnly(files(tools))
compileOnly("org.slf4j:slf4j-api:1.7.+")
implementation(project(":rewrite-java"))
implementation("org.ow2.asm:asm:latest.release")
implementation("io.micrometer:micrometer-core:1.9.+")
testImplementation("org.junit.jupiter:junit-jupiter-api:latest.release")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:latest.release")
testImplementation(project(":rewrite-test"))
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
tasks.withType<JavaCompile>().configureEach {
options.isFork = true
options.release.set(null as? Int?) // remove `--release 8` set in `org.openrewrite.java-base`
}
tasks.withType<Test>().configureEach {
jvmArgs = listOf("-XX:+UnlockDiagnosticVMOptions", "-XX:+ShowHiddenFrames")
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(8))
})
}
tasks.withType<Javadoc>().configureEach {
executable = javaToolchains.javadocToolFor {
languageVersion.set(JavaLanguageVersion.of(8))
}.get().executablePath.toString()
}
testing {
suites {
val test by getting(JvmTestSuite::class)
register("compatibilityTest", JvmTestSuite::class) {
dependencies {
implementation(project())
implementation(project(":rewrite-java-tck"))
}
targets {
all {
testTask.configure {
useJUnitPlatform {
excludeTags("java11", "java17")
}
jvmArgs = listOf("-XX:+UnlockDiagnosticVMOptions", "-XX:+ShowHiddenFrames")
shouldRunAfter(test)
}
}
}
}
}
}
tasks.named("check") {
dependsOn(testing.suites.named("compatibilityTest"))
}