zephyr/scripts
Marti Bolivar 06c9bf47b3 snippets: initial snippet.yml support
Add a new script, snippets.py, which is responsible for searching
SNIPPET_ROOT for snippet definitions, validating them, and informing
the build system about what needs doing as a result.

Use this script in snippets.cmake to:

- validate any discovered snippet.yml files
- error out on undefined snippets
- add a 'snippets' build system target that prints all snippet
  names (analogous to 'boards' and 'shields' targets)
- handle any specific build system settings properly,
  by include()-ing a file it generates

With this patch, you can define or extend a snippet in a snippet.yml
file anywhere underneath a directory in SNIPPET_ROOT. The snippet.yml
file format has a schema whose initial definition is in a new file,
snippet-schema.yml.

This initial snippet.yml file format supports adding .overlay and
.conf files, like this:

  name: foo
  append:
    DTC_OVERLAY_FILE: foo.overlay
    OVERLAY_CONFIG: foo.conf
  boards:
    myboard:
      append:
        DTC_OVERLAY_FILE: myboard.overlay
        OVERLAY_CONFIG: myboard.conf
    /my-regular-expression-over-board-names/:
      append:
        DTC_OVERLAY_FILE: myregexp.overlay
        OVERLAY_CONFIG: myregexp.conf

(Note that since the snippet feature is intended to be extensible, the
same snippet name may appear in multiple files throughout any
directory in SNIPPET_ROOT, with each addition augmenting prior ones.)

This initial syntax aligns with the following snippet design goals:

- extensible: you can add board-specific support for an existing
  snippet in another module

- able to combine multiple types of configuration: we can now apply a
  .overlay and .conf at the same time

- specializable: this allows you to define settings that only apply
  to a selectable set of boards (including with regular expression
  support for matching against multiple similar boards that follow
  a naming convention)

- DRY: you can use regular expressions to apply the same snippet
  settings to multiple boards like this: /(board1|board2|...)/

This patch is not trying to design and implement everything up front.
Additional features can and will be added to the snippet.yml format
over time; using YAML as a format allows us to make
backwards-compatible extensions as needed.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-03-26 16:12:41 +02:00
..
build scripts: Print file causing error for syscalls 2023-03-17 11:48:36 +01:00
checkpatch scripts: checkpatch: add Atmel Pwm typedef 2022-07-12 17:51:23 +02:00
ci scripts: compliance: allow webp image files 2023-03-21 16:03:43 -04:00
coccinelle
coredump treewide: Disable automatic argparse argument shortening 2023-01-26 20:12:36 +09:00
dts edtlib: extract _slice() code to new helper module 2023-02-27 17:44:45 +01:00
footprint footprint: ci: Remove audio SOF samples 2023-03-02 11:46:54 -05:00
generate_usb_vif treewide: Disable automatic argparse argument shortening 2023-01-26 20:12:36 +09:00
gitlint scripts: zephyr_commit_rules: improve commit error messages 2023-02-08 15:03:56 -08:00
kconfig scripts: kconfig: add function to determine if GPIO hogs are enabled 2023-01-27 14:38:52 -08:00
logging/dictionary treewide: Disable automatic argparse argument shortening 2023-01-26 20:12:36 +09:00
net scripts: net: add enumerate_http_status.py 2022-10-12 09:02:21 -04:00
pylib twister: fix timeout status for the device handler 2023-03-22 09:34:33 +01:00
pylint/checkers scripts: pylint: Add argument parser abbreviation checker 2023-01-26 20:12:36 +09:00
release scripts: add list_devicetree_bindings_changes.py 2023-03-25 11:12:38 +01:00
schemas snippets: initial snippet.yml support 2023-03-26 16:12:41 +02:00
support treewide: Disable automatic argparse argument shortening 2023-01-26 20:12:36 +09:00
tests twister: add support for levels and test configuration 2023-03-07 15:49:16 +01:00
tracing tracing: scripts: Fix spelling 2023-02-08 01:09:31 +09:00
utils build: drop LEGACY_INCLUDE_PATH support 2023-02-21 15:06:48 +01:00
west_commands west: runner: Use --verify and --verify-only with openocd and hex files 2023-03-21 09:36:29 +01:00
.gitignore
checkpatch.pl checkpatch: update --exclude docs 2022-12-01 15:48:30 +01:00
checkstack.pl
coccicheck
dump_bugs_pickle.py treewide: Disable automatic argparse argument shortening 2023-01-26 20:12:36 +09:00
gen_gcov_files.py treewide: Disable automatic argparse argument shortening 2023-01-26 20:12:36 +09:00
get_maintainer.py treewide: Disable automatic argparse argument shortening 2023-01-26 20:12:36 +09:00
github_helpers.py scripts: add github_helpers.py 2022-05-24 18:48:03 +02:00
list_boards.py treewide: Disable automatic argparse argument shortening 2023-01-26 20:12:36 +09:00
make_bugs_pickle.py treewide: Disable automatic argparse argument shortening 2023-01-26 20:12:36 +09:00
requirements-base.txt requirements: bump pyelftools to >=0.27 2022-06-10 09:46:31 +02:00
requirements-build-test.txt
requirements-compliance.txt scripts: compliance: add support for YAMLLint 2023-01-04 17:29:23 +01:00
requirements-doc.txt doc: Do not use Sphinx 5.2.0.post0 2022-09-25 10:37:32 +02:00
requirements-extras.txt clang-format: Enable InsertBraces option 2022-12-20 22:51:57 +01:00
requirements-run-test.txt soc: xtensa: tools: remove dependency of netifaces package 2022-08-16 22:51:53 -07:00
requirements.txt
series-push-hook.sh
set_assignees.py scripts: set_assignee: don't skip assignment on too many labels 2023-01-26 14:57:29 -05:00
snippets.py snippets: initial snippet.yml support 2023-03-26 16:12:41 +02:00
spelling.txt
tags.sh
twister twister: move main to twisterlib/twister_main.py 2023-01-13 15:39:04 -08:00
valgrind.supp
west-commands.yml west: west twister integration 2023-01-13 15:39:04 -08:00
zephyr_module.py sysbuild: support Zephyr modules 2023-03-09 09:25:00 +01:00