mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Fix fabric build pt 2
This commit is contained in:
1 parent
5c93c4b217
commit
7948481450
6 files changed
+35
-6
No files matched your search
@@ -3,6 +3,6 @@ import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.bundling.AbstractArchiveTask
|
||||
import org.gradle.kotlin.dsl.property
|
||||
|
||||
open class CarbonPlatformExtension(private val project: Project) {
|
||||
open class CarbonPlatformExtension(project: Project) {
|
||||
val jarTask: Property<AbstractArchiveTask> = project.objects.property()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.kotlin.dsl.property
|
||||
|
||||
open class CarbonShadowPlatformExtension(project: Project) {
|
||||
val relocateGuice: Property<Boolean> = project.objects.property<Boolean>().convention(false)
|
||||
val relocateCloud: Property<Boolean> = project.objects.property<Boolean>().convention(true)
|
||||
}
|
||||
@@ -3,6 +3,8 @@ plugins {
|
||||
id("com.github.johnrengelman.shadow")
|
||||
}
|
||||
|
||||
val shadowPlatform = extensions.create<CarbonShadowPlatformExtension>("carbonShadowPlatform", project)
|
||||
|
||||
tasks {
|
||||
jar {
|
||||
archiveClassifier.set("unshaded")
|
||||
@@ -16,3 +18,14 @@ tasks {
|
||||
extensions.configure<CarbonPlatformExtension> {
|
||||
jarTask.set(tasks.shadowJar)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.shadowJar {
|
||||
if (shadowPlatform.relocateGuice.get()) {
|
||||
relocateGuice()
|
||||
}
|
||||
if (shadowPlatform.relocateCloud.get()) {
|
||||
relocateCloud()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,6 @@ fun ShadowJar.standardRelocations() {
|
||||
relocateDependency("net.kyori.event")
|
||||
relocateDependency("net.kyori.moonshine")
|
||||
relocateDependency("net.kyori.registry")
|
||||
relocateDependency("cloud.commandframework")
|
||||
relocateDependency("org.spongepowered.configurate")
|
||||
relocateDependency("com.typesafe.config")
|
||||
relocateDependency("com.google.common")
|
||||
@@ -29,6 +28,10 @@ fun ShadowJar.standardRelocations() {
|
||||
relocateDependency("it.unimi.dsi.fastutil")
|
||||
}
|
||||
|
||||
fun ShadowJar.relocateCloud() {
|
||||
relocateDependency("cloud.commandframework")
|
||||
}
|
||||
|
||||
fun ShadowJar.relocateGuice() {
|
||||
relocateDependency("com.google.inject")
|
||||
relocateDependency("org.aopalliance")
|
||||
|
||||
@@ -22,12 +22,14 @@ dependencies {
|
||||
compileOnly("com.github.MilkBowl:VaultAPI:1.7")
|
||||
}
|
||||
|
||||
carbonShadowPlatform {
|
||||
relocateGuice.set(true)
|
||||
}
|
||||
|
||||
tasks {
|
||||
shadowJar {
|
||||
relocateDependency("io.papermc.lib")
|
||||
relocateDependency("io.leangen.geantyref")
|
||||
|
||||
relocateGuice()
|
||||
}
|
||||
runServer {
|
||||
minecraftVersion("1.17.1")
|
||||
|
||||
@@ -33,6 +33,11 @@ carbonPlatform {
|
||||
jarTask.set(tasks.remapJar)
|
||||
}
|
||||
|
||||
carbonShadowPlatform {
|
||||
relocateGuice.set(true)
|
||||
relocateCloud.set(false)
|
||||
}
|
||||
|
||||
tasks {
|
||||
jar {
|
||||
archiveClassifier.set("dev")
|
||||
@@ -40,8 +45,6 @@ tasks {
|
||||
shadowJar {
|
||||
configurations = arrayListOf(carbon) as List<FileCollection>
|
||||
archiveClassifier.set("dev-all")
|
||||
|
||||
relocateGuice()
|
||||
}
|
||||
remapJar {
|
||||
archiveClassifier.set(null as String?)
|
||||
|
||||
Reference in new issue
Block a user