Groovy scope rules mean that outside of a class definition, i.e. in a script:
final x = 1
def X ( ) {
x
}
fails due to the way code is constructed into a class. The usual trick
is to make use of the script binding:
x = 1
def X ( ) {
x
}
works fine -- in a Groovy script. This used to work fine in a Gradle
script as well, but this is no longer the case. Deprecation warnings
about project.ext get issued.
One solution is to never use functions in Gradle scripts, but always to
use variables bound to lambda functions.
Is there though a way around this fact that Gradle scripts obey Groovy
script scoping but no longer have a script binding usable in the Gradle
script?
Thanks.
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected]
41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected]
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
