Bundle licenses#
Sysand Index requires every project to declare a SPDX license expression in
the license field of .project.json and to bundle the matching license
texts under a LICENSES/ directory. SPDX provides standard license
identifiers such as MIT and Apache-2.0; the REUSE specification
provides the convention for including the matching license texts under
LICENSES/. Sysand Index presents the bundled license texts on the project
page’s Licenses tab.
To follow this guide you need an existing Sysand project. See Creating your first project if you do not have one yet.
Bundle the license texts#
Declare the license expression in the
licensefield of.project.json:{ "license": "MIT OR Apache-2.0" }
Create a
LICENSES/directory next to.project.jsonand add one.txtfile named after each identifier in the expression:project-directory/ .project.json .meta.json LICENSES/ MIT.txt Apache-2.0.txtUse the same rule for
WITHexceptions and customLicenseRef-identifiers:GPL-2.0-only WITH Classpath-exception-2.0needsLICENSES/GPL-2.0-only.txtandLICENSES/Classpath-exception-2.0.txt;LicenseRef-MyCustomneedsLICENSES/LicenseRef-MyCustom.txt.Run
sysand buildand confirm that every license file is picked up:$ sysand build Building kpar `/path/to/my-project/output/my_project-0.0.1.kpar` Including license from `/path/to/my-project/LICENSES/MIT.txt` Including license from `/path/to/my-project/LICENSES/Apache-2.0.txt`
If a license file referenced by the expression is missing, the build still succeeds but prints a warning:
$ sysand build Building kpar `/path/to/my-project/output/my_project-0.0.1.kpar` Including license from `/path/to/my-project/LICENSES/MIT.txt` warning: license file `LICENSES/Apache-2.0.txt` referenced by project license `MIT OR Apache-2.0` was not found
Do not ignore the warning: Sysand Index rejects uploads whose LICENSES/
contents do not exactly match the license expression: both missing and
unexpected license files cause the upload to fail. See KPAR archive
validation for the full upload
requirements.