diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-01-20 15:29:15 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-01-20 15:31:34 +0100 |
commit | 6ba755f11f80f624092618424e209f298d766562 (patch) | |
tree | f8973fbec25fabce138c8c70b38f0213f9771527 | |
parent | spec: Fix rtems_is_name_valid() (diff) | |
download | rtems-central-6ba755f11f80f624092618424e209f298d766562.tar.bz2 |
build: Gather installed files of groups
-rw-r--r-- | rtemsspec/build.py | 16 | ||||
-rw-r--r-- | rtemsspec/tests/spec-build/bsp.yml | 6 | ||||
-rw-r--r-- | rtemsspec/tests/spec-build/o.yml | 2 | ||||
-rw-r--r-- | rtemsspec/tests/spec-build/op.yml | 4 | ||||
-rw-r--r-- | rtemsspec/tests/test_build.py | 2 |
5 files changed, 19 insertions, 11 deletions
diff --git a/rtemsspec/build.py b/rtemsspec/build.py index 5ead7746..a2956be6 100644 --- a/rtemsspec/build.py +++ b/rtemsspec/build.py @@ -32,16 +32,20 @@ BSPMap = Dict[str, Dict[str, Item]] ItemMap = Dict[str, Item] -def _extend_by_install_and_source(item: Item, source_files: List[str]) -> None: +def _extend_by_install(item: Item, source_files: List[str]) -> None: for install in item["install"]: source_files.extend(install["source"]) - source_files.extend(item["source"]) def _extend_by_source(item: Item, source_files: List[str]) -> None: source_files.extend(item["source"]) +def _extend_by_install_and_source(item: Item, source_files: List[str]) -> None: + _extend_by_install(item, source_files) + _extend_by_source(item, source_files) + + def _extend_by_nothing(_item: Item, _source_files: List[str]) -> None: pass @@ -52,7 +56,7 @@ _EXTEND_SOURCE_FILES = { "config-file": _extend_by_nothing, "config-header": _extend_by_nothing, "test-program": _extend_by_source, - "group": _extend_by_nothing, + "group": _extend_by_install, "library": _extend_by_install_and_source, "objects": _extend_by_install_and_source, "option": _extend_by_nothing, @@ -63,10 +67,8 @@ _EXTEND_SOURCE_FILES = { def _gather_source_files(item: Item, enabled: List[str], source_files: List[str]) -> None: - for parent in item.parents(): - if parent["type"] == "build" and parent["build-type"] in [ - "group", "objects", "start-file", "test-program" - ] and parent.is_enabled(enabled): + for parent in item.parents("build-dependency"): + if parent.is_enabled(enabled): _gather_source_files(parent, enabled, source_files) _EXTEND_SOURCE_FILES[item["build-type"]](item, source_files) diff --git a/rtemsspec/tests/spec-build/bsp.yml b/rtemsspec/tests/spec-build/bsp.yml index 8e42c1b6..6be302e5 100644 --- a/rtemsspec/tests/spec-build/bsp.yml +++ b/rtemsspec/tests/spec-build/bsp.yml @@ -6,9 +6,11 @@ install: - source: - abc links: -- role: null +- role: build-dependency uid: o -- role: null +- role: build-dependency + uid: op +- role: build-dependency uid: d source: - def diff --git a/rtemsspec/tests/spec-build/o.yml b/rtemsspec/tests/spec-build/o.yml index 3b45d873..c3328684 100644 --- a/rtemsspec/tests/spec-build/o.yml +++ b/rtemsspec/tests/spec-build/o.yml @@ -4,7 +4,7 @@ install: - source: - jkl links: -- role: null +- role: build-dependency uid: s source: - mno diff --git a/rtemsspec/tests/spec-build/op.yml b/rtemsspec/tests/spec-build/op.yml new file mode 100644 index 00000000..49cf0dfc --- /dev/null +++ b/rtemsspec/tests/spec-build/op.yml @@ -0,0 +1,4 @@ +build-type: option +enabled-by: true +links: [] +type: build diff --git a/rtemsspec/tests/test_build.py b/rtemsspec/tests/test_build.py index e5290528..b5c3906f 100644 --- a/rtemsspec/tests/test_build.py +++ b/rtemsspec/tests/test_build.py @@ -41,4 +41,4 @@ def test_build(tmpdir): build_config["sources"] = ["a", "b"] build_config["uids"] = ["/g"] files = gather_files(build_config, item_cache) - assert files == ["a", "b", "stu", "jkl", "mno", "abc", "def", "th"] + assert files == ["a", "b", "stu", "jkl", "mno", "abc", "def", "ghi", "th"] |