68 lines
1.3 KiB
Plaintext
68 lines
1.3 KiB
Plaintext
import java.io.ByteArrayOutputStream
|
|
|
|
plugins {
|
|
`java-library`
|
|
`maven-publish`
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly("com.alttd:Galaxy-API:1.20.4-R0.1-SNAPSHOT") {
|
|
isChanging = true
|
|
}
|
|
}
|
|
|
|
group = "com.alttd"
|
|
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()
|
|
} |