Plex/server/build.gradle.kts

167 lines
5.6 KiB
Plaintext
Raw Normal View History

2023-12-02 03:46:20 +00:00
import net.minecrell.pluginyml.paper.PaperPluginDescription
import java.io.ByteArrayOutputStream
2023-12-02 03:46:20 +00:00
import java.text.SimpleDateFormat
import java.util.*
plugins {
2023-12-02 05:52:07 +00:00
id("net.kyori.indra.git") version "3.1.3"
2023-12-02 03:46:20 +00:00
id("net.minecrell.plugin-yml.paper") version "0.6.0"
}
repositories {
maven(url = uri("https://maven.playpro.com"))
2024-01-24 01:52:03 +00:00
maven(url = uri("https://nexus.telesphoreo.me/repository/plex-modules/"))
}
2023-12-02 03:46:20 +00:00
dependencies {
2024-09-10 23:23:04 +00:00
library("org.projectlombok:lombok:1.18.34")
2024-06-15 01:29:08 +00:00
library("org.json:json:20240303")
2024-10-04 18:25:01 +00:00
library("commons-io:commons-io:2.17.0")
library("redis.clients:jedis:5.2.0")
2024-09-10 23:23:04 +00:00
library("org.mariadb.jdbc:mariadb-java-client:3.4.1")
2024-10-04 18:25:01 +00:00
library("com.zaxxer:HikariCP:6.0.0")
2024-09-10 23:23:04 +00:00
library("org.apache.maven.resolver:maven-resolver-transport-http:1.9.22")
2024-10-16 00:01:51 +00:00
library("org.jetbrains:annotations:26.0.1")
2024-11-10 18:27:05 +00:00
compileOnly("io.papermc.paper:paper-api:1.21.3-R0.1-SNAPSHOT")
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1") {
exclude("org.bukkit", "bukkit")
}
2024-06-15 01:29:08 +00:00
compileOnly("net.coreprotect:coreprotect:22.4")
2024-01-24 01:52:03 +00:00
compileOnly("network.darkhelmet.prism:Prism-Api:1.0.0")
2024-10-04 18:25:01 +00:00
implementation("org.bstats:bstats-base:3.1.0")
implementation("org.bstats:bstats-bukkit:3.1.0")
2024-04-28 03:24:03 +00:00
implementation("com.github.LeonMangler:SuperVanish:6.2.18-3")
2024-09-10 23:23:04 +00:00
annotationProcessor("org.projectlombok:lombok:1.18.34")
2023-12-02 03:46:20 +00:00
}
group = rootProject.group
version = rootProject.version
description = "Plex-Server"
paper {
name = "Plex"
version = rootProject.version.toString()
description = "Plex provides a new experience for freedom servers."
main = "dev.plex.Plex"
loader = "dev.plex.PlexLibraryManager"
website = "https://plex.us.org"
authors = listOf("Telesphoreo", "taahanis", "supernt")
2024-06-15 18:41:34 +00:00
apiVersion = "1.20.5"
2023-12-02 03:46:20 +00:00
foliaSupported = true
generateLibrariesJson = true
// Load BukkitTelnet and LibsDisguises before Plex so the modules register properly
serverDependencies {
register("BukkitTelnet") {
required = false
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
}
2024-01-15 19:18:24 +00:00
register("Essentials") {
2023-12-02 03:46:20 +00:00
required = false
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
}
2024-01-15 19:18:24 +00:00
register("LibsDisguises") {
2023-12-02 03:46:20 +00:00
required = false
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
}
2024-01-15 19:18:24 +00:00
register("Prism") {
2023-12-02 03:46:20 +00:00
required = false
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
}
register("CoreProtect") {
required = false
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
}
2024-04-28 03:24:03 +00:00
register("PremiumVanish") {
required = false
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
}
2023-12-02 03:46:20 +00:00
register("SlimeWorldManager") {
required = false
load = PaperPluginDescription.RelativeLoadOrder.AFTER
}
2024-04-28 03:24:03 +00:00
register("SuperVanish") {
required = false
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
}
2024-01-15 19:18:24 +00:00
register("Vault") {
required = false
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
}
2023-12-02 03:46:20 +00:00
}
}
fun getBuildNumber(): String {
val stdout = ByteArrayOutputStream()
try {
exec {
commandLine("git", "rev-list", "HEAD", "--count")
standardOutput = stdout
isIgnoreExitValue = true
}
} catch (e: GradleException) {
logger.error("Couldn't determine build number because Git is not installed. " + e.message)
}
return if (stdout.size() > 0) stdout.toString().trim() else "unknown"
}
2023-12-02 03:46:20 +00:00
tasks {
build {
dependsOn(shadowJar)
}
jar {
enabled = false
}
sourceSets {
main {
blossom {
resources {
property("author", if (System.getenv("JENKINS_URL") != null) "jenkins" else System.getProperty("user.name"))
property("buildNumber", if (System.getenv("BUILD_NUMBER") != null) System.getenv("BUILD_NUMBER") else getBuildNumber())
2023-12-02 03:46:20 +00:00
property("date", SimpleDateFormat("MM/dd/yyyy '<light_purple>at<gold>' hh:mm:ss a z").format(Date()))
2023-12-02 05:52:07 +00:00
property("gitCommit", indraGit.commit()?.name?.take(7))
2023-12-02 03:46:20 +00:00
}
}
}
}
shadowJar {
archiveBaseName.set("Plex")
archiveClassifier.set("")
relocate("org.bstats", "dev.plex")
finalizedBy(rootProject.tasks["copyJars"])
}
javadoc {
options.memberLevel = JavadocMemberLevel.PRIVATE
}
}
publishing {
publications {
create<MavenPublication>("maven") {
pom.withXml {
val dependenciesNode = asNode().appendNode("dependencies")
configurations.getByName("library").allDependencies.configureEach {
dependenciesNode.appendNode("dependency")
.appendNode("groupId", group).parent()
.appendNode("artifactId", name).parent()
.appendNode("version", version).parent()
.appendNode("scope", "provided").parent()
}
configurations.getByName("implementation").allDependencies.configureEach {
dependenciesNode.appendNode("dependency")
.appendNode("groupId", group).parent()
.appendNode("artifactId", name).parent()
.appendNode("version", version).parent()
.appendNode("scope", "provided").parent()
}
}
artifacts.artifact(tasks.shadowJar)
}
}
}