Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19888

Apply inside of buildscript{}

$
0
0

A groovy Closure can have a delegate. Groovy will attempt to match method invocations defined inside the closure to the delegate. Gradle uses the DELEGATE_FIRST resolve strategy on the closures within the gradle DSL which means that method resolution will first be attempted on the closure delegate, and if no matching method can be found it will “bubble up” to the owner which is usually the delegate of the wrapping closure.

At the root of the resolution tree is a Project instance which is the delegate of the whole script. Method resolution will always “bubble up” to the project instance where a matching method can’t be found on the closure delegate.


Viewing all articles
Browse latest Browse all 19888

Trending Articles