Skip to content

Commit

Permalink
use JarJar instead of shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
DerToaster98 committed Nov 7, 2023
1 parent 72941d5 commit 4c525cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
22 changes: 2 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ plugins {
id 'idea'
id 'maven-publish'
id 'org.parchmentmc.librarian.forgegradle' version "${parchmentmc_version}"
id 'com.github.johnrengelman.shadow' version "${shadow_version}"
}

version = "${mc_version}-${mod_version}"
Expand All @@ -15,10 +14,6 @@ base {
archivesName = modid
}

configurations {
shade
}

java.toolchain.languageVersion = JavaLanguageVersion.of(17)

println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
Expand Down Expand Up @@ -117,7 +112,7 @@ dependencies {
// Dependencies (Embedded)
implementation fg.deobf("commoble.databuddy:${databuddy_branch}:${databuddy_version}")

shade fg.deobf("commoble.databuddy:${databuddy_branch}:${databuddy_version}")
jarJar(group: 'commoble.databuddy', name: "${databuddy_branch}", version: "[${databuddy_version},)")

// Dependencies (Optional)
implementation fg.deobf("software.bernie.geckolib:geckolib-forge-${geckolib_version}")
Expand All @@ -140,15 +135,7 @@ dependencies {
runtimeOnly fg.deobf("squeek.appleskin:appleskin-forge:${appleskin_version}")
}

shadowJar {
archiveClassifier = ''
configurations = [project.configurations.shade]
relocate 'commoble.databuddy', "${mod_group}.shadow.commoble.databuddy"
}

reobf {
shadowJar { }
}
jarJar.enable()

createMcpToSrg {
outputs.upToDateWhen {false}
Expand All @@ -169,8 +156,6 @@ mixin {
debug = true
}

tasks.build.dependsOn reobfShadowJar

tasks.named('processResources', ProcessResources).configure {
var replaceProperties = [
mc_version: mc_version, mc_version_range: mc_version_range,
Expand Down Expand Up @@ -205,11 +190,8 @@ tasks.named('jar', Jar).configure {
'MixinConfigs' : "${modid}.mixins.json"
])
}
finalizedBy('reobfJar')
}

jar.finalizedBy(reobfShadowJar)

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
2 changes: 0 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ parchmentmc_version=1.+
mixin_version=0.8.5
mixingradle_version=0.7-SNAPSHOT

shadow_version=7.1.2

# Dependencies (Embedded)
databuddy_branch=databuddy-1.20.1
databuddy_version=4.0.0.0
Expand Down

0 comments on commit 4c525cb

Please sign in to comment.