From 8f32eb85962070ed9538b638527c10fbb2f70f83 Mon Sep 17 00:00:00 2001 From: Oliver Heger Date: Mon, 12 Apr 2021 13:03:17 +0200 Subject: [PATCH] Gradle: use the generic DependencyGraphBuilder Replace GradleDependencyGraphBuilder by a combination of DependencyGraphBuilder and GradleDependencyHandler. The Gradle-specific implementation is going to be removed. Signed-off-by: Oliver Heger --- analyzer/src/main/kotlin/managers/Gradle.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/analyzer/src/main/kotlin/managers/Gradle.kt b/analyzer/src/main/kotlin/managers/Gradle.kt index 718693611517c..731c842ff7536 100644 --- a/analyzer/src/main/kotlin/managers/Gradle.kt +++ b/analyzer/src/main/kotlin/managers/Gradle.kt @@ -36,7 +36,7 @@ import org.gradle.tooling.internal.consumer.DefaultGradleConnector import org.ossreviewtoolkit.analyzer.AbstractPackageManagerFactory import org.ossreviewtoolkit.analyzer.PackageManager -import org.ossreviewtoolkit.analyzer.managers.utils.GradleDependencyGraphBuilder +import org.ossreviewtoolkit.analyzer.managers.utils.DependencyGraphBuilder import org.ossreviewtoolkit.analyzer.managers.utils.MavenSupport import org.ossreviewtoolkit.analyzer.managers.utils.identifier import org.ossreviewtoolkit.downloader.VersionControlSystem @@ -222,10 +222,11 @@ class Gradle( "The Gradle project '$projectName' uses the following Maven repositories: $repositories" } - val graphBuilder = GradleDependencyGraphBuilder(managerName, maven) + val dependencyHandler = GradleDependencyHandler(managerName, maven, repositories) + val graphBuilder = DependencyGraphBuilder(dependencyHandler) dependencyTreeModel.configurations.forEach { configuration -> configuration.dependencies.forEach { dependency -> - graphBuilder.addDependency(configuration.name, dependency, repositories) + graphBuilder.addDependency(configuration.name, dependency) } // Make sure that scopes without dependencies are recorded.