fabric-loom
fabric-loom copied to clipboard
Adding a `whenTaskAdded` hook before loom applies causes loom to fail (and hooking after with loom 0.11+)
Seems to happen with loom 0.7 and above minimum
PoC: https://github.com/p03w-rehost/LoomFailurePoC
When testing, make sure to publish to maven local first (LoomFailurePoCPlugin:publishToMavenLocal
) before un-commenting the apply block in build.gradle
0.7-0.10 gives
> Failed to apply plugin 'fabric-loom'.
> Could not create task ':runClient'.
> Could not create task of type 'RunGameTask'.
> Run configuration 'client' must specify 'defaultMainClass'
0.11 and 0.12 both give
> Failed to apply plugin 'fabric-loom'.
> Task with name 'genIdeaWorkspace' not found in root project 'LoomFailure'.
Likely because I'm using IDEA, unknown behavior on eclipse
0.11 and 0.12 with the plugin applying after gives
> Failed to apply plugin 'io.github.p03w.loomFailure'.
> Could not create task ':extractNatives'.
> Could not create task of type 'ExtractNativesTask'.
> Cannot get MinecraftProvider before it has been setup
whenTaskAdded
isnt great as it forces all tasks to instantly be configured, I would try using configureEach
. I dont think we can really solve this tbh.
Technically this could be solved if tasks are only registered when it's safe to run their initialisers (or register the initialisers only when it's safe to do so), but that's quite a change in the code base
I dont think think is something we are going to change. You shouldnt realise all of the tasks at once.