mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 14:38:48 +00:00
94 lines
2.5 KiB
Kotlin
94 lines
2.5 KiB
Kotlin
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
|
|
plugins {
|
|
id("carbon.shadow-platform")
|
|
id("xyz.jpenilla.run-velocity")
|
|
alias(libs.plugins.resource.factory.velocity.convention)
|
|
}
|
|
|
|
val bstats: Configuration by configurations.creating
|
|
configurations.compileOnly {
|
|
extendsFrom(bstats)
|
|
}
|
|
|
|
dependencies {
|
|
implementation(projects.carbonchatCommon)
|
|
bstats(libs.bstatsVelocity)
|
|
|
|
compileOnly(libs.velocityApi)
|
|
|
|
implementation(libs.cloudVelocity)
|
|
compileOnly(libs.miniplaceholders)
|
|
|
|
runtimeDownload(libs.mysql)
|
|
|
|
compileOnly("javax.inject:javax.inject:1")
|
|
}
|
|
|
|
velocityPluginJson {
|
|
id = rootProject.name.lowercase()
|
|
main = "net.draycia.carbon.velocity.CarbonVelocityBootstrap"
|
|
name = rootProject.name
|
|
version = project.version.toString()
|
|
description = project.description
|
|
url = GITHUB_REPO_URL
|
|
authors = listOf("Draycia", "jmp")
|
|
dependency("luckperms", false)
|
|
dependency("miniplaceholders", true)
|
|
dependency("signedvelocity", true)
|
|
}
|
|
|
|
gremlin {
|
|
defaultJarRelocatorDependencies.set(true)
|
|
}
|
|
|
|
runVelocityExtension.detectPluginJar = false
|
|
|
|
tasks {
|
|
val bStatsJar = register<ShadowJar>("bStatsShadowJar") {
|
|
archiveClassifier = "bStats"
|
|
configurations = listOf(bstats)
|
|
relocateDependency("org.bstats")
|
|
}
|
|
shadowJar {
|
|
archiveClassifier = "shadowJar"
|
|
relocateCloud()
|
|
standardRuntimeRelocations()
|
|
relocateDependency("io.leangen.geantyref")
|
|
relocateGuice()
|
|
}
|
|
val prod = register<Zip>("productionJar") {
|
|
destinationDirectory.set(layout.buildDirectory.dir("libs"))
|
|
archiveFileName.set("carbonchat-velocity-${project.version}.jar")
|
|
from(zipTree(shadowJar.flatMap { it.archiveFile }))
|
|
from(zipTree(bStatsJar.flatMap { it.archiveFile })) {
|
|
exclude("META-INF/**")
|
|
}
|
|
}
|
|
carbonPlatform.productionJar = prod.flatMap { it.archiveFile }
|
|
writeDependencies {
|
|
standardRuntimeRelocations()
|
|
relocateDependency("io.leangen.geantyref")
|
|
relocateGuice()
|
|
}
|
|
runVelocity {
|
|
velocityVersion(libs.versions.velocityApi.get())
|
|
pluginJars.from(prod)
|
|
downloadPlugins {
|
|
url("https://download.luckperms.net/1575/velocity/LuckPerms-Velocity-5.4.158.jar")
|
|
github("MiniPlaceholders", "MiniPlaceholders", libs.versions.miniplaceholders.get(), "MiniPlaceholders-Velocity-${libs.versions.miniplaceholders.get()}.jar")
|
|
}
|
|
}
|
|
}
|
|
|
|
publishMods.modrinth {
|
|
modLoaders.addAll("velocity")
|
|
optional {
|
|
slug = "signedvelocity"
|
|
}
|
|
}
|
|
|
|
configurations.runtimeDownload {
|
|
exclude("org.checkerframework", "checker-qual")
|
|
}
|