82 lines
1.7 KiB
Plaintext
82 lines
1.7 KiB
Plaintext
import java.io.ByteArrayOutputStream
|
|
|
|
plugins {
|
|
id("java")
|
|
id("java-library")
|
|
id("maven-publish")
|
|
id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly("com.alttd.cosmos:cosmos-api:1.21.8-R0.1-SNAPSHOT") {
|
|
isChanging = true
|
|
}
|
|
}
|
|
|
|
group = "com.alttd.altitudeapi"
|
|
//version = System.getenv("BUILD_NUMBER") ?: gitCommit()
|
|
version = "0.0.3"
|
|
description = "AltitudeAPI"
|
|
|
|
apply(plugin = "maven-publish")
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(21))
|
|
}
|
|
}
|
|
|
|
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")
|
|
} |