org.gradle.runtime.base.library

## Class DefaultLibrarySpec

- java.lang.Object
- - org.gradle.runtime.base.library.DefaultLibrarySpec

- All Implemented Interfaces:
    Named, ComponentSpec, LibrarySpec

      @Incubating
      public class DefaultLibrarySpec
      extends Object
      implements LibrarySpec

  Base class for custom library implementations. A custom implementation of `LibrarySpec` must extend this type.

- - ### Nested Class Summary

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

      `Named.Namer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultLibrarySpec()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T extends DefaultLibrarySpec> T` | `create(Class<T> type, ComponentSpecIdentifier identifier, FunctionalSourceSet mainSourceSet, org.gradle.internal.reflect.Instantiator instantiator)`
    `DomainObjectSet<BinarySpec>` | `getBinaries()` The binaries that are built for this component.
    `String` | `getDisplayName()` Returns a human-consumable display name for this component.
    `FunctionalSourceSet` | `getMainSource()`
    `String` | `getName()` The object's name.
    `String` | `getProjectPath()` The path the the project containing this component.
    `DomainObjectSet<LanguageSourceSet>` | `getSource()` The source sets that are used to build this component.
    `void` | `source(Object sources)` Adds one or more `LanguageSourceSet`s that are used to compile this binary.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultLibrarySpec

          public DefaultLibrarySpec()

  - ### Method Detail

    - #### create

          public static <T extends DefaultLibrarySpec> T create(Class<T> type,
                                                ComponentSpecIdentifier identifier,
                                                FunctionalSourceSet mainSourceSet,
                                                org.gradle.internal.reflect.Instantiator instantiator)

    - #### getName

          public String getName()

      Description copied from interface: `Named`
      The object's name.

      Must be constant for the life of the object.

      Specified by:
        `getName` in interface `Named`
      Returns:
        The name. Never null.

    - #### getProjectPath

          public String getProjectPath()

      Description copied from interface: `ComponentSpec`
      The path the the project containing this component.
      Specified by:
        `getProjectPath` in interface `ComponentSpec`

    - #### getDisplayName

          public String getDisplayName()

      Description copied from interface: `ComponentSpec`
      Returns a human-consumable display name for this component.
      Specified by:
        `getDisplayName` in interface `ComponentSpec`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getSource

          public DomainObjectSet<LanguageSourceSet> getSource()

      Description copied from interface: `ComponentSpec`
      The source sets that are used to build this component.
      Specified by:
        `getSource` in interface `ComponentSpec`

    - #### source

          public void source(Object sources)

      Description copied from interface: `ComponentSpec`
      Adds one or more `LanguageSourceSet`s that are used to compile this binary.

      This method accepts the following types:
      - A `FunctionalSourceSet`
      - A `LanguageSourceSet`
      - A Collection of `LanguageSourceSet`s
      Specified by:
        `source` in interface `ComponentSpec`

    - #### getBinaries

          public DomainObjectSet<BinarySpec> getBinaries()

      Description copied from interface: `ComponentSpec`
      The binaries that are built for this component. You can use this to configure the binaries for this component.
      Specified by:
        `getBinaries` in interface `ComponentSpec`

    - #### getMainSource

          public FunctionalSourceSet getMainSource()