Skip to content

Commit

Permalink
Try this!
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Jul 25, 2024
1 parent 2933450 commit 129b2e4
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Updates

- **Updated** to relocate classes in configuration `shadowImplementation`.
25 changes: 22 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
base
java
idea
`maven-publish`
alias(libs.plugins.fabric.loom)
alias(libs.plugins.modpublisher)
alias(libs.plugins.shadow)
}

val display = libs.versions.display

group = libs.versions.maven.group.get()
version = "${libs.versions.mod.get()}-${libs.versions.loader.get()}.${libs.versions.minecraft.get()}"

val shadowImplementation: Configuration by configurations.creating
configurations["implementation"].extendsFrom(shadowImplementation)

base {
archivesName.set(libs.versions.archives.name)
}
Expand All @@ -29,8 +35,7 @@ dependencies {

modApi(libs.cloth.config)

implementation(libs.bundles.night.config)
include(libs.bundles.night.config)
shadowImplementation(libs.bundles.night.config)

// JUnit
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
Expand All @@ -54,8 +59,22 @@ tasks {
}
}

jar {
shadowJar {
from("LICENSE")

isEnableRelocation = true
relocationPrefix = "${project.group}.${base.archivesName.get()}"

archiveClassifier.set("")
configurations = listOf(shadowImplementation)
}

assemble {
dependsOn(shadowJar)
}

jar {
isEnabled = false
}

test {
Expand Down
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
maven-group = "band.kessokuteatime"
archives-name = "nightautoconfig"
mod = "1.1.0-alpha.4"
mod = "1.1.0-alpha.5"
loader = "fabric"

minecraft = "1.21"
Expand All @@ -10,6 +10,7 @@ fabric-loader = "0.15.11"
fabric-api = "0.100.4+1.21"
fabric-loom = "1.6-SNAPSHOT"
modpublisher = "2.1.0"
shadow = "8.+"

cloth-config = "15.0.127"
night-config = "3.8.0"
Expand Down Expand Up @@ -40,6 +41,7 @@ night-config-yaml = { group = "com.electronwill.night-config", name = "yaml", ve
[plugins]
fabric-loom = { id = "fabric-loom", version.ref = "fabric-loom" }
modpublisher = { id = "com.hypherionmc.modutils.modpublisher", version.ref = "modpublisher" }
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }

[bundles]
fabric = ["fabric-loader", "fabric-api"]
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import band.kessokuteatime.nightautoconfig.config.NightConfigSerializer;
import com.electronwill.nightconfig.core.ConfigFormat;
import com.electronwill.nightconfig.core.file.FileConfig;
import com.electronwill.nightconfig.core.file.FileNotFoundAction;
import com.electronwill.nightconfig.core.file.GenericBuilder;
import com.electronwill.nightconfig.hocon.HoconFormat;
import com.electronwill.nightconfig.json.JsonFormat;
Expand Down

0 comments on commit 129b2e4

Please sign in to comment.