Update and clean up Gradle files #2
No files matched your search
+46
-43
@@ -1,31 +1,27 @@
|
||||
import java.io.BufferedReader
|
||||
|
||||
plugins {
|
||||
id("com.gradleup.shadow") version "8.3.2" // Import shadow API.
|
||||
java // Tell gradle this is a java project.
|
||||
eclipse // Import eclipse plugin for IDE integration.
|
||||
kotlin("jvm") version "2.0.21" // Import kotlin jvm plugin for kotlin/java integration.
|
||||
kotlin("jvm") version "2.1.21"
|
||||
id("com.gradleup.shadow") version "8.3.2"
|
||||
eclipse
|
||||
}
|
||||
|
||||
java {
|
||||
// Declare java version.
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
group = "nl.skbotnl.areashop-hikari" // Declare bundle identifier.
|
||||
version = "1.1.4" // 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)
|
||||
val commitHash = Runtime
|
||||
.getRuntime()
|
||||
.exec(arrayOf("git", "rev-parse", "--short=10", "HEAD"))
|
||||
.let { process ->
|
||||
process.waitFor()
|
||||
val output = process.inputStream.use {
|
||||
it.bufferedReader().use(BufferedReader::readText)
|
||||
}
|
||||
process.destroy()
|
||||
output.trim()
|
||||
}
|
||||
}
|
||||
|
||||
val apiVersion = "1.19"
|
||||
|
||||
group = "nl.skbotnl.areashop-hikari"
|
||||
version = "$apiVersion-$commitHash"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -53,17 +49,9 @@ dependencies {
|
||||
implementation("com.ghostchu.quickshop.compatibility:common:5.2.0.7")
|
||||
}
|
||||
|
||||
tasks.withType<AbstractArchiveTask>().configureEach { // Ensure reproducible builds.
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
}
|
||||
|
||||
tasks.shadowJar {
|
||||
archiveClassifier.set("") // Use empty string instead of null
|
||||
from("LICENSE") {
|
||||
into("/")
|
||||
}
|
||||
minimize()
|
||||
val targetJavaVersion = 17
|
||||
kotlin {
|
||||
jvmToolchain(targetJavaVersion)
|
||||
}
|
||||
|
||||
tasks.build {
|
||||
@@ -74,20 +62,35 @@ tasks.jar {
|
||||
archiveClassifier.set("part")
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.compilerArgs.add("-parameters")
|
||||
options.compilerArgs.add("-Xlint:deprecation") // Triggers deprecation warning messages.
|
||||
options.encoding = "UTF-8"
|
||||
options.isFork = true
|
||||
tasks.shadowJar {
|
||||
archiveClassifier.set("")
|
||||
minimize()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(17)
|
||||
tasks.processResources {
|
||||
val props = mapOf(
|
||||
"version" to version,
|
||||
"apiVersion" to apiVersion
|
||||
)
|
||||
inputs.properties(props)
|
||||
filteringCharset = "UTF-8"
|
||||
filesMatching("plugin.yml") {
|
||||
expand(props)
|
||||
}
|
||||
|
||||
from("LICENSE") {
|
||||
into("/")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<AbstractArchiveTask>().configureEach {
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(17)
|
||||
languageVersion = JavaLanguageVersion.of(targetJavaVersion)
|
||||
vendor = JvmVendorSpec.GRAAL_VM
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
|
||||
}
|
||||
rootProject.name = "AreaShop-Hikari"
|
||||
|
||||
Reference in new issue
Block a user