Update gradle to 8.14.3
This commit is contained in:
1 parent
6a4e3fe031
commit
0fdddd15b3
6 files changed
+75
-67
No files matched your search
+63
-55
@@ -1,24 +1,26 @@
|
||||
import java.io.BufferedReader
|
||||
/* This is free and unencumbered software released into the public domain */
|
||||
|
||||
import java.io.BufferedReader
|
||||
import org.gradle.kotlin.dsl.provideDelegate
|
||||
|
||||
/* ------------------------------ Plugins ------------------------------ */
|
||||
plugins {
|
||||
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.
|
||||
id("java") // Import Java plugin.
|
||||
id("java-library") // Import Java Library plugin.
|
||||
id("com.diffplug.spotless") version "7.0.4" // Import Spotless plugin.
|
||||
id("com.gradleup.shadow") version "8.3.6" // Import Shadow plugin.
|
||||
eclipse // Import Eclipse plugin.
|
||||
kotlin("jvm") version "2.1.21" // Import Kotlin JVM plugin.
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
extra["kotlinAttribute"] = Attribute.of("kotlin-tag", Boolean::class.javaObjectType)
|
||||
|
||||
val kotlinAttribute: Attribute<Boolean> by rootProject.extra
|
||||
|
||||
/* --------------------------- JDK / Kotlin ---------------------------- */
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17 // Compile with JDK 17 compatibility.
|
||||
|
||||
toolchain {
|
||||
toolchain { // Select Java toolchain.
|
||||
languageVersion.set(JavaLanguageVersion.of(17)) // Use JDK 17.
|
||||
vendor.set(JvmVendorSpec.GRAAL_VM) // Use GraalVM CE.
|
||||
}
|
||||
@@ -26,67 +28,73 @@ java {
|
||||
|
||||
kotlin { jvmToolchain(17) }
|
||||
|
||||
/* ----------------------------- Metadata ------------------------------ */
|
||||
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()
|
||||
}
|
||||
|
||||
group = "net.trueog.quests-og" // Declare bundle identifier.
|
||||
|
||||
version = "$apiVersion-$commitHash"
|
||||
|
||||
val apiVersion = "1.19" // Declare minecraft server target version.
|
||||
|
||||
version = "$apiVersion-$commitHash" // Declare plugin version (will be in .jar).
|
||||
|
||||
/* ---------------------------- Repos ---------------------------------- */
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
maven { url = uri("https://repo.purpurmc.org/snapshots") }
|
||||
maven("https://repo.papermc.io/repository/maven-public/") { name = "papermc-repo" }
|
||||
maven("https://oss.sonatype.org/content/groups/public/") { name = "sonatype" }
|
||||
maven("https://jitpack.io") { name = "jitpack" }
|
||||
mavenCentral() // Import the Maven Central Maven Repository.
|
||||
gradlePluginPortal() // Import the Gradle Plugin Portal Maven Repository.
|
||||
maven { url = uri("https://repo.purpurmc.org/snapshots") } // Import the PurpurMC Maven Repository.
|
||||
}
|
||||
|
||||
/* ---------------------- Java project deps ---------------------------- */
|
||||
dependencies {
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT") // Declare purpur API version to be packaged.
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT") // Declare Purpur API version to be packaged.
|
||||
compileOnly("net.luckperms:api:5.5") // Import LuckPerms API.
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib") // Import Kotlin standard library.
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2") // Import Kotlin async library.
|
||||
implementation("io.lettuce:lettuce-core:6.7.1.RELEASE") // Import Lettuce API for keydb.
|
||||
compileOnly("com.github.Realizedd.Duels:duels-api:3.5.1") // Import Duels API (API-compatible with Duels-OG).
|
||||
compileOnly(project(":libs:Utilities-OG")) // Import TrueOG Network Utilities-OG API.
|
||||
compileOnly(project(":libs:DiamondBank-OG")) // Import TrueOG Network DiamondBank-OG API.
|
||||
}
|
||||
|
||||
configurations.all { exclude(group = "io.projectreactor") }
|
||||
|
||||
val targetJavaVersion = 17
|
||||
|
||||
kotlin { jvmToolchain(targetJavaVersion) }
|
||||
|
||||
tasks.build {
|
||||
dependsOn(tasks.spotlessApply)
|
||||
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("/") }
|
||||
compileOnlyApi(project(":libs:Utilities-OG")) // Import TrueOG Network Utilities-OG Java API (from source).
|
||||
compileOnlyApi(project(":libs:DiamondBank-OG")) {
|
||||
attributes { attribute(kotlinAttribute, true) }
|
||||
} // Import TrueOG network DiamondBank-OG Kotlin API (from source).
|
||||
}
|
||||
|
||||
/* ---------------------- Reproducible jars ---------------------------- */
|
||||
tasks.withType<AbstractArchiveTask>().configureEach { // Ensure reproducible .jars
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
}
|
||||
|
||||
/* ----------------------------- Shadow -------------------------------- */
|
||||
tasks.shadowJar {
|
||||
archiveClassifier.set("") // Use empty string instead of null.
|
||||
minimize()
|
||||
}
|
||||
|
||||
tasks.jar { archiveClassifier.set("part") } // Applies to root jarfile only.
|
||||
|
||||
tasks.build { dependsOn(tasks.spotlessApply, tasks.shadowJar) } // Build depends on spotless and shadow.
|
||||
|
||||
/* --------------------------- Javac opts ------------------------------- */
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.compilerArgs.add("-Xlint:deprecation") // Trigger deprecation warning messages.
|
||||
options.encoding = "UTF-8" // Use UTF-8 file encoding.
|
||||
}
|
||||
|
||||
/* ----------------------------- Auto Formatting ------------------------ */
|
||||
spotless {
|
||||
kotlin { ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) } }
|
||||
kotlinGradle {
|
||||
ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) }
|
||||
target("build.gradle.kts", "settings.gradle.kts")
|
||||
ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) } // JetBrains Kotlin formatting.
|
||||
target("build.gradle.kts", "settings.gradle.kts") // Gradle files to format.
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("spotlessCheck") {
|
||||
dependsOn("spotlessApply") // Run spotless before checking if spotless ran.
|
||||
}
|
||||
Whitespace-only changes.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+1
-1
Submodule libs/DiamondBank-OG updated: 0a642bb496...302e3840e4.
+1
-1
Submodule libs/Utilities-OG updated: fc93c2ed4f...4b730712ad.
+9
-9
@@ -2,14 +2,14 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
|
||||
|
||||
rootProject.name = "Quests-OG"
|
||||
|
||||
val process: Process = ProcessBuilder("sh", "bootstrap.sh").directory(rootDir).start()
|
||||
|
||||
val exitValue = process.waitFor()
|
||||
|
||||
if (exitValue != 0) {
|
||||
throw GradleException("bootstrap.sh failed with exit code $exitValue")
|
||||
ProcessBuilder("sh", "bootstrap.sh").directory(rootDir).inheritIO().start().let {
|
||||
if (it.waitFor() != 0) throw GradleException("bootstrap.sh failed")
|
||||
}
|
||||
|
||||
include("libs:Utilities-OG")
|
||||
|
||||
include("libs:DiamondBank-OG")
|
||||
file("libs")
|
||||
.listFiles()
|
||||
?.filter { it.isDirectory && !it.name.startsWith(".") }
|
||||
?.forEach { dir ->
|
||||
include(":libs:${dir.name}")
|
||||
project(":libs:${dir.name}").projectDir = dir
|
||||
}
|
||||
Reference in new issue
Block a user