Search in sources :

Example 1 with DefaultArtifactPublicationSet

use of org.gradle.api.internal.plugins.DefaultArtifactPublicationSet in project gradle by gradle.

the class BasePlugin method configureConfigurations.

private void configureConfigurations(final Project project) {
    ConfigurationContainer configurations = project.getConfigurations();
    project.setStatus("integration");
    Configuration archivesConfiguration = configurations.maybeCreate(Dependency.ARCHIVES_CONFIGURATION).setDescription("Configuration for archive artifacts.");
    configurations.maybeCreate(Dependency.DEFAULT_CONFIGURATION).setDescription("Configuration for default artifacts.");
    final DefaultArtifactPublicationSet defaultArtifacts = project.getExtensions().create("defaultArtifacts", DefaultArtifactPublicationSet.class, archivesConfiguration.getArtifacts());
    configurations.all(new Action<Configuration>() {

        public void execute(Configuration configuration) {
            configuration.getArtifacts().all(new Action<PublishArtifact>() {

                public void execute(PublishArtifact artifact) {
                    defaultArtifacts.addCandidate(artifact);
                }
            });
        }
    });
}
Also used : Action(org.gradle.api.Action) DefaultArtifactPublicationSet(org.gradle.api.internal.plugins.DefaultArtifactPublicationSet) Configuration(org.gradle.api.artifacts.Configuration) ConfigurationContainer(org.gradle.api.artifacts.ConfigurationContainer) PublishArtifact(org.gradle.api.artifacts.PublishArtifact)

Aggregations

Action (org.gradle.api.Action)1 Configuration (org.gradle.api.artifacts.Configuration)1 ConfigurationContainer (org.gradle.api.artifacts.ConfigurationContainer)1 PublishArtifact (org.gradle.api.artifacts.PublishArtifact)1 DefaultArtifactPublicationSet (org.gradle.api.internal.plugins.DefaultArtifactPublicationSet)1