DataLockLib/plugin/build.gradle.kts

49 lines
1011 B
Plaintext
Raw Normal View History

2022-10-19 16:09:43 +00:00
import java.io.ByteArrayOutputStream
2022-10-19 16:15:23 +00:00
import java.io.FileOutputStream
import java.net.URL
2022-10-19 16:09:43 +00:00
2022-10-19 15:30:58 +00:00
plugins {
`maven-publish`
2022-10-19 16:10:54 +00:00
id("net.minecrell.plugin-yml.bukkit") version "0.5.1"
2022-10-19 15:30:58 +00:00
id("xyz.jpenilla.run-paper") version "1.0.6"
}
dependencies {
implementation(project(":api")) // API
2025-06-28 02:20:13 +00:00
compileOnly("io.papermc.paper:paper-api:1.21.6-R0.1-SNAPSHOT")
2022-10-19 15:30:58 +00:00
}
tasks {
2022-10-19 16:13:46 +00:00
jar {
enabled = true
2022-10-19 16:13:46 +00:00
}
2022-10-19 15:30:58 +00:00
}
2022-10-19 16:09:43 +00:00
2022-10-19 16:10:54 +00:00
bukkit {
2022-10-19 16:19:58 +00:00
name = rootProject.name
2022-10-19 16:13:28 +00:00
main = "$group.${rootProject.name}"
2022-10-19 16:10:54 +00:00
version = gitCommit()
2025-06-28 02:20:13 +00:00
apiVersion = "1.21"
2022-10-19 16:10:54 +00:00
authors = listOf("Teriuihi")
}
2022-10-19 16:09:43 +00:00
fun gitCommit(): String {
val os = ByteArrayOutputStream()
project.exec {
isIgnoreExitValue = true
commandLine = "git rev-parse --short HEAD".split(" ")
standardOutput = os
}
return String(os.toByteArray()).trim()
}
2022-10-19 16:15:23 +00:00
fun download(link: String, path: File) {
URL(link).openStream().use { input ->
FileOutputStream(path).use { output ->
input.copyTo(output)
}
}
2025-06-28 02:20:13 +00:00
}