Groovy Documentation

org.gradle.api.artifacts
[Java] Interface ConfigurationContainer

org.gradle.api.artifacts.ConfigurationContainer
  org.gradle.api.DomainObjectCollection
      java.lang.Iterable
          org.gradle.api.NamedDomainObjectSet
              org.gradle.api.NamedDomainObjectContainer
                  java.util.Collection
                      org.gradle.api.NamedDomainObjectCollection
All Superinterfaces:
DomainObjectCollection, NamedDomainObjectSet, NamedDomainObjectContainer, NamedDomainObjectCollection

public interface ConfigurationContainer
extends NamedDomainObjectContainer

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
 }
 
Authors:
Hans Dockter


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)

{@inheritDoc}

Configuration getByName(java.lang.String name)

{@inheritDoc}

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

{@inheritDoc}

 
Methods inherited from interface NamedDomainObjectContainer
configure, create, create
 
Methods inherited from interface org.gradle.util.Configurable
org.gradle.util.Configurable#configure(groovy.lang.Closure)
 
Methods inherited from interface NamedDomainObjectSet
matching, matching, withType
 
Methods inherited from interface java.util.Set
java.util.Set#add(java.lang.Object), java.util.Set#equals(java.lang.Object), java.util.Set#hashCode(), java.util.Set#clear(), java.util.Set#size(), java.util.Set#isEmpty(), java.util.Set#contains(java.lang.Object), java.util.Set#addAll(java.util.Collection), java.util.Set#toArray(), java.util.Set#toArray([Ljava.lang.Object;), java.util.Set#iterator(), java.util.Set#remove(java.lang.Object), java.util.Set#removeAll(java.util.Collection), java.util.Set#containsAll(java.util.Collection), java.util.Set#retainAll(java.util.Collection)
 
Methods inherited from interface NamedDomainObjectCollection
add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getRules, matching, matching, withType
 
Methods inherited from interface DomainObjectCollection
all, all, allObjects, allObjects, findAll, getAll, matching, matching, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withType, withType
 
Methods inherited from interface java.util.Collection
java.util.Collection#add(java.lang.Object), java.util.Collection#equals(java.lang.Object), java.util.Collection#hashCode(), java.util.Collection#clear(), java.util.Collection#size(), java.util.Collection#isEmpty(), java.util.Collection#contains(java.lang.Object), java.util.Collection#addAll(java.util.Collection), java.util.Collection#toArray(), java.util.Collection#toArray([Ljava.lang.Object;), java.util.Collection#iterator(), java.util.Collection#remove(java.lang.Object), java.util.Collection#removeAll(java.util.Collection), java.util.Collection#containsAll(java.util.Collection), java.util.Collection#retainAll(java.util.Collection)
 

Method Detail

add

public Configuration add(java.lang.String name)
Adds a configuration with the given name.
throws:
InvalidUserDataException when a configuration with the given name already exists in this container.
Parameters:
name - The name of the new configuration.
Returns:
The newly added configuration.


add

public Configuration add(java.lang.String name, groovy.lang.Closure configureClosure)
Adds a configuration with the given name. The given configuration closure is executed against the configuration before it is returned from this method.
throws:
InvalidUserDataException when a configuration with the given name already exists in this container.
Parameters:
name - The name of the new configuration.
configureClosure - The closure to use to configure the configuration.
Returns:
The newly added configuration.


detachedConfiguration

public 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.


getAt

public Configuration getAt(java.lang.String name)
{@inheritDoc}


getByName

public Configuration getByName(java.lang.String name)
{@inheritDoc}


getByName

public Configuration getByName(java.lang.String name, groovy.lang.Closure configureClosure)
{@inheritDoc}


 

Groovy Documentation