org.gradle.api.publish
Interface PublicationContainer

All Superinterfaces:
Collection<Publication>, DomainObjectCollection<Publication>, Iterable<Publication>, NamedDomainObjectCollection<Publication>, NamedDomainObjectSet<Publication>, Set<Publication>

@Incubating
public interface PublicationContainer
extends NamedDomainObjectSet<Publication>

A PublicationContainer is responsible for declaring and managing publications. Publications cannot be added to a publication container by users at this time. Publication plugins are responsible for creating Publication instances in the container. See the documentation for the Ivy Publishing plugin for more information.

Since:
1.3
See Also:
Publication

Method Summary
 Publication getAt(String name)
          Locates an object by name, failing if there is no such task.
 Publication getByName(String name)
          Locates an object by name, failing if there is no such object.
 
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, getByName, getNamer, 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

getByName

Publication getByName(String name)
                      throws UnknownPublicationException
Locates an object by name, failing if there is no such object.

Specified by:
getByName in interface NamedDomainObjectCollection<Publication>
Parameters:
name - The object name
Returns:
The object with the given name. Never returns null.
Throws:
UnknownPublicationException

getAt

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

Specified by:
getAt in interface NamedDomainObjectCollection<Publication>
Parameters:
name - The object name
Returns:
The object with the given name. Never returns null.
Throws:
UnknownPublicationException