CrazyAuctions/paper/build.gradle.kts
2023-01-10 14:29:59 -05:00

93 lines
2.5 KiB
Plaintext

plugins {
id("crazyauctions.paper-plugin")
id("com.modrinth.minotaur") version "2.6.0"
id("com.github.johnrengelman.shadow") version "7.1.2"
`maven-publish`
}
val isBeta: Boolean = extra["isBeta"].toString().toBoolean()
fun getPluginVersion(): String {
return if (isBeta) "${project.version}-BETA" else project.version.toString()
}
fun getPluginVersionType(): String {
return if (isBeta) "beta" else "release"
}
tasks {
shadowJar {
archiveFileName.set("${rootProject.name}-${getPluginVersion()}.jar")
listOf(
"org.bstats",
"dev.triumphteam.cmd"
).forEach {
relocate(it, "${project.group}.plugin.lib.$it")
}
}
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set(rootProject.name.toLowerCase())
versionName.set("${rootProject.name} ${getPluginVersion()}")
versionNumber.set(getPluginVersion())
versionType.set(getPluginVersionType())
uploadFile.set(shadowJar.get())
autoAddDependsOn.set(true)
gameVersions.addAll(listOf("1.18", "1.18.1", "1.18.2", "1.19", "1.19.1", "1.19.2", "1.19.3"))
loaders.addAll(listOf("paper", "purpur"))
//<h3>The first release for CrazyAuctions on Modrinth! 🎉🎉🎉🎉🎉<h3><br> If we want a header.
changelog.set("""
<h4>Changes:</h4>
<p>N/A</p>
<h4>Bug Fixes:</h4>
<p>N/A</p>
""".trimIndent())
}
processResources {
filesMatching("plugin.yml") {
expand(
"name" to rootProject.name,
"group" to project.group,
"version" to getPluginVersion(),
"description" to project.description,
"website" to "https://modrinth.com/plugin/${rootProject.name.toLowerCase()}"
)
}
}
}
publishing {
val mavenExt: String = if (isBeta) "beta" else "releases"
repositories {
maven("https://repo.crazycrew.us/$mavenExt") {
name = "crazycrew"
//credentials(PasswordCredentials::class)
credentials {
username = System.getenv("REPOSITORY_USERNAME")
password = System.getenv("REPOSITORY_PASSWORD")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "${project.group}"
artifactId = rootProject.name.toLowerCase()
version = getPluginVersion()
from(components["java"])
}
}
}