Added shadowing for nightconfig

master
Wynd 2023-04-09 00:01:46 +03:00
parent cfb61f288e
commit a83c812f94
2 changed files with 46 additions and 12 deletions

View File

@ -1,11 +1,24 @@
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath 'com.github.johnrengelman:shadow:6.1.0'
}
}
plugins { plugins {
id 'fabric-loom' version '0d0261a' id 'fabric-loom' version '0d0261a'
id 'maven-publish' id 'maven-publish'
} }
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = 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 archivesBaseName = project.archives_base_name
version = project.mod_version version = project.mod_version
group = project.maven_group group = project.maven_group
@ -44,7 +57,7 @@ dependencies {
transitive false 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. // 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}" // modImplementation "io.github.minecraft-cursed-legacy:cursed-legacy-api:${project.api_version}"
@ -85,24 +98,44 @@ java {
} }
jar { 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") { // from("LICENSE") {
// rename { "${it}_${project.archivesBaseName}"} // 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 // configure the maven publication
publishing { publishing {
publications { // publications {
mavenJava(MavenPublication) { // mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven // // add all the jars that should be included when publishing to maven
artifact(remapJar) { // artifact(remapJar) {
builtBy remapJar // builtBy remapJar
} // }
artifact(sourcesJar) { // artifact(sourcesJar) {
builtBy remapSourcesJar // builtBy remapSourcesJar
} // }
} // }
} // }
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories { repositories {

View File

@ -6,5 +6,6 @@ public class MainMod implements ModInitializer {
@Override @Override
public void onInitialize() { public void onInitialize() {
ModConfig.instance();
} }
} }