build.gradle.kts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. plugins {
  2. kotlin("jvm") version "2.3.0"
  3. id("com.gradleup.shadow") version "8.3.0"
  4. id("xyz.jpenilla.run-paper") version "2.3.1"
  5. }
  6. group = "io.stellarfrontier"
  7. version = "1.0-SNAPSHOT"
  8. repositories {
  9. mavenCentral()
  10. maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") {
  11. name = "spigotmc-repo"
  12. }
  13. }
  14. dependencies {
  15. compileOnly("org.spigotmc:spigot-api:1.21.11-R0.1-SNAPSHOT")
  16. implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
  17. implementation("org.java-websocket:Java-WebSocket:1.5.3")
  18. implementation("com.squareup.okhttp3:okhttp:4.10.0")
  19. implementation("com.google.code.gson:gson:2.10.1")
  20. }
  21. tasks {
  22. runServer {
  23. // Configure the Minecraft version for our task.
  24. // This is the only required configuration besides applying the plugin.
  25. // Your plugin's jar (or shadowJar if present) will be used automatically.
  26. minecraftVersion("1.21")
  27. }
  28. }
  29. val targetJavaVersion = 21
  30. kotlin {
  31. jvmToolchain(targetJavaVersion)
  32. }
  33. tasks.build {
  34. dependsOn("shadowJar")
  35. }
  36. tasks.register<Copy>("installPlugin") {
  37. dependsOn("shadowJar")
  38. from(tasks.shadowJar.flatMap { it.archiveFile })
  39. into(project.file("../testserver/plugins"))
  40. }
  41. tasks.processResources {
  42. val props = mapOf("version" to version)
  43. inputs.properties(props)
  44. filteringCharset = "UTF-8"
  45. filesMatching("plugin.yml") {
  46. expand(props)
  47. }
  48. }