mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 22:15:37 +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
@@ -3,8 +3,37 @@ plugins {
|
||||
id("com.modrinth.minotaur")
|
||||
}
|
||||
|
||||
val runtimeDownload: Configuration by configurations.creating {
|
||||
isCanBeResolved = true
|
||||
isCanBeConsumed = false
|
||||
attributes {
|
||||
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
|
||||
}
|
||||
|
||||
exclude("org.checkerframework", "checker-qual")
|
||||
exclude("org.slf4j", "slf4j-api")
|
||||
exclude("com.google.errorprone", "error_prone_annotations")
|
||||
exclude("io.leangen.geantyref", "geantyref")
|
||||
}
|
||||
|
||||
val platformExtension = extensions.create<CarbonPlatformExtension>("carbonPlatform")
|
||||
|
||||
dependencies {
|
||||
runtimeDownload(libs.postgresql)
|
||||
runtimeDownload(libs.mariadb)
|
||||
runtimeDownload(libs.zstdjni)
|
||||
runtimeDownload(libs.jdbiCore)
|
||||
runtimeDownload(libs.jdbiObject)
|
||||
runtimeDownload(libs.jdbiPostgres)
|
||||
runtimeDownload(libs.caffeine)
|
||||
runtimeDownload(libs.jedis)
|
||||
runtimeDownload(libs.rabbitmq)
|
||||
runtimeDownload(libs.nats)
|
||||
runtimeDownload(libs.assistedInject) {
|
||||
isTransitive = false
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
val copyJar = register<FileCopyTask>("copyJar") {
|
||||
fileToCopy.set(platformExtension.jarTask.flatMap { it.archiveFile })
|
||||
@@ -30,6 +59,21 @@ modrinth {
|
||||
gameVersions.addAll("1.19.4", "1.20.1")
|
||||
}
|
||||
|
||||
val writeDeps = tasks.register("writeDependencies", WriteDependencies::class) {
|
||||
tree.set(runtimeDownload.incoming.resolutionResult.rootComponent)
|
||||
files.from(runtimeDownload)
|
||||
outputFileName.set("carbon-dependencies.list")
|
||||
outputDir.set(layout.buildDirectory.dir("generated/dependencyList"))
|
||||
repos.add("https://repo.papermc.io/repository/maven-public/")
|
||||
repos.add("https://repo.maven.apache.org/maven2/")
|
||||
}
|
||||
|
||||
sourceSets.main {
|
||||
resources {
|
||||
srcDir(writeDeps)
|
||||
}
|
||||
}
|
||||
|
||||
//val projectVersion = version as String
|
||||
//if (projectVersion.endsWith("-SNAPSHOT")) {
|
||||
// // Add git commit hash to version for platforms
|
||||
|
||||
Reference in new issue
Block a user