This must run only when a specific task is used, so that is why the task graph check is used.
The problem is that in some setups the task graph is not completely populated when the closure is called. Anybody know of a way to get around this problem?
Thanks, but how do I get to the resolved dependencies from that callback? Or can I stash them away in the incoming.afterResolve callback somehow and use them from the task graph ready callback?
Looking again, the fact that when the configuration is resolved before the task graph is ready is usually indicative of a problem in your build script.
If a configuration is resolved before the task graph is ready, your build is going to be slow for every task because you are resolving dependencies during the evaluation phase.
Do you know why the configuration is being resolved during evaluation?
Duh…of course. That was actually where I had that check in the first version, but used resolvedConfiguration instead of simply configuration. So now I’m full circle back where I was a month ago, almost
Resolving starts when the files of a configuration are first requested. When this happens depends on the particular build - as a plugin author you shouldn’t make any assumptions here. From my understanding of the problem that you are trying to solve, the releasePrepare task should resolve all configurations and then search them for snapshot dependencies. In this case you don’t need to check the task graph.
as I got the impression that this was the better solution. For my usecase I think it is better to just look at the nearest dependencies anyway and not looking at transitive ones. The reasoning is that it might exist 3rd party libraries having a release that depends on a snapshot build of another library. In that case a user of my plugin would have a bit of a problem
NB! This plugin is only applied to the root module in a multi-module project.
But these last comments where really only for finding out where my build is resolving configurations too early, as Luke mentioned above