-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbumpSPDX.jl
33 lines (27 loc) · 1.14 KB
/
bumpSPDX.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# SPDX-License-Identifier: MIT
using PkgToSoftwareBOM
using SPDX
using Pkg
using UUIDs
spdxFileName= "SPDX.spdx.json"
myName= SpdxCreatorV2("Person", "Simon Avery", "savery@ieee.org")
myTool= SpdxCreatorV2("Tool", "PkgToSBOM.jl", "")
myLicense= SpdxLicenseExpressionV2("MIT")
myPackage_instr= spdxPackageInstructions(
spdxfile_toexclude= [spdxFileName],
originator= myName,
declaredLicense= myLicense,
copyright= "Copyright (c) 2022 Simon Avery <savery@ieee.org> and contributors",
name= "SPDX")
devRoot= filter(p-> p.first == "SPDX", Pkg.project().dependencies)
myNamespace= "https://github.com/SamuraiAku/SPDX.jl/blob/main/SPDX.spdx.json"
active_pkgs= Pkg.project().dependencies;
SPDX_docCreation= spdxCreationData(
Name= "SPDX.jl Developer SBOM",
Creators= [myName, myTool],
NamespaceURL= myNamespace,
rootpackages= devRoot,
packageInstructions= Dict{UUID, spdxPackageInstructions}(active_pkgs[myPackage_instr.name] => myPackage_instr)
)
sbom= generateSPDX(SPDX_docCreation)
writespdx(sbom, spdxFileName)