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.

SharedModelDefaults

@ServiceScope(value = Build::class)
interface SharedModelDefaults(source)

Shared model defaults for configuring project types. Defaults apply initial values to the model objects of project types. When a project type plugin is applied to a project, the model object for the project type will be pre-configured with the values set in the default.

Since

8.10

Functions

Link copied to clipboard
abstract fun <T> add(name: String, publicType: Class<T>, configureAction: Action<in T>)
Adds a model default for the project type specified by the given name.
Link copied to clipboard
inline fun <T : Any> SharedModelDefaults.add(name: String, publicType: KClass<T>, configureAction: Action<in T>)
Link copied to clipboard
abstract fun getLayout(): ProjectLayout
Provides access to the project layout when default configurations are evaluated in the context of specific projects.