Skip to content

Commit

Permalink
Gradle: use the generic DependencyGraphBuilder
Browse files Browse the repository at this point in the history
Replace GradleDependencyGraphBuilder by a combination of
DependencyGraphBuilder and GradleDependencyHandler. The
Gradle-specific implementation is going to be removed.

Signed-off-by: Oliver Heger <[email protected]>
  • Loading branch information
oheger-bosch committed Apr 14, 2021
1 parent 4fc36a5 commit 8f32eb8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions analyzer/src/main/kotlin/managers/Gradle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 8f32eb8

Please sign in to comment.