Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gradle.api.artifacts
Interface ConfigurationContainer

All Superinterfaces:
  DomainObjectCollection<Configuration>, DomainObjectContainer<Configuration>, java.lang.Iterable<Configuration>

All Known Subinterfaces:
  ConfigurationHandler

    public interface ConfigurationContainer

extends DomainObjectContainer<Configuration>

A `ConfigurationContainer` is responsible for managing a set of `Configuration` instances.

You can obtain a `ConfigurationContainer` instance by calling `Project.getConfigurations()`, or using the `configurations` property in your build script.

The configurations in a container are accessable as read-only properties of the container, using the name of the configuration as the property name. For example:

     configurations.add('myConfiguration')
     configurations.myConfiguration.transitive = false

A dynamic method is added for each configuration which takes a configuration closure. This is equivalent to calling `getByName(String, groovy.lang.Closure)`. For example:

     configurations.add('myConfiguration')
     configurations.myConfiguration {
         transitive = false
     }

Method Summary
`Configuration` | `add(java.lang.String name)` Adds a configuration with the given name.
`Configuration` | `add(java.lang.String name, groovy.lang.Closure configureClosure)` Adds a configuration with the given name.
`Configuration` | `detachedConfiguration(Dependency... dependencies)` Creates a configuration, but does not add it to this container.
`Configuration` | `getAt(java.lang.String name)` Locates an object by name, failing if there is no such task.
`Configuration` | `getByName(java.lang.String name)` Locates an object by name, failing if there is no such object.
`Configuration` | `getByName(java.lang.String name, groovy.lang.Closure configureClosure)` Locates an object by name, failing if there is no such object.

Methods inherited from interface org.gradle.api.DomainObjectContainer
`addRule, getRules`

Methods inherited from interface org.gradle.api.DomainObjectCollection
`allObjects, allObjects, findAll, findByName, getAll, getAsMap, matching, whenObjectAdded, whenObjectAdded, whenObjectRemoved, withType`

Methods inherited from interface java.lang.Iterable
`iterator`

Method Detail

### getByName

    Configuration getByName(java.lang.String name)
                            throws UnknownConfigurationException

  Locates an object by name, failing if there is no such object.

  Specified by:
    `getByName` in interface `DomainObjectCollection<Configuration>`
  Parameters:
    `name` - The object name
  Returns:
    The object with the given name. Never returns null.
  Throws:
    `UnknownConfigurationException`

### getAt

    Configuration getAt(java.lang.String name)
                        throws UnknownConfigurationException

  Locates an object by name, failing if there is no such task. This method is identical to `DomainObjectCollection.getByName(String)`. You can call this method in your build script by using the groovy `[]` operator.

  Specified by:
    `getAt` in interface `DomainObjectCollection<Configuration>`
  Parameters:
    `name` - The object name
  Returns:
    The object with the given name. Never returns null.
  Throws:
    `UnknownConfigurationException`

### getByName

    Configuration getByName(java.lang.String name,
                            groovy.lang.Closure configureClosure)
                            throws UnknownConfigurationException

  Locates an object by name, failing if there is no such object. The given configure closure is executed against the object before it is returned from this method. The object is passed to the closure as it's delegate.

  Specified by:
    `getByName` in interface `DomainObjectCollection<Configuration>`
  Parameters:
    `name` - The object name
    `configureClosure` - The closure to use to configure the object.
  Returns:
    The object with the given name, after the configure closure has been applied to it. Never returns null.
  Throws:
    `UnknownConfigurationException`

### add

    Configuration add(java.lang.String name)
                      throws InvalidUserDataException

  Adds a configuration with the given name.

  Parameters:
    `name` - The name of the new configuration.
  Returns:
    The newly added configuration.
  Throws:
    `InvalidUserDataException` - when a configuration with the given name already exists in this container.

### add

    Configuration add(java.lang.String name,
                      groovy.lang.Closure configureClosure)
                      throws InvalidUserDataException

  Adds a configuration with the given name. The given configuration closure is executed against the configuration before it is returned from this method.

  Parameters:
    `name` - The name of the new configuration.
    `configureClosure` - The closure to use to configure the configuration.
  Returns:
    The newly added configuration.
  Throws:
    `InvalidUserDataException` - when a configuration with the given name already exists in this container.

### detachedConfiguration

    Configuration detachedConfiguration(Dependency... dependencies)

  Creates a configuration, but does not add it to this container.

  Parameters:
    `dependencies` - The dependencies of the configuration.
  Returns:
    The configuration.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD