Search in sources :

Example 1 with SourceComponentSpec

use of org.gradle.platform.base.SourceComponentSpec in project gradle by gradle.

the class TestNativeBinariesFactory method create.

public static <T extends NativeBinarySpec, I extends AbstractNativeBinarySpec> T create(Class<T> publicType, Class<I> implType, String name, ITaskFactory taskFactory, MutableModelNode componentNode, BinaryNamingScheme namingScheme, NativeDependencyResolver resolver, NativePlatform platform, BuildType buildType, Flavor flavor) {
    T binary = BaseBinaryFixtures.create(publicType, implType, name, componentNode, taskFactory);
    NativeBinaries.initialize(binary, namingScheme, resolver, TestFiles.fileCollectionFactory(), platform, buildType, flavor);
    SourceComponentSpec component = componentNode.asImmutable(ModelType.of(SourceComponentSpec.class), new SimpleModelRuleDescriptor("get component of " + name)).getInstance();
    binary.getInputs().addAll(component.getSources().values());
    return binary;
}
Also used : SimpleModelRuleDescriptor(org.gradle.model.internal.core.rule.describe.SimpleModelRuleDescriptor) SourceComponentSpec(org.gradle.platform.base.SourceComponentSpec)

Example 2 with SourceComponentSpec

use of org.gradle.platform.base.SourceComponentSpec in project gradle by gradle.

the class ComponentRenderer method render.

@Override
public void render(ComponentSpec component, TextReportBuilder builder) {
    builder.heading(StringUtils.capitalize(component.getDisplayName()));
    if (component instanceof SourceComponentSpec) {
        SourceComponentSpec sourceComponentSpec = (SourceComponentSpec) component;
        builder.getOutput().println();
        builder.collection("Source sets", CollectionUtils.sort(sourceComponentSpec.getSources().values(), SourceSetRenderer.SORT_ORDER), sourceSetRenderer, "source sets");
    }
    if (component instanceof VariantComponentSpec) {
        VariantComponentSpec variantComponentSpec = (VariantComponentSpec) component;
        builder.getOutput().println();
        builder.collection("Binaries", CollectionUtils.sort(variantComponentSpec.getBinaries().values(), TypeAwareBinaryRenderer.SORT_ORDER), binaryRenderer, "binaries");
    }
}
Also used : VariantComponentSpec(org.gradle.platform.base.VariantComponentSpec) SourceComponentSpec(org.gradle.platform.base.SourceComponentSpec)

Aggregations

SourceComponentSpec (org.gradle.platform.base.SourceComponentSpec)2 SimpleModelRuleDescriptor (org.gradle.model.internal.core.rule.describe.SimpleModelRuleDescriptor)1 VariantComponentSpec (org.gradle.platform.base.VariantComponentSpec)1