-
Notifications
You must be signed in to change notification settings - Fork 2
/
bumpSPDX.jl
33 lines (27 loc) · 1.24 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 Pkg
using UUIDs
spdxFileName= "PkgToSoftwareBOM.spdx.json"
myName= SpdxCreatorV2("Person", "Simon Avery", "[email protected]")
myTool= SpdxCreatorV2("Tool", "PkgToSoftwareBOM.jl", "")
myLicense= SpdxLicenseExpressionV2("MIT")
myPackage_instr= spdxPackageInstructions(
spdxfile_toexclude= [spdxFileName],
originator= myName,
declaredLicense= myLicense,
copyright= "Copyright (c) 2023 Simon Avery <[email protected]> and contributors",
name= "PkgToSoftwareBOM")
devRoot= filter(p-> p.first == "PkgToSoftwareBOM", Pkg.project().dependencies)
myNamespace= "https://github.com/SamuraiAku/PkgToSoftwareBOM.jl/blob/main/PkgToSoftwareBOM.spdx.json"
active_pkgs= Pkg.project().dependencies;
SPDX_docCreation= spdxCreationData(
Name= "PkgToSoftwareBOM.jl Developer SBOM",
Creators= [myName, myTool],
NamespaceURL= myNamespace,
rootpackages= devRoot,
packageInstructions= Dict{UUID, spdxPackageInstructions}(active_pkgs[myPackage_instr.name] => myPackage_instr),
find_artifactsource= true
)
sbom= generateSPDX(SPDX_docCreation)
writespdx(sbom, spdxFileName)