plugins { kotlin("jvm") version "2.1.20-Beta2" kotlin("plugin.serialization") version "2.1.10" id("com.github.johnrengelman.shadow") version "8.1.1" // add shadow plugin } group = "dev.solsynth" version = "1.0" repositories { mavenCentral() maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") { name = "spigotmc-repo" } maven("https://oss.sonatype.org/content/groups/public/") { name = "sonatype" } maven("https://jitpack.io") { name = "jitpack" } } dependencies { compileOnly("org.spigotmc:spigot-api:1.21.4-R0.1-SNAPSHOT") compileOnly("com.github.MilkBowl:VaultAPI:1.7") // These will be packaged into the shadow JAR implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1") implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1") implementation("com.squareup.okhttp3:okhttp:4.12.0") // Test dependencies testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") } val targetJavaVersion = 21 kotlin { jvmToolchain(targetJavaVersion) } // Configure the shadowJar task tasks { shadowJar { archiveClassifier.set("") // so that the shadow JAR replaces the “normal” JAR mergeServiceFiles() // Optionally relocate packages to avoid conflicts with other plugins // e.g. relocate("kotlin", "dev.solsynth.shadow.kotlin") } // Make “build” produce the shadow jar build { dependsOn(shadowJar) } processResources { val props = mapOf("version" to version) inputs.properties(props) filteringCharset = "UTF-8" filesMatching("plugin.yml") { expand(props) } } }