Slackbot
03/08/2022, 12:49 PMMarkus Maier
03/08/2022, 12:51 PMcompileClasspaths are probably needed to determine task dependencies, so those should be ok, no?grossws
03/08/2022, 4:18 PMcompileClasspath and similar are usually resolved on execution when they are required for some compile task, same with code generation plugins if they are written correctly using lazy APIs.
If you just want to catch who resolves configurations before execution you can try execute some task like help with init script to delete all repos from dependencyResolutionManagement and `Project`s.
Another place to hook could be ConfigurationInternal#beforeLocking but I'm not sure when exactly it's fired and keep in mind that it's gradle internal interface so it's intrinsically unstable to depend on itMarkus Maier
03/08/2022, 4:34 PMhelp would work, though, since configuration-avoidance prevents configuration of tasks that are not executed, so that's not good, no? Something like assemble -m might work, but that still won't tell me which task is causing the resolve, which is what I actually want to find outgrossws
03/08/2022, 5:05 PMhelp shouldn't trigger materialization of tasks in TasksContainer but could catch those which used eager api. And after that you could call tasks.all { ... } to materialize all tasks in configuration phase.
Idea with removing repos (and removing cache or pointing to empty gradle home dir) is to break on tasks which resolved configurations before execution phase.
I've never had issue similar to yours so suggestions above are just some ideas on possible approachMarkus Maier
03/08/2022, 7:54 PMgrossws
03/08/2022, 11:26 PMpluginsManagement#plugins or adding version catalogs) but most tasks shouldn't require it.
Good luck with identifying if there are such issues. I'd be interested to hear which approach works afterwards in case I have to do something similar in future.Markus Maier
03/09/2022, 10:58 AMgradlew build -m -i on a clean cache dir looks promising, the log shows me for which task something is downloaded. Most of what I see there is ok, or at least probably unavoidable.
Thanks for the helpful discussion, this got me thinking in a new direction!