org.gradle.api.publish
[Java] Interface PublicationContainer
org.gradle.api.NamedDomainObjectCollection
org.gradle.api.publish.PublicationContainer
org.gradle.api.NamedDomainObjectSet
java.lang.Iterable
org.gradle.api.DomainObjectCollection
java.util.Collection
- All Superinterfaces:
- NamedDomainObjectCollection, NamedDomainObjectSet, Iterable, DomainObjectCollection, Collection
@Incubating
public interface PublicationContainer
extends NamedDomainObjectSet
A PublicationContainer is responsible for creating and managing Publication instances.
The set of available publication types is dependent on the application of particular plugins:
See the documentation for PublishingExtension.publications for more examples of how to create and configure publications.
- See Also:
- Publication
- PublishingExtension
- Since:
- 1.3
Method Summary |
Object
|
add(String name, Class type)
Creates a publication with the specified name and type, adding it to the container.
|
Object
|
add(String name, Class type, Action configuration)
Creates a publication with the specified name and type, adding it to the container and configuring it with the supplied action.
|
Methods inherited from interface NamedDomainObjectCollection
|
add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getRules, matching, matching, withType |
Methods inherited from interface Set
|
add, remove, equals, hashCode, clear, isEmpty, contains, size, toArray, toArray, addAll, iterator, containsAll, removeAll, retainAll |
add
public Object add(String name, Class type)
- Creates a publication with the specified name and type, adding it to the container.
apply plugin: 'maven-publish'
publishing.publications.add('publication-name', MavenPublication)
- throws:
- InvalidUserDataException If type is not a valid publication type, or if a publication named "name" already exists.
- Parameters:
name
- The publication name.type
- The publication type.
- Returns:
- The added publication
add
public Object add(String name, Class type, Action configuration)
- Creates a publication with the specified name and type, adding it to the container and configuring it with the supplied action.
A Closure can be supplied in place of an action, through type coercion.
apply plugin: 'ivy-publish'
publishing.publications.add('publication-name', IvyPublication) {
// Configure the ivy publication here
}
- throws:
- InvalidUserDataException If type is not a valid publication type, or if a publication named "name" already exists.
- Parameters:
name
- The publication name.type
- The publication type.configuration
- The action or closure to configure the publication with.
- Returns:
- The added publication
Gradle API 1.5