- Add new build option -Prelocate / RELOCATE_JAR that defines whether to relocate dependencies. Make the default KB Sync jar relocate all deps.

Fabric:
- Clean up build script
- bump cloud-fabric-command version
This commit is contained in:
Axionize committed 2025-03-29 05:38:53 -04:00
1 parent 2eba6ec2ab
commit 622c23a729
3 files changed
+11 -22

No files matched your search

+4
View File
@@ -14,6 +14,10 @@ extra["shadePE"] = project.findProperty("shadePE")?.toString()?.toBoolean()
?: System.getenv("SHADE_PE")?.toBoolean()
?: true
extra["relocate"] = project.findProperty("relocate")?.toString()?.toBoolean()
?: System.getenv("RELOCATE_JAR")?.toBoolean()
?: true
allprojects {
fun getVersionMeta(includeHash: Boolean): String {
if (!snapshot) {
+1 -1
View File
@@ -60,7 +60,7 @@ tasks.withType<ShadowJar> {
archiveClassifier.set("")
configurations = listOf(shadeThisThing)
isEnableRelocation = false
isEnableRelocation = true
relocationPrefix = "${project.property("maven_group")}.${project.property("archives_base_name")}.shaded"
}
+6 -21
View File
@@ -3,8 +3,6 @@ plugins {
id("com.gradleup.shadow")
}
val shadePE: Boolean by rootProject.extra
loom {
accessWidenerPath = file("src/main/resources/knockbacksync.accesswidener")
}
@@ -13,11 +11,6 @@ base {
archivesName.set("${rootProject.property("archives_base_name")}-fabric")
}
val shadeThisThing: Configuration by configurations.creating {
isCanBeConsumed = true
isTransitive = true
}
// TODO migrate to only including sourceset for compile, test and javadoc tasks
// Currently must build with gradle build -x test to skip test
tasks.withType<JavaCompile>().configureEach {
@@ -32,6 +25,10 @@ tasks.named<JavaCompile>("compileTestJava") {
exclude("**/*")
}
repositories {
maven("https://jitpack.io") // Conditional Mixin
}
dependencies {
implementation(project(":common"))
@@ -43,8 +40,9 @@ dependencies {
include(modImplementation("me.lucko:fabric-permissions-api:0.3.1")!!)
include(modImplementation("com.github.retrooper:packetevents-fabric:2.7.1-SNAPSHOT")!!)
include(modImplementation("org.incendo:cloud-fabric:2.0.0-beta.9")!!)
include(modImplementation("org.incendo:cloud-fabric:2.0.0-beta.10")!!)
include(implementation("org.incendo:cloud-minecraft-extras:2.0.0-beta.10")!!)
include(implementation("org.yaml:snakeyaml:2.0")!!)
include(implementation("org.kohsuke:github-api:1.326")!!)
// Required for org.kohsuke.github
@@ -61,19 +59,6 @@ dependencies {
annotationProcessor("org.projectlombok:lombok:1.18.34")
}
tasks.shadowJar {
archiveClassifier.set("dev")
configurations = listOf(shadeThisThing)
isEnableRelocation = true
relocationPrefix = "${project.property("maven_group")}.${project.property("archives_base_name")}.shaded"
finalizedBy(tasks.remapJar)
}
tasks.remapJar {
archiveClassifier.set(null as String?)
dependsOn(tasks.shadowJar)
inputFile = tasks.shadowJar.get().archiveFile
}
tasks.processResources {
from(project(":common").sourceSets.main.get().resources)