Java 类org.gradle.api.component.SoftwareComponentContainer 实例源码

项目:Reer    文件:MavenPluginPublishingRules.java   
@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);
}
项目:Reer    文件:IvyPluginPublishingRules.java   
@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);
}
项目:Reer    文件:DefaultProject.java   
@Inject
public SoftwareComponentContainer getComponents() {
    // Decoration takes care of the implementation
    throw new UnsupportedOperationException();
}
项目:Reer    文件:ProjectScopeServices.java   
protected SoftwareComponentContainer createSoftwareComponentContainer() {
    Instantiator instantiator = get(Instantiator.class);
    return instantiator.newInstance(DefaultSoftwareComponentContainer.class, instantiator);
}
项目:gradle-project-config    文件:MavenConfigPlugin.java   
/**
 * Create the default Maven publication
 *
 * @param publishingExtension Publishing extension where the publication is created
 * @param projectContext Project context to access project information
 * @param projectConfig Project configuration
 * @param mavenConfig Maven configuration
 * @param configurations Container to access configurations
 * @param services Service manager to obtain service objects
 */
@Mutate
public void createPublications(PublishingExtension publishingExtension, ProjectContext projectContext,
        ProjectConfig projectConfig, MavenConfig mavenConfig, ConfigurationContainer configurations,
        ServiceRegistry services) {
    SoftwareComponentContainer components = services.get(SoftwareComponentContainer.class);
    JavaLibrary javaComponent = components.withType(JavaLibrary.class).getByName("java");

    for (MavenPublicationConfig publicationConfig : mavenConfig.getPublications()) {
        Configuration configuration = configurations
                .getByName(publicationConfig.getArchivesConfiguration());

        publishingExtension.getPublications().create(publicationConfig.getName(), MavenPublication.class,
                p -> {
                    p.setArtifactId(publicationConfig.getArtifactId());

                    List<@NonNull Configuration> runtimeConfigurations = publicationConfig
                            .getRuntimeConfigurations().stream().map(c -> configurations.getByName(c))
                            .collect(Collectors.toList());

                    List<@NonNull Configuration> compileConfigurations = publicationConfig
                            .getCompileConfigurations().stream().map(c -> configurations.getByName(c))
                            .collect(Collectors.toList());

                    List<@NonNull PublishArtifact> artifacts = Collections.emptyList();

                    if (publicationConfig.isAddProjectArtifacts()) {
                        artifacts = javaComponent.getUsages().stream()
                                .flatMap(u -> u.getArtifacts().stream()).collect(Collectors.toList());
                    }

                    PomConfigurator configurator = new PomConfigurator(projectContext, projectConfig,
                            Validate.notNull(runtimeConfigurations),
                            Validate.notNull(compileConfigurations));

                    p.pom(pom -> pom.withXml(xml -> configurator.configurePom(Validate.notNull(xml))));

                    for (PublishArtifact a : configuration.getArtifacts()) {
                        p.artifact(a);
                    }
                });
    }
}
项目:Pushjet-Android    文件:AbstractProject.java   
@Inject
public SoftwareComponentContainer getComponents() {
    // Decoration takes care of the implementation
    throw new UnsupportedOperationException();
}
项目:Pushjet-Android    文件:ProjectScopeServices.java   
protected SoftwareComponentContainer createSoftwareComponentContainer() {
    Instantiator instantiator = get(Instantiator.class);
    return instantiator.newInstance(DefaultSoftwareComponentContainer.class, instantiator);
}
项目:Pushjet-Android    文件:AbstractProject.java   
public SoftwareComponentContainer getComponents() {
    return softwareComponentContainer;
}
项目:Pushjet-Android    文件:ProjectScopeServices.java   
protected SoftwareComponentContainer createSoftwareComponentContainer() {
    Instantiator instantiator = get(Instantiator.class);
    return instantiator.newInstance(DefaultSoftwareComponentContainer.class, instantiator);
}
项目:Reer    文件:Project.java   
/**
 * Returns the software components produced by this project.
 *
 * @return The components for this project.
 */
@Incubating
SoftwareComponentContainer getComponents();
项目:Pushjet-Android    文件:Project.java   
/**
 * Returns the software components produced by this project.
 *
 * @return The components for this project.
 */
@Incubating
SoftwareComponentContainer getComponents();
项目:Pushjet-Android    文件:Project.java   
/**
 * Returns the software components produced by this project.
 *
 * @return The components for this project.
 */
@Incubating
SoftwareComponentContainer getComponents();