[rtems-central commit] config: Split enabled set

Sebastian Huber sebh at rtems.org
Wed Aug 31 09:44:10 UTC 2022


Module:    rtems-central
Branch:    master
Commit:    40468438a3ca08ddcf76a44d47a994609e9c9224
Changeset: http://git.rtems.org/rtems-central/commit/?id=40468438a3ca08ddcf76a44d47a994609e9c9224

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Aug 31 11:17:02 2022 +0200

config: Split enabled set

---

 config.yml                           | 141 ++++++++++++++++++-----------------
 rtemsspec/applconfig.py              |   6 +-
 rtemsspec/interfacedoc.py            |   8 +-
 rtemsspec/tests/test_applconfig.py   |   3 +-
 rtemsspec/tests/test_interfacedoc.py |   3 +-
 spec2modules.py                      |   1 -
 6 files changed, 85 insertions(+), 77 deletions(-)

diff --git a/config.yml b/config.yml
index 529a2a59..8c55f09f 100644
--- a/config.yml
+++ b/config.yml
@@ -78,7 +78,9 @@ glossary:
     target: modules/rtems-docs/eng/glossary.rst
 appl-config:
   doxygen-target: modules/rtems/cpukit/doxygen/appl-config.h
-  enabled: []
+  enabled-source:
+  - RTEMS_QUAL
+  enabled-documentation: []
   groups:
   - uid: /acfg/if/group-bdbuf
     target: modules/rtems-docs/c-user/config/bdbuf.rst
@@ -109,7 +111,8 @@ appl-config:
 validation:
   base-directory: modules/rtems
 interface:
-  enabled: []
+  enabled:
+  - RTEMS_QUAL
   item-level-interfaces:
   - /build-options/if/container
   - /compiler/if/container
@@ -118,72 +121,74 @@ interface:
     /if/domain: modules/rtems
     /dev/if/domain: modules/rtems
 interface-documentation:
