For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

getByName

abstract fun getByName(name: String, configureClosure: Closure): T(source)

Locates an object by name, failing if there is no such object. The given configure closure is executed against the object before it is returned from this method. The object is passed to the closure as its delegate.

This operation is eager and will cause the returned element to be realized.


abstract fun getByName(name: String): T(source)

Locates an object by name, failing if there is no such object.

This operation is eager and will cause the returned element to be realized.