Skip to content

Commit a51f1aa

Browse files
57300nordicjm
authored andcommitted
[nrf fromlist] scripts: list_boards: Reintroduce Board.dir as @Property
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)
1 parent ba97e9d commit a51f1aa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/list_boards.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ class Board:
103103
socs: List[Soc] = field(default_factory=list, compare=False)
104104
variants: List[str] = field(default_factory=list, compare=False)
105105

106+
@property
107+
def dir(self):
108+
# Get the main board directory.
109+
if isinstance(self.directories, Path):
110+
return self.directories
111+
return self.directories[0]
112+
106113
def from_qualifier(self, qualifiers):
107114
qualifiers_list = qualifiers.split('/')
108115

0 commit comments

Comments
 (0)