AltitudeTag/build.gradle.kts

120 lines
3.5 KiB
Plaintext
Raw Normal View History

2023-07-21 20:16:36 +00:00
import java.io.ByteArrayOutputStream
import java.io.FileOutputStream
import java.net.URL
2026-07-24 16:07:26 +00:00
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription
import net.minecrell.pluginyml.paper.PaperPluginDescription
2023-07-21 20:16:36 +00:00
2023-07-21 19:22:03 +00:00
plugins {
`java-library`
`maven-publish`
2024-07-20 22:40:13 +00:00
id("xyz.jpenilla.run-paper") version "2.3.0"
2026-07-24 16:07:26 +00:00
id("de.eldoria.plugin-yml.paper") version "0.8.0"
2023-07-21 19:22:03 +00:00
}
dependencies {
2026-07-24 15:31:49 +00:00
compileOnly("com.alttd.cosmos:cosmos-api:26.2.build.17-stable")
// compileOnly("com.alttd.altitudeapi:AltitudeAPI:0.0.3")
2024-07-21 13:21:59 +00:00
compileOnly("com.github.decentsoftware-eu:decentholograms:2.8.9")
2023-07-21 19:22:03 +00:00
compileOnly("org.jetbrains:annotations:16.0.2")
testImplementation("org.powermock:powermock-module-junit4:1.7.4")
testImplementation("org.powermock:powermock-api-mockito2:1.7.4")
}
2023-12-18 16:36:40 +00:00
group = "com.alttd.altitudetag"
2026-07-24 16:07:26 +00:00
version = System.getenv("BUILD_NUMBER") ?: "DEV-BUILD"
2023-07-21 19:22:03 +00:00
description = "AltitudeTag"
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}
configure<PublishingExtension> {
repositories {
maven {
name = "maven"
url = uri("https://repo.destro.xyz/snapshots/")
credentials(PasswordCredentials::class)
}
}
}
}
tasks {
withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
}
withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
2023-07-21 20:16:36 +00:00
jar {
archiveFileName.set("${rootProject.name}.jar")
}
runServer {
val dir = File(System.getProperty("user.home") + "/share/devserver/")
if (!dir.parentFile.exists()) {
dir.parentFile.mkdirs()
}
runDirectory.set(dir)
val fileName = "/cosmos.jar"
2023-07-21 20:16:36 +00:00
val file = File(dir.path + fileName)
if (!file.parentFile.exists()) {
file.parentFile.mkdirs()
}
if (!file.exists()) {
download("https://jenkins.destro.xyz/job/Cosmos/lastSuccessfulBuild/artifact/cosmos-server/build/libs/cosmos-paperclip-26.2.build.17-stable.jar", file)
2023-07-21 20:16:36 +00:00
}
serverJar(file)
minecraftVersion("26.2")
2023-07-21 20:16:36 +00:00
}
}
fun download(link: String, path: File) {
URL(link).openStream().use { input ->
FileOutputStream(path).use { output ->
input.copyTo(output)
}
}
2023-12-18 16:36:40 +00:00
}
2026-07-24 16:07:26 +00:00
paper {
2023-12-18 16:36:40 +00:00
name = rootProject.name
main = "$group.${rootProject.name}"
2026-07-24 16:07:26 +00:00
bootstrapper = "$group.${rootProject.name}Bootstrap"
2023-12-18 16:36:40 +00:00
version = "${rootProject.version}"
2024-07-21 13:21:59 +00:00
apiVersion = "1.21"
2023-12-18 16:36:40 +00:00
authors = listOf("Michael Ziluck", "destro174")
2026-07-24 16:07:26 +00:00
serverDependencies {
register("DecentHolograms") {
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
}
}
2026-07-24 17:28:00 +00:00
permissions {
register("tag.play") {
description = "Base permission for the ${rootProject.name} plugin."
default = BukkitPluginDescription.Permission.Default.FALSE
}
register("tag.commands.admin") {
description = "Admin permission for the ${rootProject.name} plugin."
default = BukkitPluginDescription.Permission.Default.FALSE
children = listOf(
"tag.play"
)
}
register("tag.commands.admin.location") {
description = "Admin permission for setting the scoreboard location."
default = BukkitPluginDescription.Permission.Default.FALSE
children = listOf(
"tag.play",
"tag.commands.admin"
)
}
}
2023-07-21 19:22:03 +00:00
}