mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 22:16:22 +00:00
* Download dependencies at runtime on all platforms (not just Paper), and read dependency info from file in plugin jar generated by Gradle task * Add maven central as fallback for paper mirror * filter duplicate dependencies * fix fabric runServer * add todo * enable hangar publishing * - exclude unneeded deps from runtime dl - sort deps and relocations in the list file - other misc fixes * move jdbi relocation * don't log anything when we don't download or relocate any dependencies * add back mariadb driver and download more dependencies at runtime and other related build changes * build cleanup * build cleanup * remove useless dependencies block
103 lines
2.7 KiB
Kotlin
103 lines
2.7 KiB
Kotlin
import org.apache.tools.ant.filters.ReplaceTokens
|
|
|
|
plugins {
|
|
id("carbon.shadow-platform")
|
|
id("quiet-fabric-loom")
|
|
}
|
|
|
|
val carbon: Configuration by configurations.creating
|
|
|
|
configurations.implementation {
|
|
extendsFrom(carbon)
|
|
}
|
|
|
|
dependencies {
|
|
minecraft(libs.fabricMinecraft)
|
|
mappings(loom.officialMojangMappings())
|
|
modImplementation(libs.fabricLoader)
|
|
modImplementation("net.fabricmc.fabric-api:fabric-api:0.83.0+1.20.1")
|
|
modImplementation("net.fabricmc.fabric-api:fabric-api-deprecated:0.83.0+1.20.1") // LuckPerms needs to work at dev time
|
|
|
|
carbon(projects.carbonchatCommon) {
|
|
exclude("net.kyori", "adventure-api")
|
|
exclude("net.kyori", "adventure-text-serializer-gson")
|
|
exclude("net.kyori", "adventure-text-serializer-plain")
|
|
exclude("cloud.commandframework", "cloud-core")
|
|
exclude("cloud.commandframework", "cloud-services")
|
|
exclude("cloud.commandframework", "cloud-brigadier")
|
|
exclude("io.leangen.geantyref")
|
|
}
|
|
|
|
modImplementation(libs.cloudFabric)
|
|
include(libs.cloudFabric)
|
|
modImplementation("me.lucko:fabric-permissions-api:0.2-SNAPSHOT")
|
|
|
|
modImplementation(libs.adventurePlatformFabric)
|
|
include(libs.adventurePlatformFabric)
|
|
|
|
modImplementation(libs.miniplaceholders)
|
|
|
|
runtimeDownload(libs.mysql)
|
|
include(libs.jarRelocator)
|
|
runtimeOnly(libs.jarRelocator) {
|
|
isTransitive = false
|
|
}
|
|
runtimeDownload(libs.guice) {
|
|
exclude("com.google.guava")
|
|
}
|
|
}
|
|
|
|
carbonPlatform {
|
|
jarTask.set(tasks.remapJar)
|
|
}
|
|
|
|
tasks {
|
|
shadowJar {
|
|
configurations = arrayListOf(carbon) as List<FileCollection>
|
|
relocateDependency("cloud.commandframework.minecraft.extras")
|
|
standardRuntimeRelocations()
|
|
relocateGuice()
|
|
}
|
|
writeDependencies {
|
|
standardRuntimeRelocations()
|
|
relocateGuice()
|
|
}
|
|
processResources {
|
|
val props = mapOf(
|
|
"modId" to rootProject.name.toLowerCase(),
|
|
"name" to rootProject.name,
|
|
"version" to project.version,
|
|
"description" to project.description,
|
|
"github_url" to GITHUB_REPO_URL
|
|
)
|
|
inputs.properties(props)
|
|
filesMatching("fabric.mod.json") {
|
|
filter<ReplaceTokens>(
|
|
"beginToken" to "\${",
|
|
"endToken" to "}",
|
|
"tokens" to props
|
|
)
|
|
}
|
|
}
|
|
|
|
runServer {
|
|
dependsOn(shadowJar)
|
|
doFirst {
|
|
val build = layout.buildDirectory.asFile.get().absolutePath
|
|
val jar = shadowJar.get().archiveFile.get().asFile
|
|
val mods = file("run/mods")
|
|
mods.mkdirs()
|
|
jar.copyTo(mods.resolve("carbonchat-dev.jar"), overwrite = true)
|
|
val newClasspath = classpath.filter {
|
|
!it.absolutePath.startsWith(build)
|
|
}.files
|
|
classpath = files(newClasspath)
|
|
}
|
|
}
|
|
}
|
|
|
|
modrinth {
|
|
gameVersions.set(listOf(libs.versions.fabricMinecraft.get()))
|
|
loaders.addAll("fabric")
|
|
}
|