How do I give a utility method project scope rather than script scope?

I have a multi-script gradle project, and a utility method defined in one of the scripts whose scope is confined to that script. Is there a way to broaden its scope to the whole project?

1 Like

You can use ‘ext.foo = { arg1, arg2 -> … }’ instead of ‘def foo(arg1, arg2) { … }’, then use it as if it was a method.

1 Like

Thanks! That solved my problem.