use of org.gradle.api.publish.PublicationContainer in project gradle by gradle.
the class IvyPluginPublishingRules method addMainPublication.
@Mutate
public void addMainPublication(PublishingExtension publishing, GradlePluginDevelopmentExtension pluginDevelopment, ServiceRegistry services) {
if (!pluginDevelopment.isAutomatedPublishing()) {
return;
}
SoftwareComponentContainer componentContainer = services.get(SoftwareComponentContainer.class);
SoftwareComponent component = componentContainer.getByName("java");
PublicationContainer publications = publishing.getPublications();
createIvyPluginPublication(component, publications);
}
use of org.gradle.api.publish.PublicationContainer in project gradle by gradle.
the class MavenPluginPublishingRules method addMarkerPublications.
@Finalize
public void addMarkerPublications(PublishingExtension publishing, GradlePluginDevelopmentExtension pluginDevelopment) {
if (!pluginDevelopment.isAutomatedPublishing()) {
return;
}
PublicationContainer publications = publishing.getPublications();
NamedDomainObjectContainer<PluginDeclaration> declaredPlugins = pluginDevelopment.getPlugins();
for (PluginDeclaration declaration : declaredPlugins) {
createMavenMarkerPublication(declaration, (MavenPublication) publications.getByName("pluginMaven"), publications);
}
}
use of org.gradle.api.publish.PublicationContainer in project gradle by gradle.
the class PublishingPlugin method apply.
@Override
public void apply(final Project project) {
RepositoryHandler repositories = publicationServices.createRepositoryHandler();
PublicationContainer publications = instantiator.newInstance(DefaultPublicationContainer.class, instantiator, collectionCallbackActionDecorator);
PublishingExtension extension = project.getExtensions().create(PublishingExtension.class, PublishingExtension.NAME, DefaultPublishingExtension.class, repositories, publications);
project.getTasks().register(PUBLISH_LIFECYCLE_TASK_NAME, task -> {
task.setDescription("Publishes all publications produced by this project.");
task.setGroup(PUBLISH_TASK_GROUP);
});
extension.getPublications().all(publication -> {
PublicationInternal<?> internalPublication = Cast.uncheckedNonnullCast(publication);
ProjectInternal projectInternal = (ProjectInternal) project;
projectPublicationRegistry.registerPublication(projectInternal, internalPublication);
});
bridgeToSoftwareModelIfNeeded((ProjectInternal) project);
validatePublishingModelWhenComplete(project, extension);
}
use of org.gradle.api.publish.PublicationContainer in project gradle by gradle.
the class IvyPluginPublishingRules method addMarkerPublications.
@Finalize
public void addMarkerPublications(PublishingExtension publishing, GradlePluginDevelopmentExtension pluginDevelopment) {
if (!pluginDevelopment.isAutomatedPublishing()) {
return;
}
PublicationContainer publications = publishing.getPublications();
NamedDomainObjectContainer<PluginDeclaration> declaredPlugins = pluginDevelopment.getPlugins();
for (PluginDeclaration declaration : declaredPlugins) {
createIvyMarkerPublication(declaration, (IvyPublication) publications.getByName("pluginIvy"), publications);
}
}
use of org.gradle.api.publish.PublicationContainer in project gradle by gradle.
the class MavenPluginPublishingRules method addMainPublication.
@Mutate
public void addMainPublication(PublishingExtension publishing, GradlePluginDevelopmentExtension pluginDevelopment, ServiceRegistry services) {
if (!pluginDevelopment.isAutomatedPublishing()) {
return;
}
SoftwareComponentContainer componentContainer = services.get(SoftwareComponentContainer.class);
SoftwareComponent component = componentContainer.getByName("java");
PublicationContainer publications = publishing.getPublications();
createMavenPluginPublication(component, publications);
}
Aggregations