port: build for spigot 1.20.1 (universal jar)
- replace paper-api with spigot-api 1.20.1, add spigot snapshots repo - bundle Adventure 4.17.0 + platform-bukkit 4.3.4 via shadowJar with relocate to com.loki.lochat.libs.kyori/gson and mergeServiceFiles - version 1.5.5-1.20.1, api-version 1.20, remove folia-supported, run-paper - single universal jar loads on Spigot/Mohist 1.20.1 and Paper 1.20.x-1.21.x (Paper is superset) - CI: add spigot-1.20.1 branch
This commit is contained in:
parent
a822c91637
commit
dd725ad255
3 changed files with 30 additions and 13 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -2,7 +2,7 @@ name: Build & Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main, develop]
|
branches: [main, develop, spigot-1.20.1]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,20 @@
|
||||||
plugins {
|
plugins {
|
||||||
java
|
java
|
||||||
id("xyz.jpenilla.run-paper") version "2.3.1"
|
id("com.gradleup.shadow") version "9.0.0"
|
||||||
jacoco
|
jacoco
|
||||||
checkstyle
|
checkstyle
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "com.loki"
|
group = "com.loki"
|
||||||
version = "1.5.5-1.21.x"
|
// Universal jar: compiled against Spigot 1.20.1 (lowest common denominator).
|
||||||
|
// Single jar loads on both Spigot/Mohist 1.20.1 and Paper 1.20.x-1.21.x
|
||||||
|
// because Paper is a superset of Spigot API. Adventure is bundled & relocated.
|
||||||
|
version = "1.5.5-1.20.1"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://repo.papermc.io/repository/maven-public/")
|
maven("https://repo.papermc.io/repository/maven-public/")
|
||||||
|
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
||||||
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
||||||
maven("https://repo.rosewooddev.io/repository/public/")
|
maven("https://repo.rosewooddev.io/repository/public/")
|
||||||
maven("https://jitpack.io")
|
maven("https://jitpack.io")
|
||||||
|
|
@ -18,16 +22,23 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
|
compileOnly("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT")
|
||||||
compileOnly("me.clip:placeholderapi:2.11.6")
|
compileOnly("me.clip:placeholderapi:2.11.6")
|
||||||
compileOnly("org.black_ixx:playerpoints:3.2.7")
|
compileOnly("org.black_ixx:playerpoints:3.2.7")
|
||||||
compileOnly("net.luckperms:api:5.4")
|
compileOnly("net.luckperms:api:5.4")
|
||||||
implementation("com.google.code.gson:gson:2.10.1")
|
implementation("com.google.code.gson:gson:2.10.1")
|
||||||
|
// Adventure bundled & relocated -> works on Spigot (no server Adventure) and Paper (relocated avoids clash)
|
||||||
|
implementation("net.kyori:adventure-api:4.17.0")
|
||||||
|
implementation("net.kyori:adventure-text-minimessage:4.17.0")
|
||||||
|
implementation("net.kyori:adventure-text-serializer-legacy:4.17.0")
|
||||||
|
implementation("net.kyori:adventure-text-serializer-plain:4.17.0")
|
||||||
|
implementation("net.kyori:adventure-text-serializer-gson:4.17.0")
|
||||||
|
implementation("net.kyori:adventure-platform-bukkit:4.3.4")
|
||||||
|
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
|
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.0")
|
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.0")
|
||||||
testImplementation("org.mockito:mockito-core:5.11.0")
|
testImplementation("org.mockito:mockito-core:5.11.0")
|
||||||
testImplementation("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
|
testImplementation("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT")
|
||||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.10.0")
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.10.0")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,12 +90,19 @@ jacoco {
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.jar {
|
tasks.jar {
|
||||||
|
archiveClassifier.set("plain")
|
||||||
archiveFileName.set("LoChat-${project.version}.jar")
|
archiveFileName.set("LoChat-${project.version}.jar")
|
||||||
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
}
|
}
|
||||||
|
|
||||||
// Локальный Paper для тестов: .\gradlew.bat runServer
|
tasks.shadowJar {
|
||||||
tasks.runServer {
|
archiveClassifier.set("")
|
||||||
minecraftVersion("1.21.4") // lowest supported; runs on any 1.21.x Paper server
|
archiveFileName.set("LoChat-${project.version}.jar")
|
||||||
|
mergeServiceFiles()
|
||||||
|
relocate("net.kyori", "com.loki.lochat.libs.kyori")
|
||||||
|
relocate("com.google.gson", "com.loki.lochat.libs.gson")
|
||||||
|
// do NOT minimize(): strips ServiceLoader classes Adventure needs
|
||||||
|
}
|
||||||
|
tasks.build {
|
||||||
|
dependsOn(tasks.shadowJar)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
name: LoChat
|
name: LoChat
|
||||||
version: '1.5.5-1.21'
|
version: '1.5.5-1.20.1'
|
||||||
main: com.loki.lochat.LoChat
|
main: com.loki.lochat.LoChat
|
||||||
api-version: '1.21'
|
api-version: '1.20'
|
||||||
folia-supported: true
|
|
||||||
author: loki
|
author: loki
|
||||||
description: Advanced chat plugin for Paper/Folia 1.21 — Spacelegacy edition
|
description: Advanced chat plugin for Spigot/Mohist 1.20.1 and Paper 1.20.x-1.21.x — Spacelegacy edition (universal jar)
|
||||||
|
|
||||||
softdepend:
|
softdepend:
|
||||||
- PlaceholderAPI
|
- PlaceholderAPI
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue