Skip to content

Commit

Permalink
chore(cyclonedx): Stick to CycloneDX naming for BOM extensions
Browse files Browse the repository at this point in the history
What is being added is a CycloneDX component, not an ORT package, so
rename the function accordingly.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Dec 8, 2024
1 parent 4a1031a commit 7674ae3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ internal fun Bom.addExternalReference(type: ExternalReference.Type, url: String,
* Add the given [ORT package][pkg] to this [Bom] by converting it to a CycloneDX [Component] using the metdata from
* [input]. The [dependencyType] is added as an [ExtensibleType] to indicate "direct" vs "transitive" dependencies.
*/
internal fun Bom.addPackage(input: ReporterInput, pkg: Package, dependencyType: String) {
internal fun Bom.addComponent(input: ReporterInput, pkg: Package, dependencyType: String) {
val resolvedLicenseInfo = input.licenseInfoResolver.resolveLicenseInfo(pkg.id).filterExcluded()
.applyChoices(input.ortResult.getPackageLicenseChoices(pkg.id))
.applyChoices(input.ortResult.getRepositoryLicenseChoices())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class CycloneDxReporter(

packages.forEach { (pkg, _) ->
val dependencyType = if (pkg.id in allDirectDependencies) "direct" else "transitive"
bom.addPackage(input, pkg, dependencyType)
bom.addComponent(input, pkg, dependencyType)
}

bom.addVulnerabilities(input.ortResult.getVulnerabilities())
Expand Down Expand Up @@ -219,7 +219,7 @@ class CycloneDxReporter(
val directDependencies = input.ortResult.dependencyNavigator.projectDependencies(project, maxDepth = 1)
dependencyPackages.forEach { pkg ->
val dependencyType = if (pkg.id in directDependencies) "direct" else "transitive"
bom.addPackage(input, pkg, dependencyType)
bom.addComponent(input, pkg, dependencyType)
}

bom.addVulnerabilities(input.ortResult.getVulnerabilities())
Expand Down

0 comments on commit 7674ae3

Please sign in to comment.