diff --git a/build.gradle b/build.gradle index 79366c5..658a791 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,24 @@ +buildscript { + repositories { + gradlePluginPortal() + } + dependencies { + classpath 'com.github.johnrengelman:shadow:6.1.0' + } +} + plugins { id 'fabric-loom' version '0d0261a' id 'maven-publish' } +apply plugin: 'com.github.johnrengelman.shadow' +apply plugin: 'java' + sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 +def shortHash = 'git rev-parse --short HEAD'.execute().in.text.trim() archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group @@ -44,7 +57,7 @@ dependencies { transitive false } - compile 'com.electronwill.night-config:toml:3.6.6' + shadow(compile('com.electronwill.night-config:toml:3.6.6')) // API. You technically don't need it, but it's extremely useful for not having to write the same code in every mod. // modImplementation "io.github.minecraft-cursed-legacy:cursed-legacy-api:${project.api_version}" @@ -85,24 +98,44 @@ java { } jar { + manifest { + attributes([ + "MixinConfigs": archivesBaseName+".mixins.json", + "Implementation-Title": project.name, + "Implementation-Version": project.mod_version, + "Implementation-Commit": shortHash, + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + ]) + } + archiveClassifier.set("dev") // from("LICENSE") { // rename { "${it}_${project.archivesBaseName}"} // } } +shadowJar { + configurations = [project.configurations.shadow] + relocate "com.electronwill.nightconfig", "xyz.pixelatedw.betterbeta.com.electronwill.nightconfig" + archiveClassifier.set("dev") +} + +remapJar { + dependsOn(shadowJar) +} + // configure the maven publication publishing { - publications { - mavenJava(MavenPublication) { - // add all the jars that should be included when publishing to maven - artifact(remapJar) { - builtBy remapJar - } - artifact(sourcesJar) { - builtBy remapSourcesJar - } - } - } + // publications { + // mavenJava(MavenPublication) { + // // add all the jars that should be included when publishing to maven + // artifact(remapJar) { + // builtBy remapJar + // } + // artifact(sourcesJar) { + // builtBy remapSourcesJar + // } + // } + // } // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. repositories { diff --git a/src/main/java/xyz/pixelatedw/betterbeta/MainMod.java b/src/main/java/xyz/pixelatedw/betterbeta/MainMod.java index 6db2d60..353d0d8 100644 --- a/src/main/java/xyz/pixelatedw/betterbeta/MainMod.java +++ b/src/main/java/xyz/pixelatedw/betterbeta/MainMod.java @@ -6,5 +6,6 @@ public class MainMod implements ModInitializer { @Override public void onInitialize() { + ModConfig.instance(); } }