Chat/galaxy/build.gradle.kts

58 lines
1.6 KiB
Plaintext
Raw Normal View History

2022-09-03 08:41:50 +00:00
import java.io.FileOutputStream
import java.net.URL
2021-12-11 17:59:45 +00:00
plugins {
`maven-publish`
2024-07-21 16:57:58 +00:00
id("io.github.goooler.shadow")
id("xyz.jpenilla.run-paper") version "1.0.6"
2021-12-11 17:59:45 +00:00
}
dependencies {
implementation(project(":api")) // API
compileOnly("com.alttd:Galaxy-API:1.20.4-R0.1-SNAPSHOT") // Galaxy
2022-01-05 14:25:17 +00:00
compileOnly("com.gitlab.ruany:LiteBansAPI:0.3.5") // move to proxy
2022-09-03 08:41:50 +00:00
compileOnly("org.apache.commons:commons-lang3:3.12.0") // needs an alternative, already removed from upstream api and will be removed in server
2022-09-26 21:55:49 +00:00
compileOnly("net.luckperms:api:5.3") // Luckperms
2022-10-09 18:25:40 +00:00
compileOnly(files("../libs/CMI.jar"))
2021-12-11 20:41:19 +00:00
}
tasks {
shadowJar {
2022-09-02 08:37:25 +00:00
archiveFileName.set("${rootProject.name}-${project.name}-${project.version}.jar")
2021-12-11 20:41:19 +00:00
// minimize()
}
build {
2022-09-27 12:27:25 +00:00
// setBuildDir("${rootProject.buildDir}")
2021-12-11 20:41:19 +00:00
dependsOn(shadowJar)
}
2022-09-03 08:41:50 +00:00
runServer {
val dir = File(System.getProperty("user.home") + "/share/devserver/");
if (!dir.parentFile.exists()) {
dir.parentFile.mkdirs()
}
runDirectory.set(dir)
val fileName = "/galaxy.jar"
var file = File(dir.path + fileName)
if (!file.parentFile.exists()) {
file.parentFile.mkdirs()
}
if (!file.exists()) {
download("https://repo.destro.xyz/snapshots/com/alttd/Galaxy-Server/Galaxy-paperclip-1.19.2-R0.1-SNAPSHOT-reobf.jar", file)
}
serverJar(file)
minecraftVersion("1.19.2")
2022-09-03 08:41:50 +00:00
}
}
fun download(link: String, path: File) {
URL(link).openStream().use { input ->
FileOutputStream(path).use { output ->
input.copyTo(output)
}
}
2021-12-11 17:59:45 +00:00
}