org.gradle.platform.base.ComponentSpec Java Examples

The following examples show how to use org.gradle.platform.base.ComponentSpec. 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
Source File: ComponentReportRenderer.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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
Source File: ComponentReportRenderer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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
Source File: ComponentReport.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@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
Source File: ComponentRenderer.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@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
Source File: ComponentReport.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@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
Source File: ComponentRenderer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@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
Source File: DefaultComponentSpecContainer.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultComponentSpecContainer(Instantiator instantiator) {
    super(ComponentSpec.class, instantiator);
}
 
Example #8
Source File: DefaultComponentSpecContainer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultComponentSpecContainer(Instantiator instantiator) {
    super(ComponentSpec.class, instantiator);
}
 
Example #9
Source File: TestSuiteSpec.java    From pushfish-android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * The tested component.
 */
ComponentSpec getTestedComponent();
 
Example #10
Source File: TestSuiteSpec.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * The tested component.
 */
ComponentSpec getTestedComponent();