diff --git a/build.gradle.kts b/build.gradle.kts index 0f90ba1..a202e0f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,27 +27,29 @@ architectury { } subprojects { - lateinit var MappingsDep: Dependency + group = rootProject.group.toString() + lateinit var mappingsDep: Dependency apply(plugin = "org.jetbrains.kotlin.jvm") apply(plugin = "forgified-fabric-loom") apply(plugin = "com.github.johnrengelman.shadow") val shadowC by configurations.creating tasks { withType(ShadowJar::class) { this.configurations = listOf(shadowC) } - val shrinkJar = register("shrinkJar", proguard.gradle.ProGuardTask::class) { + val shrinkJar = register("shrinkJar", proguard.gradle.ProGuardTask::class) { group = this@subprojects.group as String val dictionariesDir = "$rootDir/obfuscation" injars(this@tasks.getByName("remapJar")) outjars("$rootDir/shrinkedJars/") - keep("class fr.username404.snowygui.mixins.* { * ; }") - keep("class fr.username404.snowygui.fabric.** { * ; }") - keep("class fr.username404.snowygui.forge.** { * ; }") - keepclassmembers("class fr.username404.snowygui.** { public protected ; }") + keep("class $group.snowygui.mixins.* { * ; }") + keep("class $group.snowygui.fabric.** { * ; }") + keep("class $group.snowygui.forge.** { * ; }") + keepclassmembers("class $group.snowygui.** { public protected ; }") keepattributes("*Annotation*, Signature, InnerClasses, EnclosingMethod, MethodParameters, Synthetic, Exceptions") obfuscationdictionary("$dictionariesDir/dictionary.txt") classobfuscationdictionary("$dictionariesDir/classdictionary.txt") packageobfuscationdictionary("$dictionariesDir/packagesdictionary.txt") + flattenpackagehierarchy("$group.snowygui") adaptclassstrings() - "fr.username404.**".also { dontwarn(it); dontnote(it) } + "$group.**".also { dontwarn(it); dontnote(it) } // The following lines are needed at least for the current version of proguard dontwarn("java.**") @@ -65,7 +67,7 @@ subprojects { if (this@subprojects.name != "common") build.get().finalizedBy(shrinkJar) } extensions.configure("loom") { - MappingsDep = officialMojangMappings() + mappingsDep = officialMojangMappings() silentMojangMappingsLicense() mixinConfig("snowygui-mixins.json") refmapName = "snowygui-common-refmap.json" @@ -77,7 +79,7 @@ subprojects { } "io.github.config4k:config4k:0.4.2".also { implementation(it); shadowC(it) } "minecraft"("com.mojang:minecraft:${rootProject.property("minecraft")}") - "mappings"(MappingsDep) + "mappings"(mappingsDep) } } @@ -138,7 +140,8 @@ allprojects { } val modProperties = mapOf( "mod_version" to (rootProject.version as String), - "minecraft_version" to mcBase + "minecraft_version" to mcBase, + "mod_group" to this@allprojects.group ) inputs.properties(modProperties) filesNotMatching(listOf("*.png")) { diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index f0427fc..2ec7dd0 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -18,10 +18,10 @@ "environment": "client", "entrypoints": { "client": [ - "fr.username404.snowygui.fabric.FabricInit" + "${mod_group}.snowygui.fabric.FabricInit" ], "modmenu": [ - "fr.username404.snowygui.fabric.ModMenuConf" + "${mod_group}.snowygui.fabric.ModMenuConf" ] }, "mixins": [