49 lines
1011 B
Plaintext
49 lines
1011 B
Plaintext
import java.io.ByteArrayOutputStream
|
|
import java.io.FileOutputStream
|
|
import java.net.URL
|
|
|
|
plugins {
|
|
`maven-publish`
|
|
id("net.minecrell.plugin-yml.bukkit") version "0.5.1"
|
|
id("xyz.jpenilla.run-paper") version "1.0.6"
|
|
}
|
|
|
|
dependencies {
|
|
implementation(project(":api")) // API
|
|
compileOnly("io.papermc.paper:paper-api:1.21.6-R0.1-SNAPSHOT")
|
|
}
|
|
|
|
tasks {
|
|
|
|
jar {
|
|
enabled = true
|
|
}
|
|
|
|
}
|
|
|
|
bukkit {
|
|
name = rootProject.name
|
|
main = "$group.${rootProject.name}"
|
|
version = gitCommit()
|
|
apiVersion = "1.21"
|
|
authors = listOf("Teriuihi")
|
|
}
|
|
|
|
fun gitCommit(): String {
|
|
val os = ByteArrayOutputStream()
|
|
project.exec {
|
|
isIgnoreExitValue = true
|
|
commandLine = "git rev-parse --short HEAD".split(" ")
|
|
standardOutput = os
|
|
}
|
|
return String(os.toByteArray()).trim()
|
|
}
|
|
|
|
fun download(link: String, path: File) {
|
|
URL(link).openStream().use { input ->
|
|
FileOutputStream(path).use { output ->
|
|
input.copyTo(output)
|
|
}
|
|
}
|
|
}
|