Why is this?  It's a bit unintuitive.

Even explicitly calling the method from within the subproject's own
build.gradle still causes the method to execute in the context of the parent
project in which the method is declared:

root/build.gradle:
void aMethod() {
  println getName()
}

root/child/build.gradle:
task doIt << {
  aMethod()
}

Executing :child:doIt prints "root".  It's just weird.  It's not really like
inheriting a method, in the OO sense, it's more like invoking a closure.  Is
that just the way it is?  Thanks.

--
View this message in context: 
http://gradle.1045684.n5.nabble.com/Using-methods-in-scripts-tp1435072p4340056.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to