mirror of
https://github.com/plexusorg/Plex.git
synced 2024-11-01 01:27:13 +00:00
142 lines
5.0 KiB
Groovy
142 lines
5.0 KiB
Groovy
plugins {
|
|
id "net.minecrell.plugin-yml.bukkit" version "0.5.3"
|
|
}
|
|
|
|
dependencies {
|
|
library "org.projectlombok:lombok:1.18.28"
|
|
annotationProcessor "org.projectlombok:lombok:1.18.28"
|
|
library "org.json:json:20230227"
|
|
library "commons-io:commons-io:2.12.0"
|
|
library "dev.morphia.morphia:morphia-core:2.3.4"
|
|
library "redis.clients:jedis:4.4.2"
|
|
library "org.mariadb.jdbc:mariadb-java-client:3.1.4"
|
|
library "com.zaxxer:HikariCP:5.0.1"
|
|
library "org.apache.httpcomponents.client5:httpclient5:5.2.1"
|
|
library "org.apache.commons:commons-lang3:3.12.0"
|
|
library "org.apache.maven.resolver:maven-resolver-api:1.9.10"
|
|
library "org.apache.maven.resolver:maven-resolver-impl:1.9.10"
|
|
library "org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10"
|
|
library "org.apache.maven.resolver:maven-resolver-transport-http:1.9.10"
|
|
library "org.apache.maven:maven-resolver-provider:3.9.2"
|
|
library "org.eclipse.jetty:jetty-server:11.0.15"
|
|
library "org.eclipse.jetty:jetty-servlet:11.0.15"
|
|
library "org.eclipse.jetty:jetty-proxy:11.0.15"
|
|
library "com.google.code.gson:gson:2.10.1"
|
|
compileOnly "io.papermc.paper:paper-api:1.20-R0.1-SNAPSHOT"
|
|
compileOnly "io.papermc.paper:paper-mojangapi:1.20-R0.1-SNAPSHOT"
|
|
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1") {
|
|
exclude group: "org.bukkit", module: "bukkit"
|
|
}
|
|
compileOnly("com.mojang:brigadier:1.0.18")
|
|
implementation "org.bstats:bstats-base:3.0.2"
|
|
implementation "org.bstats:bstats-bukkit:3.0.2"
|
|
}
|
|
|
|
group = rootProject.group
|
|
version = rootProject.version
|
|
description = "Plex-Server"
|
|
|
|
shadowJar {
|
|
archiveBaseName.set("Plex")
|
|
archiveClassifier.set("")
|
|
relocate "org.bstats", "dev.plex"
|
|
}
|
|
|
|
bukkit {
|
|
name = "Plex"
|
|
version = project.version
|
|
description = "Plex provides a new experience for freedom servers."
|
|
main = "dev.plex.Plex"
|
|
website = "https://plex.us.org"
|
|
authors = ["Telesphoreo", "taahanis", "supernt"]
|
|
// Load BukkitTelnet and LibsDisguises before Plex so the modules register properly
|
|
softDepend = ["BukkitTelnet", "LibsDisguises", "Vault"]
|
|
apiVersion = "1.18"
|
|
}
|
|
|
|
String getGitHash() {
|
|
def stdout = new ByteArrayOutputStream()
|
|
try {
|
|
exec {
|
|
commandLine "git", "rev-parse", "--short", "HEAD"
|
|
standardOutput = stdout
|
|
ignoreExitValue = true
|
|
}
|
|
} catch (GradleException e) {
|
|
logger.error("Couldn't determine Git head because Git is not installed. " + e.getMessage())
|
|
}
|
|
return stdout.size() > 0 ? stdout.toString().trim() : "unknown"
|
|
}
|
|
|
|
String getBuildNumber() {
|
|
def stdout = new ByteArrayOutputStream()
|
|
try {
|
|
exec {
|
|
commandLine "git", "rev-list", "HEAD", "--count"
|
|
standardOutput = stdout
|
|
ignoreExitValue = true
|
|
}
|
|
} catch (GradleException e) {
|
|
logger.error("Couldn't determine build number because Git is not installed. " + e.getMessage())
|
|
}
|
|
return stdout.size() ? stdout.toString().trim() + " (local)" : "unknown"
|
|
}
|
|
|
|
static def getDate() {
|
|
return new Date().format("MM/dd/yyyy '<light_purple>at<gold>' hh:mm:ss a z")
|
|
}
|
|
|
|
task buildProperties {
|
|
ant.propertyfile(file: "$project.projectDir/src/main/resources/build.properties") {
|
|
entry(key: "buildAuthor", default: System.getenv("JENKINS_URL") != null ? "jenkins" : "unknown")
|
|
entry(key: "buildNumber", value: System.getenv("JENKINS_URL") != null ? System.getenv("BUILD_NUMBER") + " (Jenkins)" : getBuildNumber())
|
|
entry(key: "buildDate", value: getDate())
|
|
entry(key: "buildHead", value: getGitHash())
|
|
}
|
|
}
|
|
|
|
tasks {
|
|
build {
|
|
dependsOn(shadowJar)
|
|
finalizedBy(buildProperties)
|
|
}
|
|
|
|
jar {
|
|
enabled = false
|
|
}
|
|
|
|
shadowJar {
|
|
finalizedBy(rootProject.tasks.copyJars)
|
|
}
|
|
|
|
javadoc {
|
|
options.memberLevel = JavadocMemberLevel.PRIVATE
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
maven(MavenPublication) {
|
|
pom.withXml {
|
|
def dependenciesNode = asNode().appendNode("dependencies")
|
|
configurations.getByName("library").getAllDependencies().each { dependency ->
|
|
dependenciesNode.appendNode("dependency").with {
|
|
it.appendNode("groupId", dependency.group)
|
|
it.appendNode("artifactId", dependency.name)
|
|
it.appendNode("version", dependency.version)
|
|
it.appendNode("scope", "provided")
|
|
}
|
|
}
|
|
configurations.getByName("implementation").getAllDependencies().each { dependency ->
|
|
dependenciesNode.appendNode("dependency").with {
|
|
it.appendNode("groupId", dependency.group)
|
|
it.appendNode("artifactId", dependency.name)
|
|
it.appendNode("version", dependency.version)
|
|
it.appendNode("scope", "runtime")
|
|
}
|
|
}
|
|
}
|
|
artifacts = [shadowJar]
|
|
}
|
|
}
|
|
} |