Skip to content

Commit

Permalink
reporter: Add authors to the evaluated model
Browse files Browse the repository at this point in the history
This is part of resolving #5957.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Oct 18, 2022
1 parent 10aedd3 commit 63b2b2d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ packages:
is_project: false
definition_file_path: ""
purl: "pkg:maven/com.foobar/[email protected]"
authors:
- "Jane Doe"
declared_licenses:
- 10
declared_licenses_processed:
Expand Down Expand Up @@ -492,6 +494,8 @@ packages:
is_project: false
definition_file_path: ""
purl: "pkg:maven/com.h2database/[email protected]"
authors:
- "Thomas Mueller"
declared_licenses:
- 12
declared_licenses_processed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@
"is_project" : false,
"definition_file_path" : "",
"purl" : "pkg:maven/com.foobar/[email protected]",
"authors" : [ "Jane Doe" ],
"declared_licenses" : [ 10 ],
"declared_licenses_processed" : {
"spdx_expression" : "GPL-2.0-only OR MIT",
Expand Down Expand Up @@ -555,6 +556,7 @@
"is_project" : false,
"definition_file_path" : "",
"purl" : "pkg:maven/com.h2database/[email protected]",
"authors" : [ "Thomas Mueller" ],
"declared_licenses" : [ 12 ],
"declared_licenses_processed" : {
"spdx_expression" : "MPL-2.0 OR EPL-1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ packages:
is_project: false
definition_file_path: ""
purl: "pkg:maven/com.foobar/[email protected]"
authors:
- "Jane Doe"
declared_licenses:
- 10
declared_licenses_processed:
Expand Down Expand Up @@ -492,6 +494,8 @@ packages:
is_project: false
definition_file_path: ""
purl: "pkg:maven/com.h2database/[email protected]"
authors:
- "Thomas Mueller"
declared_licenses:
- 12
declared_licenses_processed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ internal class EvaluatedModelMapper(private val input: ReporterInput) {
id = project.id,
isProject = true,
definitionFilePath = project.definitionFilePath,
authors = project.authors,
declaredLicenses = project.declaredLicenses.map { licenses.addIfRequired(LicenseId(it)) },
declaredLicensesProcessed = project.declaredLicensesProcessed.evaluate(),
detectedLicenses = detectedLicenses,
Expand Down Expand Up @@ -301,6 +302,7 @@ internal class EvaluatedModelMapper(private val input: ReporterInput) {
isProject = false,
definitionFilePath = "",
purl = pkg.purl,
authors = pkg.authors,
declaredLicenses = pkg.declaredLicenses.map { licenses.addIfRequired(LicenseId(it)) },
declaredLicensesProcessed = pkg.declaredLicensesProcessed.evaluate(),
detectedLicenses = detectedLicenses,
Expand Down Expand Up @@ -549,6 +551,7 @@ internal class EvaluatedModelMapper(private val input: ReporterInput) {
isProject = false,
definitionFilePath = "",
purl = null,
authors = emptySet(),
declaredLicenses = emptyList(),
declaredLicensesProcessed = EvaluatedProcessedDeclaredLicense(null, emptyList(), emptyList()),
detectedLicenses = emptySet(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ data class EvaluatedPackage(
@JsonInclude(JsonInclude.Include.NON_NULL)
val purl: String? = null,
@JsonInclude(JsonInclude.Include.NON_EMPTY)
val authors: Set<String>,
@JsonInclude(JsonInclude.Include.NON_EMPTY)
val declaredLicenses: List<LicenseId>,
val declaredLicensesProcessed: EvaluatedProcessedDeclaredLicense,
@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand Down

0 comments on commit 63b2b2d

Please sign in to comment.