2022-01-04 03:53:22 +00:00
|
|
|
plugins {
|
2022-02-25 09:54:11 +00:00
|
|
|
id "java"
|
|
|
|
id "maven-publish"
|
|
|
|
id "net.minecrell.plugin-yml.bukkit" version "0.5.1"
|
2022-01-27 09:00:50 +00:00
|
|
|
id "com.github.johnrengelman.shadow" version "7.1.2"
|
2022-01-04 03:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
|
|
|
maven {
|
2022-02-25 09:54:11 +00:00
|
|
|
url = uri("https://papermc.io/repo/repository/maven-public/")
|
2022-01-04 03:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
maven {
|
2022-02-25 09:54:11 +00:00
|
|
|
url = uri("https://repository.apache.org/content/repositories/snapshots/")
|
2022-01-04 03:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
maven {
|
2022-02-25 09:54:11 +00:00
|
|
|
url = uri("https://repo.maven.apache.org/maven2/")
|
2022-01-04 03:53:22 +00:00
|
|
|
}
|
2022-02-25 07:09:55 +00:00
|
|
|
|
2022-02-04 08:18:07 +00:00
|
|
|
mavenCentral()
|
2022-01-04 03:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2022-02-25 09:54:11 +00:00
|
|
|
library "org.projectlombok:lombok:1.18.22"
|
|
|
|
annotationProcessor "org.projectlombok:lombok:1.18.22"
|
2022-03-27 05:42:18 +00:00
|
|
|
library "org.json:json:20220320"
|
2022-02-25 09:54:11 +00:00
|
|
|
library "commons-io:commons-io:2.11.0"
|
2022-03-27 05:42:18 +00:00
|
|
|
library "dev.morphia.morphia:morphia-core:2.2.6"
|
2022-04-01 19:24:04 +00:00
|
|
|
library "redis.clients:jedis:4.2.1"
|
2022-03-27 05:42:18 +00:00
|
|
|
library "org.mariadb.jdbc:mariadb-java-client:3.0.4"
|
2022-02-25 09:54:11 +00:00
|
|
|
library "org.apache.httpcomponents:httpclient:4.5.13"
|
|
|
|
library "org.apache.commons:commons-lang3:3.12.0"
|
2022-04-01 05:47:15 +00:00
|
|
|
library "org.apache.maven.resolver:maven-resolver-api:1.7.3"
|
|
|
|
library "org.apache.maven.resolver:maven-resolver-impl:1.7.3"
|
|
|
|
library "org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3"
|
|
|
|
library "org.apache.maven.resolver:maven-resolver-transport-http:1.7.3"
|
|
|
|
library "org.apache.maven:maven-resolver-provider:3.8.5"
|
2022-04-02 03:58:03 +00:00
|
|
|
library "org.eclipse.jetty:jetty-server:11.0.8"
|
|
|
|
library "org.eclipse.jetty:jetty-servlet:11.0.8"
|
|
|
|
library "org.eclipse.jetty:jetty-proxy:11.0.8"
|
2022-03-03 21:45:19 +00:00
|
|
|
compileOnly "io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT"
|
2022-02-25 09:54:11 +00:00
|
|
|
implementation "org.bstats:bstats-base:3.0.0"
|
|
|
|
implementation "org.bstats:bstats-bukkit:3.0.0"
|
2022-01-04 03:53:22 +00:00
|
|
|
}
|
|
|
|
|
2022-02-25 09:54:11 +00:00
|
|
|
group = "dev.plex"
|
2022-03-19 20:20:52 +00:00
|
|
|
version = "0.10-SNAPSHOT"
|
2022-02-25 09:54:11 +00:00
|
|
|
description = "Plex"
|
2022-01-04 03:53:22 +00:00
|
|
|
|
2022-01-27 09:00:50 +00:00
|
|
|
shadowJar {
|
|
|
|
archiveClassifier.set("")
|
2022-02-25 09:54:11 +00:00
|
|
|
relocate "org.bstats", "dev.plex"
|
2022-01-27 09:00:50 +00:00
|
|
|
}
|
|
|
|
|
2022-01-04 03:53:22 +00:00
|
|
|
bukkit {
|
|
|
|
name = "Plex"
|
|
|
|
version = rootProject.version
|
|
|
|
description = "Plex provides a new experience for freedom servers."
|
|
|
|
main = "dev.plex.Plex"
|
2022-02-25 07:42:42 +00:00
|
|
|
website = "https://plex.us.org"
|
2022-01-04 03:53:22 +00:00
|
|
|
authors = ["Telesphoreo", "taahanis", "super"]
|
|
|
|
apiVersion = "1.18"
|
|
|
|
}
|
|
|
|
|
2022-03-26 22:22:08 +00:00
|
|
|
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")
|
|
|
|
}
|
|
|
|
|
2022-03-26 21:36:29 +00:00
|
|
|
task buildProperties {
|
|
|
|
ant.propertyfile(file: "$project.rootDir/src/main/resources/build.properties") {
|
2022-03-26 22:44:26 +00:00
|
|
|
entry(key: "buildAuthor", default: System.getenv("JENKINS_URL") != null ? "jenkins" : "unknown")
|
2022-03-31 07:01:29 +00:00
|
|
|
entry(key: "buildNumber", value: System.getenv("JENKINS_URL") != null ? System.getenv("BUILD_NUMBER") + " (Jenkins)" : getBuildNumber())
|
2022-03-26 22:22:08 +00:00
|
|
|
entry(key: "buildDate", value: getDate())
|
|
|
|
entry(key: "buildHead", value: getGitHash())
|
2022-03-26 21:36:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-04 03:53:22 +00:00
|
|
|
java {
|
|
|
|
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
maven(MavenPublication) {
|
|
|
|
from(components.java)
|
2022-02-22 01:03:51 +00:00
|
|
|
}
|
2022-04-01 19:24:04 +00:00
|
|
|
}
|
|
|
|
repositories {
|
|
|
|
maven {
|
2022-04-01 19:34:12 +00:00
|
|
|
def releasesRepoUrl = uri("https://nexus.telesphoreo.me/repository/plex-releases/")
|
2022-04-01 19:24:04 +00:00
|
|
|
def snapshotsRepoUrl = uri("https://nexus.telesphoreo.me/repository/plex-snapshots/")
|
|
|
|
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
|
|
|
credentials {
|
2022-04-01 19:31:05 +00:00
|
|
|
username = System.getenv("plexUser")
|
|
|
|
password = System.getenv("plexPassword")
|
2022-03-31 06:54:25 +00:00
|
|
|
}
|
|
|
|
}
|
2022-02-22 01:03:51 +00:00
|
|
|
}
|
2022-02-22 02:19:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(JavaCompile) {
|
2022-02-25 09:54:11 +00:00
|
|
|
options.encoding = "UTF-8"
|
2022-02-22 02:19:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks {
|
|
|
|
build {
|
|
|
|
dependsOn(shadowJar)
|
2022-03-26 22:53:25 +00:00
|
|
|
finalizedBy(buildProperties)
|
2022-02-22 02:19:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
javadoc {
|
|
|
|
options.memberLevel = JavadocMemberLevel.PRIVATE
|
|
|
|
}
|
2022-02-22 01:03:51 +00:00
|
|
|
}
|