@@ -7,7 +7,7 @@ import 'package:uuid/uuid.dart';
77///
88/// Usage: `dart tool/generate_sbom.dart > bom.json`
99void main () async {
10- final crates = await findDependencies ();
10+ final [coreExtension, ...dependencies] = await findDependencies ();
1111
1212 const journeyApps = {
1313 'name' : 'JourneyApps' ,
@@ -21,7 +21,7 @@ void main() async {
2121 if (Platform .environment['GITHUB_ACTIONS' ] == 'true' )
2222 'version' : int .parse (Platform .environment['GITHUB_RUN_ID' ]! ),
2323 'metadata' : {
24- 'component' : crates.first .describeAsBomComponent (),
24+ 'component' : coreExtension .describeAsBomComponent (),
2525 'lifecycles' : [
2626 {'phase' : 'build' }
2727 ],
@@ -30,14 +30,33 @@ void main() async {
3030 'supplier' : journeyApps,
3131 },
3232 'components' : [
33- for (final crate in crates.skip (1 )) crate.describeAsBomComponent (),
33+ for (final crate in dependencies) crate.describeAsBomComponent (),
34+ // Also declare SQLite as an external component required at runtime (since
35+ // this is a SQLite extension).
36+ {
37+ 'isExternal' : true ,
38+ 'versionRange' : 'vers:semver/>=3.44.0|<4.0.0' ,
39+ 'type' : 'library' ,
40+ 'name' : 'SQLite' ,
41+ 'purl' : 'pkg:generic/sqlite' ,
42+ 'bom-ref' : 'external-sqlite' ,
43+ 'licenses' : [
44+ {'expression' : 'blessing' },
45+ ],
46+ 'externalReferences' : [
47+ {'url' : 'https://sqlite.org/' , 'type' : 'website' },
48+ ],
49+ }
3450 ],
3551 'dependencies' : [
36- for (final crate in crates )
52+ for (final crate in [coreExtension, ...dependencies] )
3753 if (crate.dependencies.isNotEmpty)
3854 {
3955 'ref' : crate.bomRef,
40- 'dependsOn' : [for (final dep in crate.dependencies) dep.bomRef]
56+ 'dependsOn' : [
57+ for (final dep in crate.dependencies) dep.bomRef,
58+ if (crate == coreExtension) 'external-sqlite'
59+ ]
4160 }
4261 ],
4362 };
0 commit comments