From: David ‘Bombe’ Roden Date: Sun, 25 Feb 2024 00:43:54 +0000 (+0100) Subject: 💚 Add more changes to build file for updating to Java 17 X-Git-Tag: v2~29 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=19b15af12cc9d62944ad2a3bec6fbd609ed16bd2;p=rhynodge.git 💚 Add more changes to build file for updating to Java 17 --- diff --git a/build.gradle b/build.gradle index 8f3874d..c25226b 100644 --- a/build.gradle +++ b/build.gradle @@ -17,6 +17,16 @@ plugins { apply plugin: "jacoco" apply plugin: "idea" +kotlin { + jvmToolchain(17) +} + +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(17)) + } +} + idea { project { languageLevel = "17" @@ -26,16 +36,11 @@ idea { group = "net.pterodactylus" version = "0.1" -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - repositories { mavenCentral() - jcenter() } dependencies { - implementation group: "org.jetbrains.kotlin", name: "kotlin-stdlib", version: kotlinVersion implementation group: "com.google.guava", name: "guava", version: "14.0-rc1" implementation group: "log4j", name: "log4j", version: "1.2.17" implementation group: "org.apache.httpcomponents", name: "httpclient", version: "4.4" @@ -55,16 +60,21 @@ dependencies { } task fatJar(type: Jar) { - baseName = project.name + "-all" - manifest { - attributes( - "Main-Class": "net.pterodactylus.rhynodge.engine.Starter" - ) - } - from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } - from { sourceSets.generated.resources.srcDirs } - with jar - dependsOn test + baseName = project.name + "-all" + manifest { + attributes( + "Main-Class": "net.pterodactylus.rhynodge.engine.Starter" + ) + } + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + from { sourceSets.generated.resources.srcDirs } + with jar + dependsOn test +} + +tasks.named('test') { + jvmArgs += "--add-opens=java.base/java.lang=ALL-UNNAMED" + jvmArgs += "--add-opens=java.base/java.util=ALL-UNNAMED" } task createVersion() { @@ -90,7 +100,7 @@ createVersion { } jacoco { - toolVersion = "0.7.6.201602180812" + toolVersion = "0.8.11" } /* vim: set ts=4 sw=4 et: */