@@ -7,7 +7,13 @@ import 'package:uuid/uuid.dart';
77///
88/// Usage: `dart tool/generate_sbom.dart > bom.json`
99void main () async {
10+ // The first library is the core extension itself (the powersync_core crate).
11+ // The crate we actually compile as binaries is powersync_static or
12+ // powersync_loadable, but these contain no additional dependencies.
1013 final [coreExtension, ...dependencies] = await findDependencies ();
14+ if (coreExtension.name != 'powersync_core' ) {
15+ throw 'Unexpected root: ${coreExtension .name }' ;
16+ }
1117
1218 const journeyApps = {
1319 'name' : 'JourneyApps' ,
@@ -18,8 +24,7 @@ void main() async {
1824 'bomFormat' : 'CycloneDX' ,
1925 'specVersion' : '1.7' ,
2026 'serialNumber' : 'urn:uuid:${const Uuid ().v4 ()}' ,
21- if (Platform .environment['GITHUB_ACTIONS' ] == 'true' )
22- 'version' : int .parse (Platform .environment['GITHUB_RUN_ID' ]! ),
27+ 'version' : 1 ,
2328 'metadata' : {
2429 'component' : coreExtension.describeAsBomComponent (),
2530 'lifecycles' : [
@@ -72,7 +77,7 @@ final class RustCrate {
7277
7378 final List <RustCrate > dependencies = [];
7479
75- String get bomRef => '$name - $version ' ;
80+ String get bomRef => '$name @ $version ' ;
7681
7782 RustCrate ({
7883 required this .name,
@@ -149,6 +154,10 @@ Future<List<RustCrate>> findDependencies() async {
149154 final license = match[4 ]! ;
150155 final repository = match[5 ]! ;
151156
157+ if (license.isEmpty) {
158+ throw 'Crate $name @$version does not include a license expression.' ;
159+ }
160+
152161 // A crate is only fully expanded the first time it's encountered, so
153162 // later (deduped) occurrences reuse the same instance and its already
154163 // populated dependencies.
0 commit comments