From 12616f54197ef693517d885062b3fb9a8658ce46 Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Mon, 26 Jul 2021 14:06:48 -0400 Subject: [PATCH] Support for java 16 --- build.gradle | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 1819740..03a462c 100644 --- a/build.gradle +++ b/build.gradle @@ -6,9 +6,6 @@ group pGroup version '1.0' -sourceCompatibility = 8 - - sourceSets.main { java.srcDir("src/") resources.srcDir("assets/") @@ -31,6 +28,7 @@ jar { dependencies { + annotationProcessor 'com.github.Anuken:jabel:34e4c172e65b3928cd9eabe1993654ea79c409cd' compileOnly "com.github.Anuken.Arc:arc-core:$pMindustryVersion" compileOnly "com.github.Anuken.Mindustry:core:$pMindustryVersion" implementation 'org.hjson:hjson:3.0.0' @@ -57,3 +55,15 @@ task dexify(type: Jar) { } task buildDex dependsOn "build", "dexify" + +tasks.withType(JavaCompile){ + targetCompatibility = 8 + sourceCompatibility = JavaVersion.VERSION_16 + options.encoding = "UTF-8" + options.forkOptions.jvmArgs.addAll([ + '--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED', + '--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED' + ]) + options.compilerArgs.addAll(['--release', '8']) + compileJava.options.fork = true +} \ No newline at end of file