Added compile-time interface injection
This adds compile-time interface injection via JST. I copied most of the task logic from the AT task. I inserted it after the AT task in the task dependency graph.
I also added a new source set for the interfaces so that the MC source set can compile against them properly. This set depends on the API set, and the main+test sets depend on the interface set. I'm not sure where the mixin set is defined, but hopefully the transient dep will be pulled in because I know it depends on main.
There's an example in the test mod that should compile fine. It adds a new interface to World and WorldClient. There's some code that should cause a syntax error if the injection isn't done properly.
I'm not to what extent you want this to only be used by "low level code" but if this ends up being used in "regular mods" it might be nice to be able to define directly in code what those interfaces get injected into, maybe as an annotation on the interface itself. If making that annotation functionally be the source of the injection would prove problematic, I guess a "documentation annotation" might suffice, with JavaDoc on that annotation telling you where to look for injections of that interface.
@YannickMG I'm not sure it's viable to do something like the @Mixin annotation, because it would require the interface source set to be compiled, then we would need to load the classes and detect the interfaces manually.
Realistically, each mod will only have one monolithic injection config since configs from the dependencies aren't inherited. AFAIK there isn't an easy way to publish arbitrary artifacts along with jars (so that the task can append those configs when building). We'd need to hack together some custom system to emulate that, which doesn't provide much value. These interfaces won't change once published.
can you explain how you intend on using this ?
So far from what I understand you are injecting interfaces in the sourceset sure, but it's the default implementation of the method that runs ? Does it inject specific method implementations of these interfaces in the targeted class ? How does that work during runtime ?
@Alexdoru It doesn't do anything at runtime, the main purpose is to avoid casting MC objects into mixin'd interfaces. The default methods are to avoid compilation errors from the target classes not implementing those methods.