import net.fabricmc.loom.task.RemapJarTask plugins { id 'fabric-loom' version '0.10.+' id 'com.github.johnrengelman.shadow' version '7.0.0' } tasks.withType(JavaCompile) { // override, compile targeting J17 options.release = 17 } repositories { maven { url 'https://maven.fabricmc.net/' } maven { url 'https://maven.nucleoid.xyz/' content { includeGroup('eu.pb4') } } mavenLocal() } configurations { shade implementation.extendsFrom shade } dependencies { // https://modmuss50.me/fabric.html minecraft 'com.mojang:minecraft:1.18.2' mappings 'net.fabricmc:yarn:1.18.2+build.1:v2' modImplementation 'net.fabricmc:fabric-loader:0.13.3' Set apiModules = [ "fabric-api-base", "fabric-command-api-v1", "fabric-lifecycle-events-v1" ] // Add each module as a dependency apiModules.forEach { modImplementation(fabricApi.module(it, '0.46.4+1.18')) } include(modImplementation('me.lucko:fabric-permissions-api:0.1-SNAPSHOT')) modImplementation('eu.pb4:placeholder-api:1.1.1+1.17.1') 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-${project.pluginVersion}-dev.jar" configurations = [project.configurations.shade] relocate 'okio', 'me.lucko.spark.lib.okio' relocate 'okhttp3', 'me.lucko.spark.lib.okhttp3' relocate 'net.kyori.adventure', 'me.lucko.spark.lib.adventure' relocate 'net.kyori.examination', 'me.lucko.spark.lib.adventure.examination' relocate 'net.bytebuddy', 'me.lucko.spark.lib.bytebuddy' 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' relocate 'one.profiler', 'me.lucko.spark.lib.asyncprofiler' 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-${project.pluginVersion}-fabric.jar" } tasks.assemble.dependsOn tasks.remappedShadowJar artifacts { archives remappedShadowJar shadow shadowJar }