Skip to content

Commit

Permalink
Produce Java 8-compatible JARs
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Sep 17, 2024
1 parent 4de314e commit 9222fae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.fabricmc.loom.task.RemapJarTask
import org.embeddedt.embeddium.gradle.versioning.ProjectVersioner
import org.w3c.dom.Element
import xyz.wagyourtail.jvmdg.gradle.task.ShadeJar

plugins {
id("idea")
Expand All @@ -13,6 +13,8 @@ plugins {
id("embeddium-fabric-remapper")

id("com.gradleup.shadow") version "8.3.0"

id("xyz.wagyourtail.jvmdowngrader") version "1.0.0"
}

operator fun String.invoke(): String {
Expand Down Expand Up @@ -197,9 +199,9 @@ tasks.named<ShadowJar>("shadowJar").configure {
}

tasks.named<RemapJarTask>("remapJar") {
dependsOn("shadowJar")
dependsOn("shadeDowngradedApi")
archiveClassifier = ""
inputFile = tasks.getByName<ShadowJar>("shadowJar").archiveFile.get()
inputFile = tasks.getByName<ShadeJar>("shadeDowngradedApi").archiveFile.get()
}

publishing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import net.caffeinemc.mods.sodium.api.vertex.serializer.VertexSerializer;
import org.lwjgl.system.MemoryUtil;
import org.objectweb.asm.*;
import org.spongepowered.asm.mixin.MixinEnvironment;

import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -18,7 +20,7 @@ public static Bytecode generate(VertexFormatDescription srcFormat, VertexFormatD
var name = "me/jellysquid/mods/sodium/client/render/vertex/serializers/generated/VertexSerializer$Impl$" + identifier;

ClassWriter classWriter = new ClassWriter(0);
classWriter.visit(Opcodes.V17, Opcodes.ACC_FINAL | Opcodes.ACC_PUBLIC, name, null,
classWriter.visit(MixinEnvironment.getCompatibilityLevel().getClassVersion(), Opcodes.ACC_FINAL | Opcodes.ACC_PUBLIC, name, null,
Type.getInternalName(Object.class),
new String[] { Type.getInternalName(VertexSerializer.class) });

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/embeddium.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"refmap": "embeddium-refmap.json",
"required" : true,
"minVersion": "0.8",
"compatibilityLevel" : "JAVA_17",
"compatibilityLevel" : "JAVA_8",
"plugin" : "me.jellysquid.mods.sodium.mixin.SodiumMixinPlugin",
"injectors" : {
"defaultRequire" : 1
Expand Down

0 comments on commit 9222fae

Please sign in to comment.