]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
meta/files: add layer setup JSON schema and example
authorJoshua Watt <JPEWhacker@gmail.com>
Wed, 31 Aug 2022 11:13:57 +0000 (13:13 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 1 Sep 2022 09:05:42 +0000 (10:05 +0100)
commit72740b5dd635579e373b4bfe6ccacfe6a02aa998
tree2e2565bd3fe0cb7fddcdd02aada61883c6d271e1
parentf319534dc8fc68dfe120d129154a509f0cd6a3b0
meta/files: add layer setup JSON schema and example

Defines a common schema for layer setup that can be consumed by tools to
know how to fetch and assemble layers for end users. Also includes an
example of the layer setup that constructs poky/meta-intel/imaginary product layer
for reference.

The schema can be used to validate a layer setup file with the commands:

 $ python3 -m pip install jsonschema
 $ jsonschema -i meta/files/layers.example.json meta/files/layers.schema.json

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Alex: I made the following modifications to Joshua's original commit:

- moved the files from meta/lib to meta/files

- the example json showcases a multi-repo, multi-layer setup
instead of just poky - closer to a typical product

- added oe-selftest that validates the example json against the schema using python3-jsonschema-native

- the schema is modified so that:

-- all lists (sources, layers, remotes) are replaced by objects keyed by 'name' properties of the list items.
This allows using them as dicts inside Python, and makes the json more compact and readable.

-- added 'contains_this_file' property to source object

-- replaced 'remote' property with a 'oneOf' definition for git with a specific
'git-remote' property. 'oneOf' is problematic when schema validation fails:
the diagnostic is only that none of oneOf variants matched, which is too non-specific.

-- added 'describe' property to 'git-remote' object.

-- removed description property for a layer source: it is not clear how to add that
when auto-generating the json

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/files/layers.example.json [new file with mode: 0644]
meta/files/layers.schema.json [new file with mode: 0644]
meta/lib/oeqa/selftest/cases/bblayers.py