Skip to content

Commit 076710d

Browse files
committed
AI feedback
1 parent 4a44dd3 commit 076710d

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ jobs:
146146
147147
libs_android:
148148
name: Building Android libraries
149-
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
150149
runs-on: ubuntu-latest
151150
outputs:
152151
artifact_id: ${{ steps.upload.outputs.artifact-id }}
@@ -177,7 +176,7 @@ jobs:
177176
178177
- name: Build signed library
179178
shell: bash
180-
if: ${{ inputs.sign-publication == '1' }}
179+
if: ${{ inputs.sign-publication }}
181180
run: |
182181
cd android
183182
./gradlew build zipPublication -PgpgKey=${INPUTS_GPG_KEY} -PgpgPassword=${INPUTS_GPG_PASSWORD}
@@ -189,7 +188,7 @@ jobs:
189188

190189
- name: Build library without signing
191190
shell: bash
192-
if: ${{ inputs.sign-publication == '0' }}
191+
if: ${{ !inputs.sign-publication' }}
193192
run: |
194193
cd android
195194
./gradlew build zipPublication -PsignPublication=0
@@ -231,7 +230,6 @@ jobs:
231230
232231
libs_wasm:
233232
name: Basic WASM build
234-
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
235233
runs-on: ubuntu-latest
236234
outputs:
237235
artifact_id: ${{ steps.upload.outputs.artifact-id }}
@@ -257,7 +255,6 @@ jobs:
257255

258256
libs_xcframework:
259257
name: Build XCFramework
260-
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
261258
runs-on: macos-latest
262259
outputs:
263260
artifact_id: ${{ steps.upload.outputs.artifact-id }}

dart/tool/generate_sbom.dart

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ import 'package:uuid/uuid.dart';
77
///
88
/// Usage: `dart tool/generate_sbom.dart > bom.json`
99
void 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

Comments
 (0)