fabric-loom icon indicating copy to clipboard operation
fabric-loom copied to clipboard

[DRAFT] Adding transformer support to be able to use remapped dependencies in any configuration.

Open marchermans opened this issue 5 years ago • 7 comments

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.

marchermans avatar Nov 30 '19 21:11 marchermans

must you get the project in such nasty ways?

liach avatar Nov 30 '19 22:11 liach

@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.

marchermans avatar Dec 01 '19 07:12 marchermans

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.

marchermans avatar Dec 01 '19 09:12 marchermans

is this ready for reviews and testing?

modmuss50 avatar Jan 01 '20 16:01 modmuss50

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.

marchermans avatar Jan 01 '20 16:01 marchermans

No, dont rush or worry at all. I was just checking you werent waiting on me or something stupid 👍

modmuss50 avatar Jan 01 '20 16:01 modmuss50

I wouldn't worry too much about the IDEA task. You can still just import Gradle instead.

natanfudge avatar Jan 01 '20 16:01 natanfudge