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;
}
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");
}
}
Aggregations