diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2021-11-01 20:24:10 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-02 21:22:41 +0000 |
commit | cba577bc06e5263416cb21fbad0d10b720524e29 (patch) | |
tree | 1e024b83a6c6c6c631a460f68d36471d9a2ad3d9 /zephyr/zmake/zmake/project.py | |
parent | be7f2519258cf9ce797975b4c0274cd2e58cdbde (diff) | |
download | chrome-ec-cba577bc06e5263416cb21fbad0d10b720524e29.tar.gz |
zephyr: zmake: Rename project name field
As discussed rename the project name field to "project_name" and make
it a required as a keyword argument.
For tests, the name project_name makes a bit less sense, so call it
test_name, automatically prepend "test-" to all tests, and allow it to
be specified either as a keyword or positional argument.
BUG=b:193815337
BRANCH=none
TEST=unit tests pass
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: Idd1212da98382ddd9961da0fda4078595f540fc8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3256035
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'zephyr/zmake/zmake/project.py')
-rw-r--r-- | zephyr/zmake/zmake/project.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/zephyr/zmake/zmake/project.py b/zephyr/zmake/zmake/project.py index 62a3b7dd00..0fa7bf36b7 100644 --- a/zephyr/zmake/zmake/project.py +++ b/zephyr/zmake/zmake/project.py @@ -37,8 +37,8 @@ def load_config_file(path): """ projects = [] - def register_project(name, **kwargs): - projects.append(Project(ProjectConfig(name=name, **kwargs))) + def register_project(**kwargs): + projects.append(Project(ProjectConfig(**kwargs))) # The Python environment passed to the config file. config_globals = { @@ -75,19 +75,19 @@ def find_projects(root_dir): found_projects = {} for path in pathlib.Path(root_dir).rglob("BUILD.py"): for project in load_config_file(path): - if project.config.name in found_projects: + if project.config.project_name in found_projects: raise KeyError( "Duplicate project defined: {} (in {})".format( - project.config.name, path + project.config.project_name, path ) ) - found_projects[project.config.name] = project + found_projects[project.config.project_name] = project return found_projects @dataclasses.dataclass class ProjectConfig: - name: str + project_name: str zephyr_board: str supported_toolchains: "list[str]" output_packer: type |