Search in sources :

Example 1 with ResolvableDependenciesInternal

use of org.gradle.api.internal.artifacts.configurations.ResolvableDependenciesInternal in project gradle by gradle.

the class DependencyInsightReportTask method getRootComponentProperty.

/**
 * The root component of the dependency graph to be inspected.
 *
 * @since 7.5
 */
@Input
@Optional
@Incubating
public Property<ResolvedComponentResult> getRootComponentProperty() {
    Configuration configuration = getConfiguration();
    if (!rootComponentProperty.isPresent() && configuration != null && getDependencySpec() != null) {
        configurationName = configuration.getName();
        configurationDescription = configuration.toString();
        configurationAttributes = configuration.getAttributes();
        ResolvableDependenciesInternal incoming = (ResolvableDependenciesInternal) configuration.getIncoming();
        ResolutionResult result = incoming.getResolutionResult(errorHandler);
        rootComponentProperty.set(result.getRootComponent());
    }
    return rootComponentProperty;
}
Also used : ResolvableDependenciesInternal(org.gradle.api.internal.artifacts.configurations.ResolvableDependenciesInternal) Configuration(org.gradle.api.artifacts.Configuration) ResolutionResult(org.gradle.api.artifacts.result.ResolutionResult) Input(org.gradle.api.tasks.Input) UserInput(org.gradle.internal.logging.text.StyledTextOutput.Style.UserInput) Optional(org.gradle.api.tasks.Optional) Incubating(org.gradle.api.Incubating)

Aggregations

Incubating (org.gradle.api.Incubating)1 Configuration (org.gradle.api.artifacts.Configuration)1 ResolutionResult (org.gradle.api.artifacts.result.ResolutionResult)1 ResolvableDependenciesInternal (org.gradle.api.internal.artifacts.configurations.ResolvableDependenciesInternal)1 Input (org.gradle.api.tasks.Input)1 Optional (org.gradle.api.tasks.Optional)1 UserInput (org.gradle.internal.logging.text.StyledTextOutput.Style.UserInput)1