use of org.gradle.platform.base.VariantComponentSpec in project gradle by gradle.
the class NativeComponents method createBuildDependentComponentsTasks.
public static void createBuildDependentComponentsTasks(ModelMap<Task> tasks, ComponentSpecContainer components) {
for (final VariantComponentSpec component : components.withType(NativeComponentSpec.class).withType(VariantComponentSpec.class)) {
tasks.create(getAssembleDependentComponentsTaskName(component), DefaultTask.class, new Action<DefaultTask>() {
@Override
public void execute(DefaultTask assembleDependents) {
assembleDependents.setGroup("Build Dependents");
assembleDependents.setDescription("Assemble dependents of " + component.getDisplayName() + ".");
}
});
tasks.create(getBuildDependentComponentsTaskName(component), DefaultTask.class, new Action<DefaultTask>() {
@Override
public void execute(DefaultTask buildDependents) {
buildDependents.setGroup("Build Dependents");
buildDependents.setDescription("Build dependents of " + component.getDisplayName() + ".");
}
});
}
}
use of org.gradle.platform.base.VariantComponentSpec 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);
}
use of org.gradle.platform.base.VariantComponentSpec in project gradle by gradle.
the class DependentComponentsRenderer method getRenderableDependencyOf.
private DependentComponentsRenderableDependency getRenderableDependencyOf(final ComponentSpec componentSpec, ComponentSpecInternal internalProtocol) {
if (resolver != null && componentSpec instanceof VariantComponentSpec) {
VariantComponentSpec variantComponentSpec = (VariantComponentSpec) componentSpec;
LinkedHashSet<DependentComponentsRenderableDependency> children = Sets.newLinkedHashSet();
for (BinarySpecInternal binarySpec : variantComponentSpec.getBinaries().withType(BinarySpecInternal.class)) {
DependentBinariesResolutionResult resolvedBinary = resolver.resolve(binarySpec);
children.add(DependentComponentsRenderableDependency.of(resolvedBinary.getRoot()));
}
return DependentComponentsRenderableDependency.of(componentSpec, internalProtocol, children);
} else {
return DependentComponentsRenderableDependency.of(componentSpec, internalProtocol);
}
}
use of org.gradle.platform.base.VariantComponentSpec 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