Skip to content

Commit

Permalink
feat(model): Extend Identifier.toPurl() with handling for Bazel
Browse files Browse the repository at this point in the history
See also [1].

[1]: package-url/purl-spec#317

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Nov 21, 2024
1 parent 0ff17e7 commit d1bd006
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions model/src/main/kotlin/utils/PurlExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import org.ossreviewtoolkit.model.VcsType
fun Identifier.getPurlType() =
when (type.lowercase()) {
"bower" -> PurlType.BOWER
"bazel" -> PurlType.BAZEL

Check warning on line 42 in model/src/main/kotlin/utils/PurlExtensions.kt

View check run for this annotation

Codecov / codecov/patch

model/src/main/kotlin/utils/PurlExtensions.kt#L42

Added line #L42 was not covered by tests
"carthage" -> PurlType.CARTHAGE
"composer" -> PurlType.COMPOSER
"conan" -> PurlType.CONAN
Expand Down
1 change: 1 addition & 0 deletions model/src/main/kotlin/utils/PurlUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import org.ossreviewtoolkit.utils.common.percentEncode
enum class PurlType(private val value: String) {
ALPINE("alpine"),
A_NAME("a-name"),
BAZEL("bazel"),
BOWER("bower"),
CARGO("cargo"),
CARTHAGE("carthage"),
Expand Down

0 comments on commit d1bd006

Please sign in to comment.