2023-12-02 03:46:20 +00:00
|
|
|
import net.minecrell.pluginyml.paper.PaperPluginDescription
|
2023-12-02 05:43:27 +00:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
|
2024-01-15 23:39:57 +00:00
|
|
|
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/"))
|
2024-01-15 23:39:57 +00:00
|
|
|
}
|
|
|
|
|
2023-12-02 03:46:20 +00:00
|
|
|
dependencies {
|
|
|
|
library("org.projectlombok:lombok:1.18.30")
|
|
|
|
library("org.json:json:20231013")
|
|
|
|
library("commons-io:commons-io:2.15.1")
|
|
|
|
library("redis.clients:jedis:5.1.0")
|
|
|
|
library("org.mariadb.jdbc:mariadb-java-client:3.3.1")
|
|
|
|
library("com.zaxxer:HikariCP:5.1.0")
|
|
|
|
library("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
|
|
|
library("org.jetbrains:annotations:24.1.0")
|
2024-01-15 23:39:57 +00:00
|
|
|
|
2023-12-02 03:46:20 +00:00
|
|
|
compileOnly("dev.folia:folia-api:1.20.2-R0.1-SNAPSHOT")
|
2023-12-02 05:43:27 +00:00
|
|
|
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1") {
|
|
|
|
exclude("org.bukkit", "bukkit")
|
|
|
|
}
|
2024-01-15 23:39:57 +00:00
|
|
|
compileOnly("net.coreprotect:coreprotect:22.2")
|
2024-01-24 01:52:03 +00:00
|
|
|
compileOnly("network.darkhelmet.prism:Prism-Api:1.0.0")
|
2024-01-15 23:39:57 +00:00
|
|
|
|
2023-12-02 03:46:20 +00:00
|
|
|
implementation("org.bstats:bstats-base:3.0.2")
|
|
|
|
implementation("org.bstats:bstats-bukkit:3.0.2")
|
2024-01-15 23:39:57 +00:00
|
|
|
|
|
|
|
annotationProcessor("org.projectlombok:lombok:1.18.30")
|
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")
|
|
|
|
apiVersion = "1.19"
|
|
|
|
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
|
|
|
|
}
|
2024-01-15 23:39:57 +00:00
|
|
|
register("CoreProtect") {
|
|
|
|
required = false
|
|
|
|
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
|
|
|
|
}
|
2023-12-02 03:46:20 +00:00
|
|
|
register("SlimeWorldManager") {
|
|
|
|
required = false
|
|
|
|
load = PaperPluginDescription.RelativeLoadOrder.AFTER
|
|
|
|
}
|
2024-01-15 19:18:24 +00:00
|
|
|
register("Vault") {
|
|
|
|
required = false
|
|
|
|
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
|
|
|
|
}
|
2023-12-02 03:46:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-02 05:43:27 +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"))
|
2023-12-02 05:43:27 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|