78 lines
1.6 KiB
Plaintext
78 lines
1.6 KiB
Plaintext
import java.io.ByteArrayOutputStream
|
|
|
|
plugins {
|
|
`java-library`
|
|
`maven-publish`
|
|
id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly("com.alttd:Galaxy-API:1.20.4-R0.1-SNAPSHOT") {
|
|
isChanging = true
|
|
}
|
|
}
|
|
|
|
group = "com.alttd.altitudeapi"
|
|
version = System.getenv("BUILD_NUMBER") ?: gitCommit()
|
|
description = "AltitudeAPI"
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(17))
|
|
}
|
|
}
|
|
|
|
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()
|
|
}
|
|
|
|
withType<Copy> {
|
|
from(file("mc-assets/"))
|
|
into("build/resources/main")
|
|
}
|
|
|
|
jar {
|
|
archiveFileName.set("${rootProject.name}.jar")
|
|
}
|
|
}
|
|
|
|
fun gitCommit(): String {
|
|
val os = ByteArrayOutputStream()
|
|
project.exec {
|
|
commandLine = "git rev-parse --short HEAD".split(" ")
|
|
standardOutput = os
|
|
}
|
|
return String(os.toByteArray()).trim()
|
|
}
|
|
|
|
|
|
bukkit {
|
|
name = rootProject.name
|
|
main = "$group.${rootProject.name}"
|
|
version = "${rootProject.version}"
|
|
apiVersion = "1.20"
|
|
authors = listOf("Michael Ziluck", "destro174")
|
|
} |