api / org.gradle.model / ModelMap / named

named

abstract fun named(name: String, configAction: Action<in T>): Unit

Applies the given action to the given item, when the item is required.

The given action is invoked to configure the item when the item is required. It is called after any actions provided to #beforeEach(org.gradle.api.Action) and #create(String, * org.gradle.api.Action).

Parameters

name - The name.

configAction - An action that configures the item. The action is executed when the item is required.

abstract fun named(name: String, ruleSource: Class<out RuleSource>): Unit

Applies the given rule source class to the given item, when the item is required.

Rules are applied in the scope of the item therefore:

Parameters

name - The name.

ruleSource - A rule source class.