Package org.gradle.api.initialization.dsl

## Interface VersionCatalogBuilder

- All Superinterfaces:
    `Named`

      @Incubating
      public interface VersionCatalogBuilder
      extends Named

  A version catalog builder. Dependencies defined via this model will trigger the generation of accessors available in build scripts.
  Since:
    7.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static interface` | `VersionCatalogBuilder.AliasBuilder` | Allows configuring an alias
    `static interface` | `VersionCatalogBuilder.LibraryAliasBuilder` | Allows configuring the version of a library
    `static interface` | `VersionCatalogBuilder.PluginAliasBuilder` | Allows configuring the version of a plugin

    - ### Nested classes/interfaces inherited from interface org.gradle.api.Named

      `Named.Namer`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `VersionCatalogBuilder.AliasBuilder` | `alias​(String alias)` | Entry point for registering an alias for a library
    `void` | `bundle​(String name, List<String> aliases)` | Declares a bundle of dependencies.
    `void` | `from​(Object dependencyNotation)` | Configures the model by reading it from a version catalog.
    `Property<String>` | `getDescription()` | A description for the dependencies model, which will be used in the generated sources as documentation.
    `String` | `getLibrariesExtensionName()` | Returns the name of the extension configured by this builder
    `String` | `version​(String name, String version)` | Configures a dependency version which can then be referenced using the `VersionCatalogBuilder.LibraryAliasBuilder.versionRef(String)` method.
    `String` | `version​(String name, Action<? super MutableVersionConstraint> versionSpec)` | Configures a dependency version which can then be referenced using the `VersionCatalogBuilder.LibraryAliasBuilder.versionRef(String)` )} method.

    - ### Methods inherited from interface org.gradle.api.Named

      `getName`

- - ### Method Detail

    - #### getDescription

          Property<String> getDescription()

      A description for the dependencies model, which will be used in the generated sources as documentation.
      Returns:
        the description for this model

    - #### from

          void from​(Object dependencyNotation)

      Configures the model by reading it from a version catalog. A version catalog is a component published using the `version-catalog` plugin or a local TOML file. All imports configured by this method will be accumulated in order and executed before any other modification provided by this builder, such that "local" modifications have higher priority than any imported component.
      Parameters:
        `dependencyNotation` - any notation supported by `DependencyHandler`

    - #### version

          String version​(String name,
                         Action<? super MutableVersionConstraint> versionSpec)

      Configures a dependency version which can then be referenced using the `VersionCatalogBuilder.LibraryAliasBuilder.versionRef(String)` )} method.
      Parameters:
        `name` - an identifier for the version
        `versionSpec` - the dependency version spec
      Returns:
        the version alias name

    - #### version

          String version​(String name,
                         String version)

      Configures a dependency version which can then be referenced using the `VersionCatalogBuilder.LibraryAliasBuilder.versionRef(String)` method.
      Parameters:
        `name` - an identifier for the version
        `version` - the version string

    - #### alias

          VersionCatalogBuilder.AliasBuilder alias​(String alias)

      Entry point for registering an alias for a library
      Parameters:
        `alias` - the alias identifer
      Returns:
        a builder for this alias

    - #### bundle

          void bundle​(String name,
                      List<String> aliases)

      Declares a bundle of dependencies. A bundle consists of a name for the bundle, and a list of aliases. The aliases must correspond to aliases defined via the `alias(String)` method.
      Parameters:
        `name` - the name of the bundle
        `aliases` - the aliases of the dependencies included in the bundle

    - #### getLibrariesExtensionName

          String getLibrariesExtensionName()

      Returns the name of the extension configured by this builder