Update gradle to 8.14.2, add auto formatting
This commit is contained in:
1 parent
aa6103c323
commit
52139596da
4 files changed
+61
-76
No files matched your search
+57
-70
@@ -1,109 +1,96 @@
|
||||
import java.io.BufferedReader
|
||||
|
||||
plugins {
|
||||
id("com.gradleup.shadow") version "8.3.6" // Import shadow API.
|
||||
java // Tell gradle this is a java project.
|
||||
eclipse // Import eclipse plugin for IDE integration.
|
||||
kotlin("jvm") version "2.1.21" // Import kotlin jvm plugin for kotlin/java integration.
|
||||
id("com.diffplug.spotless") version "7.0.4" // Import auto-formatter.
|
||||
id("com.gradleup.shadow") version "8.3.6" // Import shadow API.
|
||||
eclipse // Import eclipse plugin for IDE integration.
|
||||
}
|
||||
|
||||
val commitHash = Runtime
|
||||
.getRuntime()
|
||||
.exec(arrayOf("git", "rev-parse", "--short=10", "HEAD"))
|
||||
.let { process ->
|
||||
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)
|
||||
}
|
||||
val output = process.inputStream.use { it.bufferedReader().use(BufferedReader::readText) }
|
||||
process.destroy()
|
||||
output.trim()
|
||||
}
|
||||
|
||||
group = "nl.skbotnl.shopbridge-og" // Declare bundle identifier.
|
||||
|
||||
version = "1.1.6" // 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
|
||||
)
|
||||
val props = mapOf("version" to version, "apiVersion" to apiVersion)
|
||||
|
||||
inputs.properties(props) // Indicates to rerun if version changes.
|
||||
|
||||
filesMatching("plugin.yml") {
|
||||
expand(props)
|
||||
filesMatching("plugin.yml") { expand(props) }
|
||||
from("LICENSE") { // Bundle license into .jars.
|
||||
into("/")
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
maven {
|
||||
url = uri("https://repo.purpurmc.org/snapshots")
|
||||
}
|
||||
maven {
|
||||
url = uri("https://repo.purpurmc.org/snapshots")
|
||||
}
|
||||
maven {
|
||||
url = uri("https://repo.codemc.io/repository/maven-public/")
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri("https://maven.enginehub.org/repo/")
|
||||
}
|
||||
maven { url = uri("https://repo.purpurmc.org/snapshots") }
|
||||
maven { url = uri("https://repo.purpurmc.org/snapshots") }
|
||||
maven { url = uri("https://repo.codemc.io/repository/maven-public/") }
|
||||
maven { url = uri("https://maven.enginehub.org/repo/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT")
|
||||
compileOnly("com.ghostchu:quickshop-api:5.2.0.7")
|
||||
compileOnly(files("libs/AreaShop-2.9.1.jar"))
|
||||
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.8")
|
||||
implementation("com.ghostchu.quickshop.compatibility:common:5.2.0.7")
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT") // Declare purpur API version to be packaged.
|
||||
compileOnly("com.ghostchu:quickshop-api:5.2.0.7") // Import QuickShop-Hikari Core API.
|
||||
implementation("com.ghostchu.quickshop.compatibility:common:5.2.0.7") // Import QuickShop-Hikari Kotlin Helper API.
|
||||
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.8") // Import WorldGuard API.
|
||||
compileOnly(files("libs/AreaShop-2.9.1.jar")) // Import AreaShop API.
|
||||
}
|
||||
|
||||
val targetJavaVersion = 17
|
||||
kotlin {
|
||||
jvmToolchain(targetJavaVersion)
|
||||
}
|
||||
|
||||
tasks.build {
|
||||
dependsOn(tasks.shadowJar)
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
archiveClassifier.set("part")
|
||||
}
|
||||
|
||||
tasks.shadowJar {
|
||||
archiveClassifier.set("")
|
||||
minimize()
|
||||
}
|
||||
|
||||
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 {
|
||||
tasks.withType<AbstractArchiveTask>().configureEach { // Ensure reproducible .jars
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
}
|
||||
|
||||
val targetJavaVersion = 17
|
||||
|
||||
kotlin { jvmToolchain(targetJavaVersion) }
|
||||
|
||||
tasks.shadowJar {
|
||||
exclude("io.github.miniplaceholders.*") // Exclude the MiniPlaceholders package from being shadowed.
|
||||
archiveClassifier.set("") // Use empty string instead of null.
|
||||
minimize()
|
||||
}
|
||||
|
||||
tasks.build {
|
||||
dependsOn(tasks.spotlessApply)
|
||||
dependsOn(tasks.shadowJar)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
kotlin { jvmToolchain(17) }
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(targetJavaVersion)
|
||||
languageVersion = JavaLanguageVersion.of(17)
|
||||
vendor = JvmVendorSpec.GRAAL_VM
|
||||
}
|
||||
}
|
||||
|
||||
spotless {
|
||||
kotlin { ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) } }
|
||||
kotlinGradle {
|
||||
ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) }
|
||||
target("build.gradle.kts", "settings.gradle.kts")
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+2
-4
@@ -1,5 +1,3 @@
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
|
||||
}
|
||||
rootProject.name = "ShopBridge-OG"
|
||||
plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" }
|
||||
|
||||
rootProject.name = "ShopBridge-OG"
|
||||
@@ -44,4 +44,4 @@ class Main : CompatibilityModule(), Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user