Skip to content

Commit

Permalink
refactor(gradle-inspector): Make use of OrtDependency extensions
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Sep 4, 2024
1 parent fbc786d commit 0e3900d
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,11 @@ private fun Collection<OrtDependency>.toPackageRefs(
packageDependencies: MutableCollection<OrtDependency>
): Set<PackageReference> =
mapTo(mutableSetOf()) { dep ->
val (id, linkage) = if (dep.localPath != null) {
val id = Identifier("Gradle", dep.groupId, dep.artifactId, dep.version)
id to PackageLinkage.PROJECT_DYNAMIC
val id = Identifier(dep.dependencyType, dep.groupId, dep.artifactId, dep.version)
val linkage = if (dep.isProjectDependency) {
PackageLinkage.PROJECT_DYNAMIC
} else {
packageDependencies += dep

val id = Identifier("Maven", dep.groupId, dep.artifactId, dep.version)
id to PackageLinkage.DYNAMIC
PackageLinkage.DYNAMIC
}

PackageReference(id, linkage, dep.dependencies.toPackageRefs(packageDependencies))
Expand Down

0 comments on commit 0e3900d

Please sign in to comment.