org.gradle.api.tasks

## Interface SourceSetContainer

- All Superinterfaces:
    Collection<SourceSet>, org.gradle.util.Configurable<NamedDomainObjectContainer<SourceSet>>, DomainObjectCollection<SourceSet>, Iterable<SourceSet>, NamedDomainObjectCollection<SourceSet>, NamedDomainObjectContainer<SourceSet>, NamedDomainObjectSet<SourceSet>, Set<SourceSet>

      public interface SourceSetContainer
      extends NamedDomainObjectContainer<SourceSet>, NamedDomainObjectSet<SourceSet>

  A `SourceSetContainer` manages a set of `SourceSet` objects.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `SourceSet` | `add(String name)` Deprecated. use `NamedDomainObjectContainer.create(String)` instead
    `SourceSet` | `add(String name, Closure configureClosure)` Deprecated. use `NamedDomainObjectContainer.create(String, groovy.lang.Closure)` instead

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

      `configure, create, create, create, maybeCreate`

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

      `findAll, matching, matching, withType`

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

      `add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getNames, getRules`

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

      `all, all, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withType`

    - ### Methods inherited from interface java.util.Collection

      `clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray`

    - ### Methods inherited from interface java.util.Set

      `add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray`

- - ### Method Detail

    - #### add

          @Deprecated
          SourceSet add(String name)
                        throws InvalidUserDataException

      Deprecated. use `NamedDomainObjectContainer.create(String)` instead
      Adds a source set with the given name.
      Parameters:
        `name` - The name of the new source set.
      Returns:
        The newly added source set.
      Throws:
        `InvalidUserDataException` - when a source set with the given name already exists in this container.

    - #### add

          @Deprecated
          SourceSet add(String name,
                                 Closure configureClosure)
                        throws InvalidUserDataException

      Deprecated. use `NamedDomainObjectContainer.create(String, groovy.lang.Closure)` instead
      Adds a source set with the given name. The given configuration closure is executed against the source set before it is returned from this method.
      Parameters:
        `name` - The name of the new source set.
        `configureClosure` - The closure to use to configure the source set.
      Returns:
        The newly added source set.
      Throws:
        `InvalidUserDataException` - when a source set with the given name already exists in this container.