Package org.gradle.api.initialization

# Interface SharedModelDefaults

@Incubating @ServiceScope(org.gradle.internal.service.scopes.Scope.Build.class) public interface SharedModelDefaults
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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `<T> void`
  `add(String name, Class<T> publicType, Action<? super T> configureAction)`
  Adds a model default for the project type specified by the given name.
  `ProjectLayout`
  `getLayout()`
  Provides access to the project layout when default configurations are evaluated in the context of specific projects.

- ## Method Details

  - ### getLayout

    ProjectLayout getLayout()
    Provides access to the project layout when default configurations are evaluated in the context of specific projects.

    Meant to be used only inside the `defaults{}` block in settings scripts. If used in other contexts, behaviour is undefined.

    Since:
      8.14

  - ### add

    <T> void add(String name, Class<T> publicType, Action<? super T> configureAction)
    Adds a model default for the project type specified by the given name.
    Parameters:
      `name` - the name of the project type
      `publicType` - the public type of the project type
      `configureAction` - the action to configure the project type
    Since:
      8.10