Skip to content

Commit

Permalink
[nrf fromlist] scripts: list_boards: Reintroduce Board.dir as @Property
Browse files Browse the repository at this point in the history
Upstream PR: zephyrproject-rtos/zephyr#72857

In the `Board` class, the `dir` member was renamed to `directories`,
both to indicate that it is now a list (in HWMv2 with board extensions)
and to reflect the addition of the `BOARD_DIRECTORIES` CMake variable.
Considering that the build system also keeps the `BOARD_DIR` variable,
and for the sake of backwards compatibility and brevity, it should be
useful to retain `Board.dir` in Python as well, symmetrically.

Signed-off-by: Grzegorz Swiderski <[email protected]>
(cherry picked from commit 25fd4b16e8c488792d0d8450e1b822292f94d3c3)
  • Loading branch information
57300 authored and nordicjm committed Jul 19, 2024
1 parent ba97e9d commit a51f1aa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/list_boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ class Board:
socs: List[Soc] = field(default_factory=list, compare=False)
variants: List[str] = field(default_factory=list, compare=False)

@property
def dir(self):
# Get the main board directory.
if isinstance(self.directories, Path):
return self.directories
return self.directories[0]

def from_qualifier(self, qualifiers):
qualifiers_list = qualifiers.split('/')

Expand Down

0 comments on commit a51f1aa

Please sign in to comment.