You can see from the Project.buildscript(Closure) javadoc that
The given closure is executed against this project’s
ScriptHandler
. TheScriptHandler
is passed to the closure as the closure’s delegate.
I can’t see any reference to an apply method in ScriptHandler so I’m guessing the method “bubbles up” to the project.
You could try adding “println buildscript.class.name” to your build.gradle
to see what class it is. Perhaps the concrete class implements PluginAware. If it does, the javadocs should probably be updated (eg perhaps ScriptHandler should extend PluginAware)