Skip to content

Commit

Permalink
build: configure gradle for kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
kernitus committed Dec 24, 2024
1 parent 35fe525 commit 934489a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''

---

<!-- Before reporting, please try the latest test version from https://ci.rayzr.dev/job/OldCombatMechanics/ as often bugs have already been fixed there. ->
<!-- Before reporting, please try the latest test version from https://ci.rayzr.dev/job/OldCombatMechanics/ as often bugs have already been fixed there. -->
<!-- Please fill out all fields as applicable, providing as many details as possible -->

## Information
Expand Down
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ val paperVersion: List<String> = (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"
Expand Down Expand Up @@ -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")
Expand All @@ -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
Expand All @@ -89,6 +92,12 @@ sourceSets {
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "17" // Ensure compatibility with Java 17
}
}

// Substitute ${pluginVersion} in plugin.yml with version defined above
tasks.named<Copy>("processResources") {
inputs.property("pluginVersion", version)
Expand Down

0 comments on commit 934489a

Please sign in to comment.