fabric-loom
fabric-loom copied to clipboard
[DRAFT] Adding transformer support to be able to use remapped dependencies in any configuration.
Current situation
In the current situation a custom configuration is used to adapt and remap the mod dependencies to the mapping as defined by the user. Even though this works as intended it is not entirely compatible with Gradle spec.
New situation
This implements transformers that interact with all dependencies added to the project and will transform them accordingly. The transformers call the old methods, which where previously looping over a configuration. Each transformer will initially detect if the artifact passed in a valid Fabric Mod before performing either a remap of a library jar, or a sources jar.
must you get the project in such nasty ways?
@liach Sadly yes, gradle uses a custom injector system to inject data into the transformers itself, as such what can be injected is extremely limited. (Basically only its inputs). Additionally Transformers need to perform a pure action and their parameters need to be isolateble. In this context that means that the entire parameter set needs to be serializable.
In the current context this means that to get the external data (the data needed to remap, for example the MC dependency or the mapping data) from the project config there is literally only one way.
That said I am currently looking into a technology stack which would pass all of that information through to us without having to use the project at all. But yeah as of right now this PR also needs an update of TinyRemapper since that can not handle being uses in a multithreaded environment. And just crashes. Hence it being a draft as well.
For everybody reading this: This PR needs a bug fix in TinyRemapper to be usefull: https://github.com/FabricMC/tiny-remapper/issues/7 is the hanging issue.
is this ready for reviews and testing?
I am still working on it. That damn IDEA task is kind of difficult to deal with. Also christmas, and 3 birthdays in one week kind of took its toll. Getting back on my horse though.
No, dont rush or worry at all. I was just checking you werent waiting on me or something stupid 👍
I wouldn't worry too much about the IDEA task. You can still just import Gradle instead.