120 lines
3.5 KiB
Plaintext
120 lines
3.5 KiB
Plaintext
import java.io.ByteArrayOutputStream
|
|
import java.io.FileOutputStream
|
|
import java.net.URL
|
|
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription
|
|
import net.minecrell.pluginyml.paper.PaperPluginDescription
|
|
|
|
plugins {
|
|
`java-library`
|
|
`maven-publish`
|
|
id("xyz.jpenilla.run-paper") version "2.3.0"
|
|
id("de.eldoria.plugin-yml.paper") version "0.8.0"
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly("com.alttd.cosmos:cosmos-api:26.2.build.17-stable")
|
|
// compileOnly("com.alttd.altitudeapi:AltitudeAPI:0.0.3")
|
|
compileOnly("com.github.decentsoftware-eu:decentholograms:2.8.9")
|
|
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")
|
|
}
|
|
|
|
group = "com.alttd.altitudetag"
|
|
version = System.getenv("BUILD_NUMBER") ?: "DEV-BUILD"
|
|
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()
|
|
}
|
|
|
|
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"
|
|
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)
|
|
}
|
|
serverJar(file)
|
|
minecraftVersion("26.2")
|
|
}
|
|
}
|
|
|
|
fun download(link: String, path: File) {
|
|
URL(link).openStream().use { input ->
|
|
FileOutputStream(path).use { output ->
|
|
input.copyTo(output)
|
|
}
|
|
}
|
|
}
|
|
|
|
paper {
|
|
name = rootProject.name
|
|
main = "$group.${rootProject.name}"
|
|
bootstrapper = "$group.${rootProject.name}Bootstrap"
|
|
version = "${rootProject.version}"
|
|
apiVersion = "1.21"
|
|
authors = listOf("Michael Ziluck", "destro174")
|
|
serverDependencies {
|
|
register("DecentHolograms") {
|
|
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
|
|
}
|
|
}
|
|
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"
|
|
)
|
|
}
|
|
}
|
|
} |