Search in sources :

Example 1 with DefaultSection

use of org.gradle.api.tasks.diagnostics.internal.graph.nodes.DefaultSection in project gradle by gradle.

the class DependencyInsightReporter method buildFailureSection.

private static void buildFailureSection(DependencyEdge edge, Set<Throwable> alreadyReportedErrors, List<Section> sections) {
    if (edge instanceof UnresolvedDependencyEdge) {
        UnresolvedDependencyEdge unresolved = (UnresolvedDependencyEdge) edge;
        Throwable failure = unresolved.getFailure();
        DefaultSection failures = new DefaultSection("Failures");
        String errorMessage = collectErrorMessages(failure, alreadyReportedErrors);
        failures.addChild(new DefaultSection(errorMessage));
        sections.add(failures);
    }
}
Also used : UnresolvedDependencyEdge(org.gradle.api.tasks.diagnostics.internal.graph.nodes.UnresolvedDependencyEdge) DefaultSection(org.gradle.api.tasks.diagnostics.internal.graph.nodes.DefaultSection)

Example 2 with DefaultSection

use of org.gradle.api.tasks.diagnostics.internal.graph.nodes.DefaultSection in project gradle by gradle.

the class DependencyInsightReporter method buildSelectionReasonSection.

private static DefaultSection buildSelectionReasonSection(ComponentSelectionReason reason) {
    DefaultSection selectionReasons = new DefaultSection("Selection reasons");
    for (ComponentSelectionDescriptor entry : reason.getDescriptions()) {
        ComponentSelectionDescriptorInternal descriptor = (ComponentSelectionDescriptorInternal) entry;
        boolean hasCustomDescription = descriptor.hasCustomDescription();
        if (ComponentSelectionReasons.isCauseExpected(descriptor) && !hasCustomDescription) {
            // Don't render empty 'requested' reason
            continue;
        }
        Section item = new DefaultSection(render(descriptor));
        selectionReasons.addChild(item);
    }
    return selectionReasons;
}
Also used : ComponentSelectionDescriptor(org.gradle.api.artifacts.result.ComponentSelectionDescriptor) ComponentSelectionDescriptorInternal(org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionDescriptorInternal) DefaultSection(org.gradle.api.tasks.diagnostics.internal.graph.nodes.DefaultSection) Section(org.gradle.api.tasks.diagnostics.internal.graph.nodes.Section) DefaultSection(org.gradle.api.tasks.diagnostics.internal.graph.nodes.DefaultSection)

Aggregations

DefaultSection (org.gradle.api.tasks.diagnostics.internal.graph.nodes.DefaultSection)2 ComponentSelectionDescriptor (org.gradle.api.artifacts.result.ComponentSelectionDescriptor)1 ComponentSelectionDescriptorInternal (org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionDescriptorInternal)1 Section (org.gradle.api.tasks.diagnostics.internal.graph.nodes.Section)1 UnresolvedDependencyEdge (org.gradle.api.tasks.diagnostics.internal.graph.nodes.UnresolvedDependencyEdge)1