Project configuration order

I have a fairly complicated multi project setup and the weird problem is that one of my sub projects gets configured before the root projects ‘allprojects’ closure executes. The result is that at the time where my project is configured the version is not yet set up (since it gets set in all projects).

I have tried to replicate this with a simpler build but failed to do so. Is there a way how to debug this problem?

The best questions are the ones that you answer yourself just half an hour after you post them.

The reason for the weird execution order was that I specified a dependency in the root project above the allprojects closure which was kind of dumb. This was done in a somewhat hidden fashion by an unsuspecting

apply from: 'gradle-file-with-dependency.gradle'