SpongePowered / Mixin

Mixin is a trait/mixin and bytecode weaving framework for Java using ASM
MIT License
1.42k stars 194 forks source link

deobfCompile dependencies using mixin don't work when runnning from unit tests with LWTS #218

Closed Barteks2x closed 6 years ago

Barteks2x commented 6 years ago

It's yet another issue I got trying to use MalisisCore. It runs find outside of unit tests. When running unit tests using LWTS, and after adding these lines in build.gradle dependencies section:

    testCompile.extendsFrom(forgeGradleGradleStart)
    testCompile.extendsFrom(forgeGradleMcDeps)

I'm getting this exception: https://pastebin.com/raw/rQH6gA4z

This is full ./gradlew build log after adding testLogging { showStandardStreams = true } to the test task in gradle: https://pastebin.com/raw/k7pjSczB

Using malisiscore 1.12.2-6.1.8-SNAPSHOT and mixin 0.7.5-SNAPSHOT, this commit in my mod reproduces the issue: https://github.com/OpenCubicChunks/CubicChunks/commit/28cb9d8e7197475c66bede7f2e2728f9efbdb1f9

Barteks2x commented 6 years ago

It works after adding this to my MixinServerTweaker:

System.setProperty("net.minecraftforge.gradle.GradleStart.srg.srg-mcp",
                ((File) ReflectionHelper.getPrivateValue(GradleStartCommon.class, null, "SRG_SRG_MCP")).getPath());

So this is not really a mixin issue, and looks more like just something I have to deal with in my code.