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


(tess.thyer) #1

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?


(Peter Niederwieser) #2

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


(tess.thyer) #3

Thanks! That solved my problem.