Search in sources :

Example 1 with BuildDependenciesVisitor

use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.BuildDependenciesVisitor in project gradle by gradle.

the class DependencyResolvingClasspath method getBuildDependencies.

@Override
public TaskDependency getBuildDependencies() {
    ensureResolved(false);
    final List<Object> taskDependencies = new ArrayList<Object>();
    final List<Throwable> failures = new ArrayList<Throwable>();
    resolveResult.artifactsResults.getArtifacts().collectBuildDependencies(new BuildDependenciesVisitor() {

        @Override
        public void visitDependency(Object dep) {
            taskDependencies.add(dep);
        }

        @Override
        public void visitFailure(Throwable failure) {
            failures.add(failure);
        }
    });
    if (!failures.isEmpty()) {
        throw new ResolveException(getDisplayName(), failures);
    }
    return TaskDependencies.of(taskDependencies);
}
Also used : LibraryResolveException(org.gradle.language.base.internal.resolve.LibraryResolveException) ModuleVersionResolveException(org.gradle.internal.resolve.ModuleVersionResolveException) ResolveException(org.gradle.api.artifacts.ResolveException) ArrayList(java.util.ArrayList) BuildDependenciesVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.BuildDependenciesVisitor)

Aggregations

ArrayList (java.util.ArrayList)1 ResolveException (org.gradle.api.artifacts.ResolveException)1 BuildDependenciesVisitor (org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.BuildDependenciesVisitor)1 ModuleVersionResolveException (org.gradle.internal.resolve.ModuleVersionResolveException)1 LibraryResolveException (org.gradle.language.base.internal.resolve.LibraryResolveException)1