94 lines
2.3 KiB
Kotlin
94 lines
2.3 KiB
Kotlin
plugins {
|
|
java // Tell gradle this is a java project.
|
|
id("io.github.goooler.shadow") version "8.1.8"
|
|
eclipse // Import eclipse plugin for IDE integration.
|
|
kotlin("jvm") version "1.9.23" // Import kotlin jvm plugin for kotlin/java integration.
|
|
}
|
|
|
|
java {
|
|
// Declare java version.
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
group = "net.trueog.nodespawnog" // Declare bundle identifier.
|
|
version = "3.0" // Declare plugin version (will be in .jar).
|
|
val apiVersion = "1.19" // Declare minecraft server target version.
|
|
|
|
tasks.named<ProcessResources>("processResources") {
|
|
val props = mapOf(
|
|
"version" to version,
|
|
"apiVersion" to apiVersion
|
|
)
|
|
|
|
inputs.properties(props) // Indicates to rerun if version changes.
|
|
|
|
filesMatching("plugin.yml") {
|
|
expand(props)
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
|
|
maven {
|
|
url = uri("https://repo.purpurmc.org/snapshots")
|
|
}
|
|
|
|
maven {
|
|
|
|
url = uri("https://repo.codemc.org/repository/maven-public/") // Get NBT-API from codemc maven repository.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT") // Declare purpur API version to be packaged.
|
|
compileOnly("io.github.miniplaceholders:miniplaceholders-api:2.2.3") // Import MiniPlaceholders API.
|
|
implementation("de.tr7zw:item-nbt-api:2.11.1") // Declare NBT-API version to be packaged.
|
|
}
|
|
|
|
tasks.withType<AbstractArchiveTask>().configureEach {
|
|
isPreserveFileTimestamps = false
|
|
isReproducibleFileOrder = true
|
|
}
|
|
|
|
tasks.shadowJar {
|
|
exclude("io.github.miniplaceholders.*") // Exclude the MiniPlaceholders package from being shadowed.
|
|
relocate("de.tr7zw", "net.trueog.nodespawnog.item-nbt-api") // Prevent conflicts with other NBT-API utilizing plugins
|
|
minimize()
|
|
}
|
|
|
|
tasks.jar {
|
|
dependsOn(tasks.shadowJar)
|
|
archiveClassifier.set("part")
|
|
}
|
|
|
|
tasks.shadowJar {
|
|
archiveClassifier.set("") // Use empty string instead of null
|
|
from("LICENSE") {
|
|
into("/")
|
|
}
|
|
}
|
|
|
|
tasks.jar {
|
|
dependsOn("shadowJar")
|
|
}
|
|
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
options.compilerArgs.add("-parameters")
|
|
options.encoding = "UTF-8"
|
|
options.isFork = true
|
|
}
|
|
|
|
kotlin {
|
|
jvmToolchain(17)
|
|
}
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(17)
|
|
vendor = JvmVendorSpec.GRAAL_VM
|
|
}
|
|
}
|