import net.fabricmc.loom.task.RemapJarTask plugins { id 'fabric-loom' version '0.2.6-SNAPSHOT' id 'com.github.johnrengelman.shadow' version '4.0.1' } configurations { shade compile.extendsFrom shade } dependencies { // https://modmuss50.me/fabric.html minecraft "com.mojang:minecraft:1.15.2" mappings "net.fabricmc:yarn:1.15.2+build.7:v2" modCompile "net.fabricmc:fabric-loader:0.7.6+build.179" modCompile "net.fabricmc.fabric-api:fabric-api:0.4.29+build.290-1.15" shade project(':spark-common') } processResources { inputs.property "version", project.version from(sourceSets.main.resources.srcDirs) { include "fabric.mod.json" expand "pluginVersion": project.pluginVersion, "pluginDescription": project.pluginDescription } from(sourceSets.main.resources.srcDirs) { exclude "fabric.mod.json" } } shadowJar { archiveFileName = 'spark-fabric-dev.jar' configurations = [project.configurations.shade] relocate 'okio', 'me.lucko.spark.lib.okio' relocate 'okhttp3', 'me.lucko.spark.lib.okhttp3' relocate 'net.kyori.text', 'me.lucko.spark.lib.text' relocate 'org.tukaani.xz', 'me.lucko.spark.lib.xz' relocate 'com.google.protobuf', 'me.lucko.spark.lib.protobuf' relocate 'org.objectweb.asm', 'me.lucko.spark.lib.asm' exclude 'module-info.class' exclude 'META-INF/maven/**' exclude 'META-INF/proguard/**' } task remappedShadowJar(type: RemapJarTask) { dependsOn tasks.shadowJar input = tasks.shadowJar.archiveFile addNestedDependencies = true archiveFileName = 'spark-fabric.jar' } tasks.assemble.dependsOn tasks.remappedShadowJar artifacts { archives remappedShadowJar shadow shadowJar }