-- directives-target: modules/rtems-docs/c-user/barrier/directives.rst
-  group: /rtems/barrier/if/group
-  introduction-target: modules/rtems-docs/c-user/barrier/introduction.rst
-- directives-target: modules/rtems-docs/c-user/cache/directives.rst
-  group: /rtems/cache/if/group
-  introduction-target: modules/rtems-docs/c-user/cache/introduction.rst
-- directives-target: modules/rtems-docs/c-user/dual-ported-memory/directives.rst
-  group: /rtems/dpmem/if/group
-  introduction-target: modules/rtems-docs/c-user/dual-ported-memory/introduction.rst
-- directives-target: modules/rtems-docs/c-user/fatal-error/directives.rst
-  group: /rtems/fatal/if/group
-  introduction-target: modules/rtems-docs/c-user/fatal-error/introduction.rst
-- directives-target: modules/rtems-docs/c-user/timer/directives.rst
-  group: /rtems/timer/if/group
-  introduction-target: modules/rtems-docs/c-user/timer/introduction.rst
-- directives-target: modules/rtems-docs/c-user/initialization/directives.rst
-  group: /rtems/init/if/group
-  introduction-target: modules/rtems-docs/c-user/initialization/introduction.rst
-- directives-target: modules/rtems-docs/c-user/io/directives.rst
-  group: /rtems/io/if/group
-  introduction-target: modules/rtems-docs/c-user/io/introduction.rst
-- directives-target: modules/rtems-docs/c-user/kernel-character-io/directives.rst
-  group: /rtems/io/if/group-3
-  introduction-target: modules/rtems-docs/c-user/kernel-character-io/introduction.rst
-- directives-target: modules/rtems-docs/c-user/region/directives.rst
-  group: /rtems/region/if/group
-  introduction-target: modules/rtems-docs/c-user/region/introduction.rst
-- directives-target: modules/rtems-docs/c-user/multiprocessing/directives.rst
-  group: /rtems/mp/if/group
-  introduction-target: modules/rtems-docs/c-user/multiprocessing/introduction.rst
-- directives-target: modules/rtems-docs/c-user/semaphore/directives.rst
-  group: /rtems/sem/if/group
-  introduction-target: modules/rtems-docs/c-user/semaphore/introduction.rst
-- directives-target: modules/rtems-docs/c-user/event/directives.rst
-  group: /rtems/event/if/group
-  introduction-target: modules/rtems-docs/c-user/event/introduction.rst
-- directives-target: modules/rtems-docs/c-user/partition/directives.rst
-  group: /rtems/part/if/group
-  introduction-target: modules/rtems-docs/c-user/partition/introduction.rst
-- directives-target: modules/rtems-docs/c-user/task/directives.rst
-  group: /rtems/task/if/group
-  introduction-target: modules/rtems-docs/c-user/task/introduction.rst
-- directives-target: modules/rtems-docs/c-user/message/directives.rst
-  group: /rtems/message/if/group
-  introduction-target: modules/rtems-docs/c-user/message/introduction.rst
-- directives-target: modules/rtems-docs/c-user/object-services/directives.rst
-  group: /rtems/object/if/group
-  introduction-target: modules/rtems-docs/c-user/object-services/introduction.rst
-- directives-target: modules/rtems-docs/c-user/signal/directives.rst
-  group: /rtems/signal/if/group
-  introduction-target: modules/rtems-docs/c-user/signal/introduction.rst
-- directives-target: modules/rtems-docs/c-user/user-extensions/directives.rst
-  group: /rtems/userext/if/group
-  introduction-target: modules/rtems-docs/c-user/user-extensions/introduction.rst
-- directives-target: modules/rtems-docs/c-user/scheduling-concepts/directives.rst
-  group: /rtems/scheduler/if/group
-  introduction-target: modules/rtems-docs/c-user/scheduling-concepts/introduction.rst
-- directives-target: modules/rtems-docs/c-user/clock/directives.rst
-  group: /rtems/clock/if/group
-  introduction-target: modules/rtems-docs/c-user/clock/introduction.rst
-- directives-target: modules/rtems-docs/c-user/interrupt/directives.rst
-  group: /rtems/intr/if/group
-  introduction-target: modules/rtems-docs/c-user/interrupt/introduction.rst
-- directives-target: modules/rtems-docs/c-user/rate-monotonic/directives.rst
-  group: /rtems/ratemon/if/group
-  introduction-target: modules/rtems-docs/c-user/rate-monotonic/introduction.rst
+  enabled: []
+  groups:
+  - directives-target: modules/rtems-docs/c-user/barrier/directives.rst
+    group: /rtems/barrier/if/group
+    introduction-target: modules/rtems-docs/c-user/barrier/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/cache/directives.rst
+    group: /rtems/cache/if/group
+    introduction-target: modules/rtems-docs/c-user/cache/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/dual-ported-memory/directives.rst
+    group: /rtems/dpmem/if/group
+    introduction-target: modules/rtems-docs/c-user/dual-ported-memory/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/fatal-error/directives.rst
+    group: /rtems/fatal/if/group
+    introduction-target: modules/rtems-docs/c-user/fatal-error/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/timer/directives.rst
+    group: /rtems/timer/if/group
+    introduction-target: modules/rtems-docs/c-user/timer/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/initialization/directives.rst
+    group: /rtems/init/if/group
+    introduction-target: modules/rtems-docs/c-user/initialization/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/io/directives.rst
+    group: /rtems/io/if/group
+    introduction-target: modules/rtems-docs/c-user/io/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/kernel-character-io/directives.rst
+    group: /rtems/io/if/group-3
+    introduction-target: modules/rtems-docs/c-user/kernel-character-io/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/region/directives.rst
+    group: /rtems/region/if/group
+    introduction-target: modules/rtems-docs/c-user/region/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/multiprocessing/directives.rst
+    group: /rtems/mp/if/group
+    introduction-target: modules/rtems-docs/c-user/multiprocessing/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/semaphore/directives.rst
+    group: /rtems/sem/if/group
+    introduction-target: modules/rtems-docs/c-user/semaphore/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/event/directives.rst
+    group: /rtems/event/if/group
+    introduction-target: modules/rtems-docs/c-user/event/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/partition/directives.rst
+    group: /rtems/part/if/group
+    introduction-target: modules/rtems-docs/c-user/partition/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/task/directives.rst
+    group: /rtems/task/if/group
+    introduction-target: modules/rtems-docs/c-user/task/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/message/directives.rst
+    group: /rtems/message/if/group
+    introduction-target: modules/rtems-docs/c-user/message/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/object-services/directives.rst
+    group: /rtems/object/if/group
+    introduction-target: modules/rtems-docs/c-user/object-services/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/signal/directives.rst
+    group: /rtems/signal/if/group
+    introduction-target: modules/rtems-docs/c-user/signal/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/user-extensions/directives.rst
+    group: /rtems/userext/if/group
+    introduction-target: modules/rtems-docs/c-user/user-extensions/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/scheduling-concepts/directives.rst
+    group: /rtems/scheduler/if/group
+    introduction-target: modules/rtems-docs/c-user/scheduling-concepts/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/clock/directives.rst
+    group: /rtems/clock/if/group
+    introduction-target: modules/rtems-docs/c-user/clock/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/interrupt/directives.rst
+    group: /rtems/intr/if/group
+    introduction-target: modules/rtems-docs/c-user/interrupt/introduction.rst
+  - directives-target: modules/rtems-docs/c-user/rate-monotonic/directives.rst
+    group: /rtems/ratemon/if/group
+    introduction-target: modules/rtems-docs/c-user/rate-monotonic/introduction.rst
 spec-verification:
   root-type: /spec/root
 spec-documentation:
