Skip to content

Commit

Permalink
use asm fix from adventure-platform-mod
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Dec 2, 2024
1 parent 2859f59 commit 8a3b79a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies {
compileOnly "net.fabricmc:sponge-mixin:0.15.4+mixin.0.8.7"
compileOnly "io.github.llamalad7:mixinextras-common:0.4.1"
// work around minecraft (MDG) forcing ASM 9.3 which is incompatible with the above deps...
components.withModule("net.neoforged:minecraft-dependencies", RemoveAsmDependency.class)
components.withModule("net.neoforged:minecraft-dependencies", RemoveAsmConstraint.class)

api("ca.spottedleaf:concurrentutil:${rootProject.concurrentutil_version}")
api("ca.spottedleaf:yamlconfig:${rootProject.yamlconfig_version}")
Expand Down
24 changes: 24 additions & 0 deletions buildSrc/src/main/java/RemoveAsmConstraint.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import java.util.Objects;
import org.gradle.api.artifacts.CacheableRule;
import org.gradle.api.artifacts.ComponentMetadataContext;
import org.gradle.api.artifacts.ComponentMetadataRule;

@CacheableRule
public abstract class RemoveAsmConstraint implements ComponentMetadataRule {
@Override
public void execute(final ComponentMetadataContext ctx) {
ctx.getDetails().allVariants(variants -> {
variants.withDependencies(deps -> {
deps.forEach(dep -> {
if (Objects.equals(dep.getGroup(), "org.ow2.asm")) {
if (dep.getVersionConstraint().getStrictVersion() != null) {
dep.version(v -> {
v.require(v.getStrictVersion());
});
}
}
});
});
});
}
}
14 changes: 0 additions & 14 deletions buildSrc/src/main/java/RemoveAsmDependency.java

This file was deleted.

0 comments on commit 8a3b79a

Please sign in to comment.