plugins { id 'io.github.goooler.shadow' version '8.1.7' id 'net.minecraftforge.gradle' version '[6.0.24,6.2)' } tasks.withType(JavaCompile) { // override, compile targeting J21 options.release = 21 } minecraft { mappings channel: 'official', version: '1.21' accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') } configurations { shade implementation.extendsFrom shade } dependencies { minecraft 'net.minecraftforge:forge:1.21-51.0.8' shade project(':spark-common') } processResources { from(sourceSets.main.resources.srcDirs) { include 'META-INF/mods.toml' expand ( 'pluginVersion': project.pluginVersion, 'pluginDescription': project.pluginDescription ) } from(sourceSets.main.resources.srcDirs) { exclude 'META-INF/mods.toml' } } shadowJar { archiveFileName = "spark-${project.pluginVersion}-forge.jar" configurations = [project.configurations.shade] relocate 'net.kyori.adventure', 'me.lucko.spark.lib.adventure' relocate 'net.kyori.examination', 'me.lucko.spark.lib.adventure.examination' relocate 'net.kyori.option', 'me.lucko.spark.lib.adventure.option' relocate 'net.bytebuddy', 'me.lucko.spark.lib.bytebuddy' 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' relocate 'me.lucko.bytesocks.client', 'me.lucko.spark.lib.bytesocks' relocate 'org.java_websocket', 'me.lucko.spark.lib.bytesocks.ws' exclude 'module-info.class' exclude 'META-INF/maven/**' exclude 'META-INF/proguard/**' exclude '**/*.proto' exclude '**/*.proto.bin' } artifacts { archives shadowJar shadow shadowJar } reobf { shadowJar { dependsOn createMcpToSrg mappings = createMcpToSrg.outputs.files.singleFile } }