CrazyAuctions/paper/build.gradle.kts

125 lines
3.0 KiB
Plaintext

import io.papermc.hangarpublishplugin.model.Platforms
plugins {
alias(libs.plugins.modrinth)
alias(libs.plugins.hangar)
id("xyz.jpenilla.run-paper")
id("paper-plugin")
}
project.group = "${rootProject.group}.paper"
repositories {
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
maven("https://repo.codemc.org/repository/maven-public/")
maven("https://repo.crazycrew.us/first-party/")
maven("https://repo.crazycrew.us/third-party/")
flatDir { dirs("libs") }
}
dependencies {
}
tasks {
runServer {
jvmArgs("-Dnet.kyori.ansi.colorLevel=truecolor")
minecraftVersion("1.20.2")
}
shadowJar {
listOf(
"de.tr7zw.changeme.nbtapi",
"org.bstats",
"ch.jalu"
).forEach {
relocate(it, "libs.$it")
}
}
processResources {
val props = mapOf(
"name" to rootProject.name,
"group" to project.group.toString(),
"version" to rootProject.version,
"description" to rootProject.description,
"authors" to rootProject.properties["authors"],
"apiVersion" to "1.20",
"website" to "https://modrinth.com/plugin/${rootProject.name.lowercase()}"
)
filesMatching("plugin.yml") {
expand(props)
}
}
}
val isSnapshot = true
val type = if (isSnapshot) "beta" else "release"
val other = if (isSnapshot) "Beta" else "Release"
val file = file("${rootProject.rootDir}/jars/${rootProject.name}-${rootProject.version}.jar")
val description = """
## Fixes:
* Fix not crates being wrongly labeled as virtual crates if they are quadcrate, quickcrate or ones that need to be in the physical world.
## Other:
* [Feature Requests](https://github.com/Crazy-Crew/${rootProject.name}/issues)
* [Bug Reports](https://github.com/Crazy-Crew/${rootProject.name}/issues)
""".trimIndent()
val versions = listOf(
"1.20",
"1.20.1",
"1.20.2"
)
modrinth {
autoAddDependsOn.set(false)
token.set(System.getenv("modrinth_token"))
projectId.set(rootProject.name.lowercase())
versionName.set("${rootProject.name} ${rootProject.version}")
versionNumber.set("${rootProject.version}")
versionType.set(type)
uploadFile.set(file("${rootProject.rootDir}/jars/${rootProject.name}-${rootProject.version}.jar"))
gameVersions.addAll(versions)
changelog.set(description)
loaders.addAll("paper", "purpur")
}
hangarPublish {
publications.register("plugin") {
version.set(rootProject.version as String)
id.set(rootProject.name)
channel.set(if (isSnapshot) "Beta" else "Release")
changelog.set(description)
apiKey.set(System.getenv("hangar_key"))
platforms {
register(Platforms.PAPER) {
jar.set(file("${rootProject.rootDir}/jars/${rootProject.name}-${rootProject.version}.jar"))
platformVersions.set(versions)
}
}
}
}