diff --git a/rtemsspec/applconfig.py b/rtemsspec/applconfig.py
index 40194048..a5d2dc27 100644
--- a/rtemsspec/applconfig.py
+++ b/rtemsspec/applconfig.py
@@ -324,7 +324,6 @@ def generate(config: dict, item_cache: ItemCache) -> None:
     with doxygen_content.content.defgroup_block(
             "RTEMSApplConfig", "Application Configuration Options"):
         doxygen_content.content.add("@ingroup RTEMSAPI")
-    enabled = config["enabled"]
     for group_config in config["groups"]:
         group = item_cache[group_config["uid"]]
         assert group.type == "interface/appl-config-group"
@@ -333,9 +332,10 @@ def generate(config: dict, item_cache: ItemCache) -> None:
             assert child.type.startswith("interface/appl-config-option")
             options[child.uid] = child
         sphinx_content = _SphinxContentAdaptor(sphinx_mapper)
-        _generate(group, options, enabled, sphinx_content)
+        _generate(group, options, config["enabled-documentation"],
+                  sphinx_content)
         sphinx_content.write(group_config["target"])
-        _generate(group, options, enabled, doxygen_content)
+        _generate(group, options, config["enabled-source"], doxygen_content)
     doxygen_content.content.prepend_copyrights_and_licenses()
     doxygen_content.content.prepend_spdx_license_identifier()
     doxygen_content.write(config["doxygen-target"])
diff --git a/rtemsspec/interfacedoc.py b/rtemsspec/interfacedoc.py
index 695af5f3..72f07492 100644
--- a/rtemsspec/interfacedoc.py
+++ b/rtemsspec/interfacedoc.py
@@ -245,15 +245,17 @@ def _directive_key(order: List[Item], item: Item) -> Tuple[int, str]:
     return (index, item.uid)
 
 
-def generate(config: list, enabled: List[str], item_cache: ItemCache) -> None:
+def generate(config: dict, item_cache: ItemCache) -> None:
     """
     Generates interface documentation according to the configuration.
 
     :param config: A dictionary with configuration entries.
     :param item_cache: The specification item cache containing the interfaces.
     """
-    group_uids = [doc_config["group"] for doc_config in config]
-    for doc_config in config:
+    groups = config["groups"]
+    enabled = config["enabled"]
+    group_uids = [doc_config["group"] for doc_config in groups]
+    for doc_config in groups:
         items = []  # type: List[Item]
         group = item_cache[doc_config["group"]]
         assert group.type == "interface/group"
diff --git a/rtemsspec/tests/test_applconfig.py b/rtemsspec/tests/test_applconfig.py
index 2184c03b..2d02c368 100644
--- a/rtemsspec/tests/test_applconfig.py
+++ b/rtemsspec/tests/test_applconfig.py
@@ -37,7 +37,8 @@ def test_applconfig(tmpdir):
     item_cache = ItemCache(item_cache_config)
 
     applconfig_config = {}
-    applconfig_config["enabled"] = ["X"]
+    applconfig_config["enabled-source"] = ["X"]
+    applconfig_config["enabled-documentation"] = ["X"]
     g_rst = os.path.join(tmpdir, "g.rst")
     applconfig_config["groups"] = [{"uid": "/g", "target": g_rst}]
     doxygen_h = os.path.join(tmpdir, "doxygen.h")
diff --git a/rtemsspec/tests/test_interfacedoc.py b/rtemsspec/tests/test_interfacedoc.py
index f66ac378..99ecdeef 100644
--- a/rtemsspec/tests/test_interfacedoc.py
+++ b/rtemsspec/tests/test_interfacedoc.py
@@ -49,7 +49,8 @@ def test_interfacedoc(tmpdir):
 
     item_cache_config = create_item_cache_config_and_copy_spec(
         tmpdir, "spec-interface", with_spec_types=True)
-    generate([doc_config, doc_config_2], [], ItemCache(item_cache_config))
+    config = {"enabled": [], "groups": [doc_config, doc_config_2]}
+    generate(config, ItemCache(item_cache_config))
 
     with open(introduction_rst, "r") as src:
         content = """.. SPDX-License-Identifier: CC-BY-SA-4.0
diff --git a/spec2modules.py b/spec2modules.py
index 04ce48b2..921a72ff 100755
--- a/spec2modules.py
+++ b/spec2modules.py
@@ -77,7 +77,6 @@ def main() -> None:
         rtemsspec.specdoc.document(config["spec-documentation"], item_cache)
         rtemsspec.glossary.generate(config["glossary"], item_cache)
         rtemsspec.interfacedoc.generate(config["interface-documentation"],
-                                        config["interface"]["enabled"],
                                         item_cache)
 
 



More information about the vc mailing list