CrazyAuctions/paper/build.gradle.kts

93 lines
2.5 KiB
Plaintext
Raw Normal View History

2023-01-07 08:27:10 +01:00
plugins {
id("crazyauctions.paper-plugin")
2023-01-07 08:27:10 +01:00
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"
}
2023-01-07 08:27:10 +01:00
tasks {
shadowJar {
2023-01-10 20:12:51 +01:00
archiveFileName.set("${rootProject.name}-${getPluginVersion()}.jar")
2023-01-07 08:27:10 +01:00
listOf(
"org.bstats",
"dev.triumphteam.cmd"
).forEach {
relocate(it, "${project.group}.plugin.lib.$it")
2023-01-07 08:27:10 +01:00
}
}
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
2023-01-10 20:12:51 +01:00
projectId.set(rootProject.name.toLowerCase())
2023-01-07 08:27:10 +01:00
2023-01-10 20:12:51 +01:00
versionName.set("${rootProject.name} ${getPluginVersion()}")
versionNumber.set(getPluginVersion())
2023-01-07 08:27:10 +01:00
versionType.set(getPluginVersionType())
2023-01-07 08:27:10 +01:00
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("""
2023-01-10 20:29:59 +01:00
<h4>Changes:</h4>
2023-01-07 08:27:10 +01:00
<p>N/A</p>
2023-01-10 20:29:59 +01:00
<h4>Bug Fixes:</h4>
2023-01-07 08:27:10 +01:00
<p>N/A</p>
""".trimIndent())
}
processResources {
filesMatching("plugin.yml") {
expand(
2023-01-10 20:12:51 +01:00
"name" to rootProject.name,
2023-01-07 08:27:10 +01:00
"group" to project.group,
"version" to getPluginVersion(),
"description" to project.description,
2023-01-10 20:12:51 +01:00
"website" to "https://modrinth.com/plugin/${rootProject.name.toLowerCase()}"
2023-01-07 08:27:10 +01:00
)
}
}
}
publishing {
val mavenExt: String = if (isBeta) "beta" else "releases"
2023-01-07 08:27:10 +01:00
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}"
2023-01-10 20:12:51 +01:00
artifactId = rootProject.name.toLowerCase()
version = getPluginVersion()
2023-01-07 08:27:10 +01:00
from(components["java"])
}
}
}