From 934489ae54f834d522b1bc3f66ed40e6d462620e Mon Sep 17 00:00:00 2001 From: kernitus <2789734+kernitus@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:56:43 +0100 Subject: [PATCH] build: configure gradle for kotlin --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- build.gradle.kts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 693ee31b..72756cfa 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,7 +7,7 @@ assignees: '' --- - ## Information diff --git a/build.gradle.kts b/build.gradle.kts index 0ca71ccf..8c5f26ac 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,6 +15,7 @@ val paperVersion: List = (property("gameVersions") as String) plugins { `java-library` + id("org.jetbrains.kotlin.jvm") version "1.9.10" id("com.github.johnrengelman.shadow") version "8.1.1" // For ingametesting //id("io.papermc.paperweight.userdev") version "1.5.10" @@ -47,6 +48,7 @@ repositories { } dependencies { + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") implementation("org.bstats:bstats-bukkit:3.0.2") // Shaded in by Bukkit compileOnly("io.netty:netty-all:4.1.106.Final") @@ -73,6 +75,7 @@ group = "kernitus.plugin.OldCombatMechanics" version = "2.0.5-beta" // x-release-please-version description = "OldCombatMechanics" + java { toolchain { // We can build with Java 17 but still support MC >=1.9 @@ -89,6 +92,12 @@ sourceSets { } } +tasks.withType { + kotlinOptions { + jvmTarget = "17" // Ensure compatibility with Java 17 + } +} + // Substitute ${pluginVersion} in plugin.yml with version defined above tasks.named("processResources") { inputs.property("pluginVersion", version)