Skip to content

Commit

Permalink
Gradle8.4, librarianlib fix from Trousers
Browse files Browse the repository at this point in the history
  • Loading branch information
kappa-maintainer committed Nov 22, 2023
1 parent b53f582 commit 53538d2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
14 changes: 8 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ project(':cleanroom') {
environment 'FORGE_GROUP', project.group
environment 'FORGE_VERSION', props.new_forge_version

jvmArgs jvm_arguments + ' -Djava.library.path=' + project.file('build/natives') + ' -Dmixin.debug=true'
// jvmArgs jvm_arguments
//jvmArgs jvm_arguments + ' -Djava.library.path=' + project.file('build/natives') + ' -Dmixin.debug=true'
jvmArgs jvm_arguments

// Lazily supply the Mappings target, createSrg2Mcp.getMappings() doesn't get populated until later
lazyToken 'mcp_mappings', { ->
Expand Down Expand Up @@ -458,8 +458,8 @@ project(':cleanroom') {
installer 'com.google.code.findbugs:jsr305:3.0.2'

// TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version
installer 'org.apache.logging.log4j:log4j-api:2.21.1'
installer 'org.apache.logging.log4j:log4j-core:2.21.1'
installer 'org.apache.logging.log4j:log4j-api:2.22.0'
installer 'org.apache.logging.log4j:log4j-core:2.22.0'
installer 'javax.annotation:javax.annotation-api:1.3.2'
installer 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.1'
installer 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
Expand Down Expand Up @@ -1035,8 +1035,10 @@ project(':cleanroom') {
// TODO: MDK Task

userdevConfig {
Util.getArtifacts(project, project.configurations.installer, true).each { key, lib -> libraries.add(lib.name) }
artifacts
def artifacts = Util.getArtifacts(project, project.configurations.installer, true)
artifacts.each { key, lib ->
libraries.add(lib.name)
}
libraries.add('net.minecraftforge:legacydev:0.2.3.+:fatjar')
universalFilters.add('^(?!binpatches\\.pack\\.lzma$).*$')

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ patch_version = 0

# MAJOR.SPEC_MAJOR.SPEC_MINOR.BUILD
last_forge_version = 14.23.5.2860
new_forge_version = 15.24.0.3009
new_forge_version = 15.24.0.3010

# Minecraft & Mappings
mapping_channel = stable
Expand All @@ -26,7 +26,7 @@ installer_tools_version = 1.3.0
# Libraries
asm_version = 9.6
asm_deprecated = 7.1
bouncepad_version = 0.4.6-cursed
bouncepad_version = 0.4.9-cursed
lwjgl_version = 3.3.2-22-CLEANROOM

# Sets default memory used for Gradle commands. Can be overridden by user or command line properties.
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private static byte[] makeWrapper(String fileName)

ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES);

writer.visit(Opcodes.V1_6, Opcodes.ACC_PUBLIC, name, null, wrapper.getInternalName(), null);
writer.visit(Opcodes.V17, Opcodes.ACC_PUBLIC, name, null, wrapper.getInternalName(), null);

Method m = Method.getMethod("void <init> ()");
GeneratorAdapter mg = new GeneratorAdapter(Opcodes.ACC_PUBLIC, m, null, null, writer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public Class<?> createWrapper(Method callback)
MethodVisitor mv;

boolean isStatic = Modifier.isStatic(callback.getModifiers());
boolean isInterface = callback.getDeclaringClass().isInterface();
String name = getUniqueName(callback);
String desc = name.replace('.', '/');
String instType = Type.getInternalName(callback.getDeclaringClass());
Expand All @@ -124,7 +125,7 @@ public Class<?> createWrapper(Method callback)
System.out.println("Event: " + eventType);
*/

cw.visit(V1_6, ACC_PUBLIC | ACC_SUPER, desc, null, "java/lang/Object", new String[]{ HANDLER_DESC });
cw.visit(V17, ACC_PUBLIC | ACC_SUPER, desc, null, "java/lang/Object", new String[]{ HANDLER_DESC });

cw.visitSource(".dynamic", null);
{
Expand Down Expand Up @@ -157,7 +158,7 @@ public Class<?> createWrapper(Method callback)
}
mv.visitVarInsn(ALOAD, 1);
mv.visitTypeInsn(CHECKCAST, eventType);
mv.visitMethodInsn(isStatic ? INVOKESTATIC : INVOKEVIRTUAL, instType, callback.getName(), Type.getMethodDescriptor(callback), false);
mv.visitMethodInsn(isStatic ? INVOKESTATIC : INVOKEVIRTUAL, instType, callback.getName(), Type.getMethodDescriptor(callback), isInterface);
mv.visitInsn(RETURN);
mv.visitMaxs(2, 2);
mv.visitEnd();
Expand Down

0 comments on commit 53538d2

Please sign in to comment.