Skip to content

Add license notice generator#3

Closed
m4pl wants to merge 1 commit into
GrapheneOS:mainfrom
m4pl:license-notice-generator
Closed

Add license notice generator#3
m4pl wants to merge 1 commit into
GrapheneOS:mainfrom
m4pl:license-notice-generator

Conversation

@m4pl
Copy link
Copy Markdown

@m4pl m4pl commented May 26, 2026

Adds a script that generates assets/licenses.html, the open-source notices screen shown in the app.
The script itself was written with AI assistance.

How it works

  1. Capture the runtime dependency tree once:
./gradlew :app:dependencies --configuration releaseRuntimeClasspath

scripts/license/cache/deps.txt

  1. Generate the HTML:
python3 scripts/license/generate_licenses.py --offline

For each dependency the script:

  • reads the LICENSE/NOTICE embedded in the .jar/.aar if present
  • otherwise falls back to the canonical SPDX text bundled under scripts/license/texts/
  • pulls the project name and upstream URL from the POM for attribution

Results are cached per coordinate, so reruns are instant unless versions change.

Release blockers the script enforces

  • GPL / AGPL: hard fail, HTML is not written
  • LGPL / MPL / EPL / CDDL: a SOURCE AVAILABILITY section is emitted listing upstream URLs
  • MIT / BSD / ISC without a real copyright line: CHECK COPYRIGHT section; resolve by adding an entry in scripts/license/license-overrides.json

Output

assets/licenses.html: a single self-contained file, Material 3 styling, each notice collapsed by default, no JS, viewport-fit so there is no horizontal scroll in the in-app WebView.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant