>
> 2) I don't understand why methods defined in an included file are not
> visible in the file that includes it:
> // included.gradle
> def helper() {}
>
> // build.gradle
> apply from: 'included.gradle'
> helper() // fails: no such method
>

This looks like Groovy hassle to me. If you do

def a = 1

then it's local to the script. However, if you write

a = 1

then it's stored in the binding and is "global". For methods, I'm not sure,
but writing it as a closure should work:

helper = { -> ... }

That said, I'm not sure if Gradle doesn't work differently (e.g., executing
each applied script in its own context), but that would prevent another
stuff that works now, so I guess not.

LT

Reply via email to