Skip to content

Commit

Permalink
deps: Update CycloneDX to version 9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and sschuberth committed May 15, 2024
1 parent 894895d commit 69efa4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ asciidoctorjPdf = "2.3.15"
clikt = "4.4.0"
commonsCompress = "1.26.1"
cvssCalculator = "1.4.2"
cyclonedx = "8.0.3"
cyclonedx = "9.0.0"
diffUtils = "4.12"
diskLruCache = "2.0.2"
exposed = "0.50.1"
Expand Down
13 changes: 7 additions & 6 deletions plugins/reporters/cyclonedx/src/main/kotlin/CycloneDxReporter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import java.util.Date
import java.util.SortedSet
import java.util.UUID

import org.cyclonedx.BomGeneratorFactory
import org.cyclonedx.CycloneDxSchema
import org.cyclonedx.Version
import org.cyclonedx.generators.BomGeneratorFactory
import org.cyclonedx.model.AttachmentText
import org.cyclonedx.model.Bom
import org.cyclonedx.model.Component
Expand All @@ -35,6 +35,7 @@ import org.cyclonedx.model.Hash
import org.cyclonedx.model.License
import org.cyclonedx.model.LicenseChoice
import org.cyclonedx.model.Metadata
import org.cyclonedx.model.license.Expression
import org.cyclonedx.model.metadata.ToolInformation

import org.ossreviewtoolkit.model.FileFormat
Expand Down Expand Up @@ -68,7 +69,7 @@ import org.ossreviewtoolkit.utils.spdx.SpdxLicense
*/
class CycloneDxReporter : Reporter {
companion object {
val DEFAULT_SCHEMA_VERSION = CycloneDxSchema.Version.VERSION_15
val DEFAULT_SCHEMA_VERSION = Version.VERSION_15
val DEFAULT_DATA_LICENSE = SpdxLicense.CC0_1_0

const val REPORT_BASE_FILENAME = "bom.cyclonedx"
Expand Down Expand Up @@ -140,7 +141,7 @@ class CycloneDxReporter : Reporter {
val projects = input.ortResult.getProjects(omitExcluded = true).sortedBy { it.id }
val packages = input.ortResult.getPackages(omitExcluded = true).sortedBy { it.metadata.id }

val schemaVersion = CycloneDxSchema.Version.entries.find {
val schemaVersion = Version.entries.find {
it.versionString == config.options[OPTION_SCHEMA_VERSION]
} ?: DEFAULT_SCHEMA_VERSION

Expand All @@ -163,7 +164,7 @@ class CycloneDxReporter : Reporter {
}
)
}
licenseChoice = LicenseChoice().apply { expression = dataLicense }
licenseChoice = LicenseChoice().apply { expression = Expression(dataLicense) }
}

if (createSingleBom) {
Expand Down Expand Up @@ -348,7 +349,7 @@ class CycloneDxReporter : Reporter {

private fun writeBom(
bom: Bom,
schemaVersion: CycloneDxSchema.Version,
schemaVersion: Version,
outputDir: File,
outputName: String,
requestedOutputFileFormats: Set<FileFormat>
Expand Down

0 comments on commit 69efa4c

Please sign in to comment.