Commit 3cfbb54
Enable SPDX 3.0 SBOM generation for maps-android, common and gl-native (#10692)
## Summary
Fixes https://mapbox.atlassian.net/browse/MAPSAND-2574
Requires:
* sdk-registry gradle plugin 1.5.5
* https://github.com/mapbox/mapbox-android-gradle-plugins/pull/126
* https://github.com/mapbox/mapbox-android-gradle-plugins/pull/127
* https://github.com/mapbox/mapbox-android-gradle-plugins/pull/129
* https://github.com/mapbox/mapbox-android-gradle-plugins/pull/130
* https://github.com/mapbox/mapbox-android-gradle-plugins/pull/131
* https://github.com/mapbox/mapbox-android-gradle-plugins/pull/132
* mapbox/api-downloads#5021 (api-downloads file
whitelist update)
Enables SPDX 3.0 SBOM generation for `maps-android`, `common`, and
`gl-native`:
- `sbom = true` and `nativeSbomPath` configured in `common` and
`gl-native`
- `sbom = true` configured in all publishable `maps-android` modules via
the convention plugin
- Native C++ dependencies from committed
`LICENSE-Android.packages.sbom.json` files are merged into the SBOM with
`CONTAINS` relationships
- Top-level modules auto-discover native SBOMs from transitive
dependencies via Maven sibling files, HTTP download, and included-build
markers
- Generated SBOMs are validated against the SPDX 3.0.1 spec via
recursive `document.verify()`
- `downloadLocation` uses eventual Maven hosting URLs (`api.mapbox.com`)
instead of `file://` or `NOASSERTION`
- Updated sdk-registry plugin to **1.5.5** across common, gl-native, and
maps-android
## SBOM Scripts
Added to `scripts/sbom/`:
| Script | Description |
|---|---|
| `download-sboms.sh` | Download SBOMs for common, gl-native,
maps-android (all 19 modules), and nav-sdk-cpp modules from
`api.mapbox.com` |
| `download-nav-sboms.sh` | Download SBOMs for all Navigation SDK
modules, both NDK23 and NDK27 variants |
| `validate-sboms.py` | Validate SPDX 3.0 SBOMs: structural validity,
reference integrity, native containment, dep chain, baseline comparison
|
Usage:
```bash
# Download and validate maps-android SBOMs for a snapshot
./download-sboms.sh 21.0 SNAPSHOT-03-18--08-03.git-47b23fe -y
./validate-sboms.py sboms/SNAPSHOT-03-18--08-03.git-47b23fe --baseline baseline/baseline-SNAPSHOT-03-17--12-31.git-162f121.json
```
## CI Pipeline Flow
```mermaid
flowchart TD
subgraph common["common (included build)"]
C1["Build common AAR"] --> C2["publishToMavenLocal"]
CN["LICENSE-Android.packages.sbom.json<br/>(11 native C++ packages)"]
C2 --> C3["generateSpdx3ForRelease"]
CN -.->|"nativeSbomPath (direct)"| C3
C3 --> C4["mapboxSDKRegistryUpload"]
end
subgraph glnative["gl-native (includes common)"]
G1["Build gl-native AAR"] --> G2["publishToMavenLocal"]
GN["LICENSE-Android.packages.sbom.json<br/>(56 native C++ packages)"]
G2 --> G3["generateSpdx3ForRelease"]
GN -.->|"nativeSbomPath (direct)"| G3
C3 -.->|"included-build marker"| G3
G3 --> G4["mapboxSDKRegistryUpload"]
end
subgraph maps["maps-android"]
M0["Download ~/.m2 from common + gl-native"] --> M1["publishToMavenLocal"]
M1 --> M2["generateSpdx3ForRelease<br/>(maven-sibling discovery)"]
M2 --> M3["mapboxSDKRegistryUpload"]
end
C4 -->|"~/.m2 workspace"| M0
G4 -->|"~/.m2 workspace"| M0
```
### Native SBOM Discovery Strategies
| Strategy | Used by | Description |
|---|---|---|
| `nativeSbomPath` (direct) | common, gl-native | Committed
`LICENSE-Android.packages.sbom.json` read directly |
| included-build marker | gl-native | common's native SBOM discovered
via marker file written during configuration |
| maven-sibling | maps-android | Native SBOM classifier files found next
to AARs in `~/.m2` |
In CI, `~/.m2` workspace artifacts are transferred between jobs so
maps-android can discover native SBOMs from common and gl-native via
sibling file lookup.
## Test Plan
- [x] `generateSpdx3ForRelease` succeeds for common, gl-native, and
maps-android in local builds
- [x] SPDX 3.0.1 validation passes for all generated SBOMs
- [x] Native C++ packages appear with correct CONTAINS relationships
(common: 11 pkgs, gl-native: 65 pkgs)
- [x] `downloadLocation` URLs use `api.mapbox.com` format
- [x] CI snapshot `SNAPSHOT-03-18--08-03.git-47b23fe`: **16/16 SBOMs
fully valid** (vs 8/16 with 1.5.2)
- [x] Verify SBOM files are included in S3 upload alongside AARs in CI
- [x] Local dry-run: all 19 maps-android modules present in
`combined-aws-s3-cp-commands.txt` with no duplicates (validates 1.5.5
race condition fix)
cc @mapbox/core-sdk
cc @mapbox/maps-android
cc @mapbox/sdk-platform
cc @mapbox/gl-native
GitOrigin-RevId: 71aff23c3101959e5c36452f34e015f6e7d2acb11 parent 70c73e8 commit 3cfbb54
5 files changed
Lines changed: 6 additions & 1 deletion
File tree
- gradle
- mapbox-convention-plugin
- src/main/kotlin/com/mapbox/maps/gradle/plugins/extensions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
0 commit comments