Support Java 16 with Jabel

This commit is contained in:
Username404-59 2021-05-15 13:44:21 +02:00
parent 4805e81dbe
commit 9122d5f007
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1

View File

@ -109,7 +109,12 @@ allprojects {
dependencies {
implementation(kotlin("stdlib-jdk8", kotlinVer))
implementation(kotlin("reflect", kotlinVer))
annotationProcessor("com.github.bsideup.jabel:jabel-javac-plugin:0.3.0")
annotationProcessor("com.github.bsideup.jabel:jabel-javac-plugin:0.3.0") {
listOf("byte-buddy", "byte-buddy-agent").forEach {
exclude(module = it)
annotationProcessor("net.bytebuddy:$it:1.10.22")
} // Required for Java 16 support
}
}
tasks {
withType(ShadowJar::class) {
@ -140,6 +145,10 @@ allprojects {
encoding = "UTF-8"
isFork = true
// The following lines are required for Jabel:
forkOptions.jvmArgs!!.addAll(listOf(
"--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"
)) // Java 16+ support
compilerArgs.addAll(listOf("-Xplugin:jabel", "--release", javaVer))
}
}