CrazyAuctions/build.gradle.kts
2024-09-08 18:34:44 -04:00

72 lines
2.0 KiB
Plaintext

plugins {
alias(libs.plugins.minotaur)
alias(libs.plugins.hangar)
`java-plugin`
}
val buildNumber: String? = System.getenv("BUILD_NUMBER")
rootProject.version = if (buildNumber != null) "${libs.versions.minecraft.get()}-$buildNumber" else "2.0"
val isSnapshot = true
val content: String = rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8)
subprojects.filter { it.name != "api" }.forEach {
it.project.version = rootProject.version
}
tasks {
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set(rootProject.name.lowercase())
versionType.set(if (isSnapshot) "beta" else "release")
versionName.set("${rootProject.name} ${rootProject.version}")
versionNumber.set(rootProject.version as String)
changelog.set(content)
uploadFile.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar"))
gameVersions.set(listOf(libs.versions.minecraft.get()))
loaders.addAll(listOf("purpur", "paper", "folia"))
syncBodyFrom.set(rootProject.file("README.md").readText(Charsets.UTF_8))
autoAddDependsOn.set(false)
detectLoaders.set(false)
}
hangarPublish {
publications.register("plugin") {
apiKey.set(System.getenv("HANGAR_KEY"))
id.set(rootProject.name.lowercase())
version.set(rootProject.version as String)
channel.set(if (isSnapshot) "Beta" else "Release")
changelog.set(content)
platforms {
paper {
jar.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar"))
platformVersions.set(listOf(libs.versions.minecraft.get()))
dependencies {
hangar("PlaceholderAPI") {
required = false
}
}
}
}
}
}
}