Fix crash on Java 18 due to unpick using an outdated asm version.
Unpick will now get the same version of asm that loom is running with on its classpath.
This commit is contained in:
parent
60c908ea1b
commit
4b45783a54
1 changed files with 15 additions and 0 deletions
|
@ -48,6 +48,7 @@ import com.google.gson.JsonObject;
|
|||
import org.apache.tools.ant.util.StringUtils;
|
||||
import org.gradle.api.Project;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import net.fabricmc.loom.LoomGradleExtension;
|
||||
import net.fabricmc.loom.LoomGradlePlugin;
|
||||
|
@ -304,6 +305,20 @@ public class MappingsProviderImpl extends DependencyProvider implements Mappings
|
|||
getProject().getDependencies().add(Constants.Configurations.UNPICK_CLASSPATH,
|
||||
String.format("%s:%s:%s", unpickMetadata.unpickGroup, unpickCliName, unpickMetadata.unpickVersion)
|
||||
);
|
||||
|
||||
// Unpick ships with a slightly older version of asm, ensure it runs with at least the same version as loom.
|
||||
String[] asmDeps = new String[] {
|
||||
"org.ow2.asm:asm:%s",
|
||||
"org.ow2.asm:asm-tree:%s",
|
||||
"org.ow2.asm:asm-commons:%s",
|
||||
"org.ow2.asm:asm-util:%s"
|
||||
};
|
||||
|
||||
for (String asm : asmDeps) {
|
||||
getProject().getDependencies().add(Constants.Configurations.UNPICK_CLASSPATH,
|
||||
asm.formatted(Opcodes.class.getPackage().getImplementationVersion())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private void mergeAndSaveMappings(Project project, Path from, Path out) throws IOException {
|
||||
|
|
Loading…
Reference in a new issue