mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 14:38:49 +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 (#259)
* 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
This commit is contained in:
1 parent
82c22a08fa
commit
307395ce5b
16 files changed
+694
-95
No files matched your search
+29
-13
@@ -37,29 +37,30 @@ dependencies {
|
||||
|
||||
modImplementation(libs.miniplaceholders)
|
||||
|
||||
include(libs.postgresql)
|
||||
runtimeOnly(libs.postgresql)
|
||||
include(libs.mysql)
|
||||
runtimeOnly(libs.mysql)
|
||||
include(libs.protobuf)
|
||||
runtimeOnly(libs.protobuf)
|
||||
include(libs.zstdjni)
|
||||
runtimeOnly(libs.zstdjni)
|
||||
runtimeDownload(libs.mysql)
|
||||
include(libs.jarRelocator)
|
||||
runtimeOnly(libs.jarRelocator) {
|
||||
isTransitive = false
|
||||
}
|
||||
runtimeDownload(libs.guice) {
|
||||
exclude("com.google.guava")
|
||||
}
|
||||
}
|
||||
|
||||
carbonPlatform {
|
||||
jarTask.set(tasks.remapJar)
|
||||
}
|
||||
|
||||
carbonShadowPlatform {
|
||||
relocateGuice.set(true)
|
||||
relocateCloud.set(false)
|
||||
}
|
||||
|
||||
tasks {
|
||||
shadowJar {
|
||||
configurations = arrayListOf(carbon) as List<FileCollection>
|
||||
relocateDependency("cloud.commandframework.minecraft.extras")
|
||||
standardRuntimeRelocations()
|
||||
relocateGuice()
|
||||
}
|
||||
writeDependencies {
|
||||
standardRuntimeRelocations()
|
||||
relocateGuice()
|
||||
}
|
||||
processResources {
|
||||
val props = mapOf(
|
||||
@@ -78,6 +79,21 @@ tasks {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
Reference in new issue
Block a user