Skip to content

Commit

Permalink
snippets: support for EXTRA_DTC_OVERLAY_FILE and EXTRA_CONF_FILE
Browse files Browse the repository at this point in the history
This commit adds change snippets to use the new EXTRA_DTC_OVERLAY_FILE
and EXTRA_CONF_FILE Zephyr build system variables instead of
DTC_OVERLAY_FILE and OVERLAY_CONFIG.

Signed-off-by: Torsten Rasmussen <[email protected]>
  • Loading branch information
tejlmand authored and fabiobaltieri committed May 25, 2023
1 parent fd526cc commit 1561a07
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions doc/build/snippets/writing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ this:
name: foo
append:
DTC_OVERLAY_FILE: foo.overlay
OVERLAY_CONFIG: foo.conf
EXTRA_DTC_OVERLAY_FILE: foo.overlay
EXTRA_CONF_FILE: foo.conf
Namespacing
***********
Expand Down Expand Up @@ -113,7 +113,7 @@ This :file:`snippet.yml` adds :file:`foo.overlay` to the build:
name: foo
append:
DTC_OVERLAY_FILE: foo.overlay
EXTRA_DTC_OVERLAY_FILE: foo.overlay
The path to :file:`foo.overlay` is relative to the directory containing
:file:`snippet.yml`.
Expand All @@ -129,7 +129,7 @@ This :file:`snippet.yml` adds :file:`foo.conf` to the build:
name: foo
append:
OVERLAY_CONFIG: foo.conf
EXTRA_CONF_FILE: foo.conf
The path to :file:`foo.conf` is relative to the directory containing
:file:`snippet.yml`.
Expand All @@ -154,10 +154,10 @@ By name
boards:
bar: # settings for board "bar" go here
append:
DTC_OVERLAY_FILE: bar.overlay
EXTRA_DTC_OVERLAY_FILE: bar.overlay
baz: # settings for board "baz" go here
append:
DTC_OVERLAY_FILE: baz.overlay
EXTRA_DTC_OVERLAY_FILE: baz.overlay
The above example uses :file:`bar.overlay` when building for board ``bar``, and
:file:`baz.overlay` when building for ``baz``.
Expand All @@ -180,7 +180,7 @@ For example:
boards:
/my_vendor_.*/:
append:
DTC_OVERLAY_FILE: my_vendor.overlay
EXTRA_DTC_OVERLAY_FILE: my_vendor.overlay
The above example uses devicetree overlay :file:`my_vendor.overlay` when
building for either board ``my_vendor_board1`` or ``my_vendor_board2``. It
Expand Down
4 changes: 2 additions & 2 deletions scripts/schemas/snippet-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ schema;append-schema:
# See uses under 'append:' keys below.
type: map
mapping:
DTC_OVERLAY_FILE:
EXTRA_DTC_OVERLAY_FILE:
type: str
OVERLAY_CONFIG:
EXTRA_CONF_FILE:
type: str

type: map
Expand Down
2 changes: 1 addition & 1 deletion scripts/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def process_data(self, pathobj: Path, snippet_data: dict):
'''Process the data in a snippet.yml file, after it is loaded into a
python object and validated by pykwalify.'''
def append_value(variable, value):
if variable in ('DTC_OVERLAY_FILE', 'OVERLAY_CONFIG'):
if variable in ('EXTRA_DTC_OVERLAY_FILE', 'EXTRA_CONF_FILE'):
path = pathobj.parent / value
if not path.is_file():
_err(f'snippet file {pathobj}: {variable}: file not found: {path}')
Expand Down
4 changes: 2 additions & 2 deletions snippets/cdc-acm-console/snippet.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: cdc-acm-console
append:
OVERLAY_CONFIG: cdc-acm-console.conf
DTC_OVERLAY_FILE: cdc-acm-console.overlay
EXTRA_CONF_FILE: cdc-acm-console.conf
EXTRA_DTC_OVERLAY_FILE: cdc-acm-console.overlay
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: bar
append:
DTC_OVERLAY_FILE: bar.overlay
EXTRA_DTC_OVERLAY_FILE: bar.overlay
2 changes: 1 addition & 1 deletion tests/cmake/snippets/snippets/foo/snippet.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: foo
append:
OVERLAY_CONFIG: foo.conf
EXTRA_CONF_FILE: foo.conf

0 comments on commit 1561a07

Please sign in to comment.