Search in sources :

Example 1 with ComponentSpecIdentifier

use of org.gradle.platform.base.internal.ComponentSpecIdentifier in project gradle by gradle.

the class DependentComponentsRenderableDependency method of.

public static DependentComponentsRenderableDependency of(ComponentSpec componentSpec, ComponentSpecInternal internalProtocol, LinkedHashSet<DependentComponentsRenderableDependency> children) {
    ComponentSpecIdentifier id = internalProtocol.getIdentifier();
    String name = DependentComponentsUtils.getBuildScopedTerseName(id);
    String description = componentSpec.getDisplayName();
    boolean buildable = true;
    if (componentSpec instanceof VariantComponentSpec) {
        // Consider variant aware components with no buildable binaries as non-buildables
        VariantComponentSpec variantComponentSpec = (VariantComponentSpec) componentSpec;
        buildable = Iterables.any(variantComponentSpec.getBinaries().values(), new Predicate<BinarySpec>() {

            @Override
            public boolean apply(BinarySpec binarySpec) {
                return binarySpec.isBuildable();
            }
        });
    }
    boolean testSuite = false;
    return new DependentComponentsRenderableDependency(id, name, description, buildable, testSuite, children);
}
Also used : ComponentSpecIdentifier(org.gradle.platform.base.internal.ComponentSpecIdentifier) VariantComponentSpec(org.gradle.platform.base.VariantComponentSpec) BinarySpec(org.gradle.platform.base.BinarySpec) Predicate(com.google.common.base.Predicate)

Aggregations

Predicate (com.google.common.base.Predicate)1 BinarySpec (org.gradle.platform.base.BinarySpec)1 VariantComponentSpec (org.gradle.platform.base.VariantComponentSpec)1 ComponentSpecIdentifier (org.gradle.platform.base.internal.ComponentSpecIdentifier)1