Java Code Examples for org.gradle.platform.base.ComponentSpec

The following examples show how to use org.gradle.platform.base.ComponentSpec. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public void renderComponents(Collection<ComponentSpec> components) {
    if (components.isEmpty()) {
        getTextOutput().withStyle(Info).println("No components defined for this project.");
        return;
    }
    boolean seen = false;
    for (ComponentSpec component : components) {
        if (seen) {
            getBuilder().getOutput().println();
        } else {
            seen = true;
        }
        componentRenderer.render(component, getBuilder());
        componentSourceSets.addAll(component.getSource());
        componentBinaries.addAll(component.getBinaries());
    }
}
 
Example 2
public void renderComponents(Collection<ComponentSpec> components) {
    if (components.isEmpty()) {
        getTextOutput().withStyle(Info).println("No components defined for this project.");
        return;
    }
    boolean seen = false;
    for (ComponentSpec component : components) {
        if (seen) {
            getBuilder().getOutput().println();
        } else {
            seen = true;
        }
        componentRenderer.render(component, getBuilder());
        componentSourceSets.addAll(component.getSource());
        componentBinaries.addAll(component.getBinaries());
    }
}
 
Example 3
@TaskAction
public void report() {
    Project project = getProject();

    StyledTextOutput textOutput = getTextOutputFactory().create(ComponentReport.class);
    ComponentReportRenderer renderer = new ComponentReportRenderer(getFileResolver());
    renderer.setOutput(textOutput);

    renderer.startProject(project);

    Collection<ComponentSpec> components = new ArrayList<ComponentSpec>();
    ComponentSpecContainer componentSpecs = project.getExtensions().findByType(ComponentSpecContainer.class);
    if (componentSpecs != null) {
        components.addAll(componentSpecs);
    }

    try {
        TestSuiteContainer testSuites = getModelRegistry().get(ModelPath.path("testSuites"), ModelType.of(TestSuiteContainer.class));
        components.addAll(testSuites);
    } catch (IllegalStateException e) {
        // TODO - need a better contract here
        // Ignore for now
    }

    renderer.renderComponents(components);

    ProjectSourceSet sourceSets = project.getExtensions().findByType(ProjectSourceSet.class);
    if (sourceSets != null) {
        renderer.renderSourceSets(sourceSets);
    }
    BinaryContainer binaries = project.getExtensions().findByType(BinaryContainer.class);
    if (binaries != null) {
        renderer.renderBinaries(binaries);
    }

    renderer.completeProject(project);
    renderer.complete();
}
 
Example 4
@Override
public void render(ComponentSpec component, TextReportBuilder builder) {
    builder.subheading(StringUtils.capitalize(component.getDisplayName()));
    builder.getOutput().println();
    builder.collection("Source sets", component.getSource(), sourceSetRenderer, "source sets");
    builder.getOutput().println();
    builder.collection("Binaries", CollectionUtils.sort(component.getBinaries(), new Comparator<BinarySpec>() {
        public int compare(BinarySpec binary1, BinarySpec binary2) {
            return binary1.getName().compareTo(binary2.getName());
        }
    }), renderer, "binaries");
}
 
Example 5
@TaskAction
public void report() {
    Project project = getProject();

    StyledTextOutput textOutput = getTextOutputFactory().create(ComponentReport.class);
    ComponentReportRenderer renderer = new ComponentReportRenderer(getFileResolver());
    renderer.setOutput(textOutput);

    renderer.startProject(project);

    Collection<ComponentSpec> components = new ArrayList<ComponentSpec>();
    ComponentSpecContainer componentSpecs = project.getExtensions().findByType(ComponentSpecContainer.class);
    if (componentSpecs != null) {
        components.addAll(componentSpecs);
    }

    try {
        TestSuiteContainer testSuites = getModelRegistry().get(ModelPath.path("testSuites"), ModelType.of(TestSuiteContainer.class));
        components.addAll(testSuites);
    } catch (IllegalStateException e) {
        // TODO - need a better contract here
        // Ignore for now
    }

    renderer.renderComponents(components);

    ProjectSourceSet sourceSets = project.getExtensions().findByType(ProjectSourceSet.class);
    if (sourceSets != null) {
        renderer.renderSourceSets(sourceSets);
    }
    BinaryContainer binaries = project.getExtensions().findByType(BinaryContainer.class);
    if (binaries != null) {
        renderer.renderBinaries(binaries);
    }

    renderer.completeProject(project);
    renderer.complete();
}
 
Example 6
@Override
public void render(ComponentSpec component, TextReportBuilder builder) {
    builder.subheading(StringUtils.capitalize(component.getDisplayName()));
    builder.getOutput().println();
    builder.collection("Source sets", component.getSource(), sourceSetRenderer, "source sets");
    builder.getOutput().println();
    builder.collection("Binaries", CollectionUtils.sort(component.getBinaries(), new Comparator<BinarySpec>() {
        public int compare(BinarySpec binary1, BinarySpec binary2) {
            return binary1.getName().compareTo(binary2.getName());
        }
    }), renderer, "binaries");
}
 
Example 7
public DefaultComponentSpecContainer(Instantiator instantiator) {
    super(ComponentSpec.class, instantiator);
}
 
Example 8
public DefaultComponentSpecContainer(Instantiator instantiator) {
    super(ComponentSpec.class, instantiator);
}
 
Example 9
/**
 * The tested component.
 */
ComponentSpec getTestedComponent();
 
Example 10
/**
 * The tested component.
 */
ComponentSpec getTestedComponent();