Reusing subproject methods in root project

I have a method that should be called in both root and sub projects.
The said method should reside in the sub-project however.

As far as I know, the only way to share this method with the root project is writing it to ext.method={}.
How do I evaluate the sub-project first in order to expose the shared method to the root project?

Is there a more elegant way to achieve the behaviour described above?