idf-build-apps 2.5.0rc0__tar.gz → 2.5.0rc2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.pre-commit-config.yaml +2 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/CHANGELOG.md +19 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/PKG-INFO +2 -1
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/conf_common.py +6 -6
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/en/references/config_file.md +1 -1
- idf_build_apps-2.5.0rc2/docs/en/references/manifest.rst +281 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/__init__.py +1 -1
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/app.py +0 -4
- idf_build_apps-2.5.0rc2/idf_build_apps/args.py +799 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/constants.py +1 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/finder.py +2 -2
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/main.py +49 -16
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/manifest/manifest.py +5 -4
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/utils.py +5 -1
- idf_build_apps-2.5.0rc2/idf_build_apps/vendors/__init__.py +0 -0
- idf_build_apps-2.5.0rc2/idf_build_apps/vendors/pydantic_sources.py +120 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/yaml/parser.py +3 -1
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/pyproject.toml +2 -1
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/setup.py +8 -2
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/tests/conftest.py +5 -1
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/tests/test_app.py +3 -3
- idf_build_apps-2.5.0rc2/tests/test_args.py +125 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/tests/test_build.py +31 -9
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/tests/test_cmd.py +2 -5
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/tests/test_finder.py +6 -9
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/tests/test_manifest.py +28 -31
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/tests/test_utils.py +19 -11
- idf_build_apps-2.5.0rc0/docs/en/references/manifest.md +0 -245
- idf_build_apps-2.5.0rc0/idf_build_apps/args.py +0 -965
- idf_build_apps-2.5.0rc0/idf_build_apps/config.py +0 -108
- idf_build_apps-2.5.0rc0/tests/test_args.py +0 -66
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.editorconfig +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.git-blame-ignore-revs +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.gitattributes +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.github/dependabot.yml +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.github/workflows/check-pre-commit.yml +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.github/workflows/issue_comment.yml +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.github/workflows/new_issues.yml +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.github/workflows/new_prs.yml +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.github/workflows/publish-pypi.yml +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.github/workflows/test-build-docs.yml +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.github/workflows/test-build-idf-apps.yml +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.gitignore +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/.readthedocs.yml +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/CONTRIBUTING.md +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/LICENSE +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/README.md +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/_apidoc_templates/module.rst_t +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/_apidoc_templates/package.rst_t +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/_apidoc_templates/toc.rst_t +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/_static/espressif-logo.svg +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/_static/theme_overrides.css +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/_templates/layout.html +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/en/Makefile +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/en/conf.py +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/en/explanations/build.rst +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/en/explanations/config_rules.rst +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/en/explanations/dependency_driven_build.rst +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/en/explanations/find.rst +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/en/guides/1.x_to_2.x.md +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/en/index.rst +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/en/others/CHANGELOG.md +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/en/others/CONTRIBUTING.md +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/docs/en/references/cli.rst +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/__main__.py +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/autocompletions.py +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/junit/__init__.py +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/junit/report.py +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/junit/utils.py +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/log.py +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/manifest/__init__.py +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/manifest/if_parser.py +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/manifest/soc_header.py +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/session_args.py +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/idf_build_apps/yaml/__init__.py +0 -0
- {idf_build_apps-2.5.0rc0 → idf_build_apps-2.5.0rc2}/license_header.txt +0 -0
|
@@ -15,6 +15,7 @@ repos:
|
|
|
15
15
|
- --license-filepath
|
|
16
16
|
- license_header.txt # defaults to: LICENSE.txt
|
|
17
17
|
- --use-current-year
|
|
18
|
+
exclude: 'idf_build_apps/vendors/'
|
|
18
19
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
|
19
20
|
rev: 'v0.6.2'
|
|
20
21
|
hooks:
|
|
@@ -28,6 +29,7 @@ repos:
|
|
|
28
29
|
args: ['--warn-unused-ignores']
|
|
29
30
|
additional_dependencies:
|
|
30
31
|
- pydantic
|
|
32
|
+
- pydantic-settings
|
|
31
33
|
- packaging
|
|
32
34
|
- toml
|
|
33
35
|
- pyparsing
|
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## v2.5.0rc2 (2024-09-23)
|
|
6
|
+
|
|
7
|
+
### Fix
|
|
8
|
+
|
|
9
|
+
- chdir to tmp_path at the beginning of each test case
|
|
10
|
+
- load config before cli args and func args
|
|
11
|
+
- pickle dump default protocal different in python 3.7
|
|
12
|
+
- keep backward compatibility in build_apps function
|
|
13
|
+
|
|
14
|
+
## v2.5.0rc1 (2024-09-17)
|
|
15
|
+
|
|
16
|
+
### Fix
|
|
17
|
+
|
|
18
|
+
- build_arguments expand @p placeholders
|
|
19
|
+
|
|
20
|
+
### Refactor
|
|
21
|
+
|
|
22
|
+
- rename BuildArguments.ignore_warning_strings to ignore_warning_strs
|
|
23
|
+
|
|
5
24
|
## v2.5.0rc0 (2024-09-10)
|
|
6
25
|
|
|
7
26
|
### Feat
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: idf-build-apps
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.0rc2
|
|
4
4
|
Summary: Tools for building ESP-IDF related apps.
|
|
5
5
|
Author-email: Fu Hanxi <fuhanxi@espressif.com>
|
|
6
6
|
Requires-Python: >=3.7
|
|
@@ -18,6 +18,7 @@ Requires-Dist: pyyaml
|
|
|
18
18
|
Requires-Dist: packaging
|
|
19
19
|
Requires-Dist: toml; python_version < '3.11'
|
|
20
20
|
Requires-Dist: pydantic~=2.0
|
|
21
|
+
Requires-Dist: pydantic_settings
|
|
21
22
|
Requires-Dist: argcomplete>=3
|
|
22
23
|
Requires-Dist: typing-extensions; python_version < '3.11'
|
|
23
24
|
Requires-Dist: sphinx ; extra == "doc"
|
|
@@ -51,7 +51,7 @@ autodoc_default_options = {
|
|
|
51
51
|
'members': True,
|
|
52
52
|
'member-order': 'bysource',
|
|
53
53
|
'show-inheritance': True,
|
|
54
|
-
'exclude-members': 'model_computed_fields,model_config,model_fields',
|
|
54
|
+
'exclude-members': 'model_computed_fields,model_config,model_fields,model_post_init',
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
|
|
@@ -59,7 +59,7 @@ def generate_api_docs(language):
|
|
|
59
59
|
from idf_build_apps.args import (
|
|
60
60
|
BuildArguments,
|
|
61
61
|
FindArguments,
|
|
62
|
-
|
|
62
|
+
add_args_to_obj_doc_as_params,
|
|
63
63
|
)
|
|
64
64
|
from idf_build_apps.main import build_apps, find_apps
|
|
65
65
|
|
|
@@ -69,10 +69,10 @@ def generate_api_docs(language):
|
|
|
69
69
|
shutil.rmtree(api_dir)
|
|
70
70
|
|
|
71
71
|
# --- MOCK DOCSTRINGS By Arguments ---
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
add_args_to_obj_doc_as_params(FindArguments)
|
|
73
|
+
add_args_to_obj_doc_as_params(BuildArguments)
|
|
74
|
+
add_args_to_obj_doc_as_params(FindArguments, find_apps)
|
|
75
|
+
add_args_to_obj_doc_as_params(BuildArguments, build_apps)
|
|
76
76
|
# --- MOCK DOCSTRINGS FINISHED ---
|
|
77
77
|
|
|
78
78
|
subprocess.run(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Configuration File `.
|
|
1
|
+
# Configuration File `.idf_build_apps.toml`
|
|
2
2
|
|
|
3
3
|
There are many CLI options available for `idf-build-apps`. While these options provide usage flexibility, they also make the CLI command too long and difficult to read. However, a configuration file allows defining all these options in a more readable and maintainable way.
|
|
4
4
|
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
#########################################
|
|
2
|
+
Manifest File ``.build-test-rules.yml``
|
|
3
|
+
#########################################
|
|
4
|
+
|
|
5
|
+
A ``.build-test-rules.yml`` file is the manifest file to control whether the app will be built or tested under the rules.
|
|
6
|
+
|
|
7
|
+
One typical manifest file look like this:
|
|
8
|
+
|
|
9
|
+
.. code:: yaml
|
|
10
|
+
|
|
11
|
+
[folder]:
|
|
12
|
+
enable:
|
|
13
|
+
- if: [if clause]
|
|
14
|
+
temporary: true # optional, default to false. `reason` is required if `temporary` is true
|
|
15
|
+
reason: [your reason] # optional
|
|
16
|
+
- ...
|
|
17
|
+
disable:
|
|
18
|
+
- if: [if clause]
|
|
19
|
+
- ...
|
|
20
|
+
disable_test:
|
|
21
|
+
- if: [if clause]
|
|
22
|
+
- ...
|
|
23
|
+
|
|
24
|
+
*******
|
|
25
|
+
Terms
|
|
26
|
+
*******
|
|
27
|
+
|
|
28
|
+
Supported Targets
|
|
29
|
+
=================
|
|
30
|
+
|
|
31
|
+
This refers to the targets that are fully supported by the ESP-IDF project. You may check the supported targets by running ``idf.py --list-targets``.
|
|
32
|
+
|
|
33
|
+
``idf-build-apps`` will get this information dynamically from your ``$IDF_PATH``. For ESP-IDF release 5.3, the supported targets are:
|
|
34
|
+
|
|
35
|
+
- esp32
|
|
36
|
+
- esp32s2
|
|
37
|
+
- esp32c3
|
|
38
|
+
- esp32s3
|
|
39
|
+
- esp32c2
|
|
40
|
+
- esp32c6
|
|
41
|
+
- esp32h2
|
|
42
|
+
- esp32p4
|
|
43
|
+
|
|
44
|
+
Preview Targets
|
|
45
|
+
===============
|
|
46
|
+
|
|
47
|
+
This refers to the targets that are still in preview status. You may check the preview targets by running ``idf.py --list-targets --preview``.
|
|
48
|
+
|
|
49
|
+
``idf-build-apps`` will get this information dynamically from your ``$IDF_PATH``. For ESP-IDF release 5.3, the preview targets are:
|
|
50
|
+
|
|
51
|
+
- linux
|
|
52
|
+
- esp32c5
|
|
53
|
+
- esp32c61
|
|
54
|
+
|
|
55
|
+
****************
|
|
56
|
+
``if`` Clauses
|
|
57
|
+
****************
|
|
58
|
+
|
|
59
|
+
Operands
|
|
60
|
+
========
|
|
61
|
+
|
|
62
|
+
- Capitalized Words
|
|
63
|
+
|
|
64
|
+
- Variables defined in ``IDF_PATH/components/soc/[TARGET]/include/soc/*_caps.h`` or in ``IDF_PATH/components/esp_rom/[TARGET]/*_caps.h``. e.g., ``SOC_WIFI_SUPPORTED``, ``ESP_ROM_HAS_SPI_FLASH``
|
|
65
|
+
- ``IDF_TARGET``
|
|
66
|
+
- ``IDF_VERSION`` (IDF_VERSION_MAJOR.IDF_VERSION_MINOR.IDF_VERSION_PATCH. e.g., 5.2.0. Will convert to Version object to do a version comparison instead of a string comparison)
|
|
67
|
+
- ``IDF_VERSION_MAJOR``
|
|
68
|
+
- ``IDF_VERSION_MINOR``
|
|
69
|
+
- ``IDF_VERSION_PATCH``
|
|
70
|
+
- ``INCLUDE_DEFAULT`` (The default value of supported targets is 1, and the default value of preview targets is 0)
|
|
71
|
+
- ``CONFIG_NAME`` (config name defined in :doc:`../explanations/config_rules`)
|
|
72
|
+
- environment variables, default to ``0`` if not set
|
|
73
|
+
|
|
74
|
+
- String, must be double-quoted. e.g., ``"esp32"``, ``"12345"``
|
|
75
|
+
|
|
76
|
+
- Integer, support decimal and hex. e.g., ``1``, ``0xAB``
|
|
77
|
+
|
|
78
|
+
- List of strings or integers, or both types at the same time. e.g., ``["esp32", 1]``
|
|
79
|
+
|
|
80
|
+
Operators
|
|
81
|
+
=========
|
|
82
|
+
|
|
83
|
+
- ``==``, ``!=``, ``>``, ``>=``, ``<``, ``<=``
|
|
84
|
+
- ``and``, ``or``
|
|
85
|
+
- ``in``, ``not in`` with list
|
|
86
|
+
- parentheses
|
|
87
|
+
|
|
88
|
+
Limitations
|
|
89
|
+
===========
|
|
90
|
+
|
|
91
|
+
All operators are binary operators. For more than two operands, you may use the nested parentheses trick. For example:
|
|
92
|
+
|
|
93
|
+
- ``A == 1 or (B == 2 and C in [1,2,3])``
|
|
94
|
+
- ``(A == 1 and B == 2) or (C not in ["3", "4", 5])``
|
|
95
|
+
|
|
96
|
+
.. warning::
|
|
97
|
+
|
|
98
|
+
Chained ``and`` and ``or`` operators are not supported. The operands start from the third one will be ignored.
|
|
99
|
+
|
|
100
|
+
For example, ``A == 1 and B == 2 and C == 3`` will be interpreted as ``A == 1 and B == 2``.
|
|
101
|
+
|
|
102
|
+
**********************
|
|
103
|
+
Enable/Disable Rules
|
|
104
|
+
**********************
|
|
105
|
+
|
|
106
|
+
By default, we enable build and test for all supported targets. In other words, all preview targets are disabled.
|
|
107
|
+
|
|
108
|
+
To simplify the manifest file, if an app needs to be build and tested on all supported targets, it does not need to be added in a manifest file. The manifest files are files that set the violation rules for apps.
|
|
109
|
+
|
|
110
|
+
Three rules (disable rules are calculated after the enable rules):
|
|
111
|
+
|
|
112
|
+
- ``enable``: run CI build/test jobs for targets that match any of the specified conditions only
|
|
113
|
+
- ``disable``: will not run CI build/test jobs for targets that match any of the specified conditions
|
|
114
|
+
- ``disable_test``: will not run CI test jobs for targets that match any of the specified conditions
|
|
115
|
+
|
|
116
|
+
Each key is a folder. The rule will recursively apply to all apps inside.
|
|
117
|
+
|
|
118
|
+
Overrides Rules
|
|
119
|
+
===============
|
|
120
|
+
|
|
121
|
+
If one sub folder is in a special case, you can overwrite the rules for this folder by adding another entry for this folder itself. Each folder’s rules are standalone, and will not inherit its parent’s rules. (YAML inheritance is too complicated for reading)
|
|
122
|
+
|
|
123
|
+
For example, in the following code block, only ``disable`` rule exists in ``examples/foo/bar``. It’s unaware of its parent’s ``enable`` rule.
|
|
124
|
+
|
|
125
|
+
.. code:: yaml
|
|
126
|
+
|
|
127
|
+
examples/foo:
|
|
128
|
+
enable:
|
|
129
|
+
- if: IDF_TARGET == "esp32"
|
|
130
|
+
|
|
131
|
+
examples/foo/bar:
|
|
132
|
+
disable:
|
|
133
|
+
- if: IDF_TARGET == "esp32s2"
|
|
134
|
+
|
|
135
|
+
*******************
|
|
136
|
+
Practical Example
|
|
137
|
+
*******************
|
|
138
|
+
|
|
139
|
+
Here’s a practical example:
|
|
140
|
+
|
|
141
|
+
.. code:: yaml
|
|
142
|
+
|
|
143
|
+
examples/foo:
|
|
144
|
+
enable:
|
|
145
|
+
- if IDF_TARGET in ["esp32", 1, 2, 3]
|
|
146
|
+
- if IDF_TARGET not in ["4", "5", 6]
|
|
147
|
+
# should be run under all targets!
|
|
148
|
+
|
|
149
|
+
examples/bluetooth:
|
|
150
|
+
disable: # disable both build and tests jobs
|
|
151
|
+
- if: SOC_BT_SUPPORTED != 1
|
|
152
|
+
# reason is optional if there's no `temporary: true`
|
|
153
|
+
disable_test:
|
|
154
|
+
- if: IDF_TARGET == "esp32"
|
|
155
|
+
temporary: true
|
|
156
|
+
reason: lack of ci runners # required when `temporary: true`
|
|
157
|
+
|
|
158
|
+
examples/bluetooth/test_foo:
|
|
159
|
+
# each folder's settings are standalone
|
|
160
|
+
disable:
|
|
161
|
+
- if: IDF_TARGET == "esp32s2"
|
|
162
|
+
temporary: true
|
|
163
|
+
reason: no idea
|
|
164
|
+
# unlike examples/bluetooth, the apps under this folder would not be build nor test for "no idea" under target esp32s2
|
|
165
|
+
|
|
166
|
+
examples/get-started/hello_world:
|
|
167
|
+
enable:
|
|
168
|
+
- if: IDF_TARGET == "linux"
|
|
169
|
+
reason: this one only supports linux!
|
|
170
|
+
|
|
171
|
+
examples/get-started/blink:
|
|
172
|
+
enable:
|
|
173
|
+
- if: INCLUDE_DEFAULT == 1 or IDF_TARGET == "linux"
|
|
174
|
+
reason: This one supports all supported targets and linux
|
|
175
|
+
|
|
176
|
+
**********************
|
|
177
|
+
Enhanced YAML Syntax
|
|
178
|
+
**********************
|
|
179
|
+
|
|
180
|
+
Switch-Like Clauses
|
|
181
|
+
===================
|
|
182
|
+
|
|
183
|
+
The Switch-Like clauses are supported by two keywords in the YAML file: ``depends_components`` and ``depends_filepatterns``.
|
|
184
|
+
|
|
185
|
+
Operands
|
|
186
|
+
--------
|
|
187
|
+
|
|
188
|
+
Switch cases have two main components: the ``if`` clause and the ``default`` clause. Just like a switch statement in c language, The first matched ``if`` clause will be applied. If no ``if`` clause matched, the ``default`` clause will be applied. Here’s an example:
|
|
189
|
+
|
|
190
|
+
.. code:: yaml
|
|
191
|
+
|
|
192
|
+
test1:
|
|
193
|
+
depends_components:
|
|
194
|
+
- if: IDF_VERSION == "{IDF_VERSION}"
|
|
195
|
+
content: [ "component_1" ]
|
|
196
|
+
- if: CONFIG_NAME == "AWESOME_CONFIG"
|
|
197
|
+
content: [ "component_2" ]
|
|
198
|
+
- default: [ "component_3", "component_4" ]
|
|
199
|
+
|
|
200
|
+
``default`` clause is optional. If you don’t specify any ``default`` clause, it will return an empty array.
|
|
201
|
+
|
|
202
|
+
Limitations
|
|
203
|
+
-----------
|
|
204
|
+
|
|
205
|
+
You cannot combine a list and a switch in one node.
|
|
206
|
+
|
|
207
|
+
Reuse Lists
|
|
208
|
+
===========
|
|
209
|
+
|
|
210
|
+
To reuse the items defined in a list, you can use the ``+`` and ``-`` postfixes respectively. The order of calculation is always ``+`` first, followed by ``-``.
|
|
211
|
+
|
|
212
|
+
Array Elements as Strings
|
|
213
|
+
-------------------------
|
|
214
|
+
|
|
215
|
+
The following YAML code demonstrates how to reuse the elements from a list of strings:
|
|
216
|
+
|
|
217
|
+
.. code:: yaml
|
|
218
|
+
|
|
219
|
+
.base_depends_components: &base-depends-components
|
|
220
|
+
depends_components:
|
|
221
|
+
- esp_hw_support
|
|
222
|
+
- esp_rom
|
|
223
|
+
- esp_wifi
|
|
224
|
+
|
|
225
|
+
examples/wifi/coexist:
|
|
226
|
+
<<: *base-depends-components
|
|
227
|
+
depends_components+:
|
|
228
|
+
- esp_coex
|
|
229
|
+
depends_components-:
|
|
230
|
+
- esp_rom
|
|
231
|
+
|
|
232
|
+
After interpretation, the resulting YAML will be:
|
|
233
|
+
|
|
234
|
+
.. code:: yaml
|
|
235
|
+
|
|
236
|
+
examples/wifi/coexist:
|
|
237
|
+
depends_components:
|
|
238
|
+
- esp_hw_support
|
|
239
|
+
- esp_wifi
|
|
240
|
+
- esp_coex
|
|
241
|
+
|
|
242
|
+
This means that the ``esp_rom`` element is removed, and the ``esp_coex`` element is added to the ``depends_components`` list.
|
|
243
|
+
|
|
244
|
+
Array Elements as Dictionaries
|
|
245
|
+
------------------------------
|
|
246
|
+
|
|
247
|
+
In addition to reuse elements from a list of strings, you can also perform these operations on a list of dictionaries. The matching is done based on the ``if`` key. Here’s an example:
|
|
248
|
+
|
|
249
|
+
.. code:: yaml
|
|
250
|
+
|
|
251
|
+
.base: &base
|
|
252
|
+
enable:
|
|
253
|
+
- if: IDF_VERSION == "5.2.0"
|
|
254
|
+
- if: IDF_VERSION == "5.3.0"
|
|
255
|
+
|
|
256
|
+
foo:
|
|
257
|
+
<<: *base
|
|
258
|
+
enable+:
|
|
259
|
+
# this if statement dictionary will override the one defined in `&base`
|
|
260
|
+
- if: IDF_VERSION == "5.2.0"
|
|
261
|
+
temp: true
|
|
262
|
+
- if: IDF_VERSION == "5.4.0"
|
|
263
|
+
reason: bar
|
|
264
|
+
|
|
265
|
+
After interpretation, the resulting YAML will be:
|
|
266
|
+
|
|
267
|
+
.. code:: yaml
|
|
268
|
+
|
|
269
|
+
foo:
|
|
270
|
+
enable:
|
|
271
|
+
- if: IDF_VERSION == "5.3.0"
|
|
272
|
+
- if: IDF_VERSION == "5.2.0"
|
|
273
|
+
temp: true
|
|
274
|
+
- if: IDF_VERSION == "5.4.0"
|
|
275
|
+
reason: bar
|
|
276
|
+
|
|
277
|
+
In this case, the ``enable`` list is extended with the new ``if`` statement and ``reason`` dictionary.
|
|
278
|
+
|
|
279
|
+
It’s important to note that the ``if`` dictionary defined in the ``+`` postfix will override the earlier one when the ``if`` statement matches.
|
|
280
|
+
|
|
281
|
+
This demonstrates how you can use the ``+`` and ``-`` postfixes to extend and remove elements from both string and dictionary lists in our YAML.
|
|
@@ -74,7 +74,6 @@ class App(BaseModel):
|
|
|
74
74
|
NAME_PLACEHOLDER: t.ClassVar[str] = '@n' # replace it with self.name
|
|
75
75
|
FULL_NAME_PLACEHOLDER: t.ClassVar[str] = '@f' # replace it with escaped self.app_dir
|
|
76
76
|
IDF_VERSION_PLACEHOLDER: t.ClassVar[str] = '@v' # replace it with the IDF version
|
|
77
|
-
PARALLEL_INDEX_PLACEHOLDER: t.ClassVar[str] = '@p' # replace it with the parallel index
|
|
78
77
|
INDEX_PLACEHOLDER: t.ClassVar[str] = '@i' # replace it with the build index (while build_apps)
|
|
79
78
|
|
|
80
79
|
SDKCONFIG_LINE_REGEX: t.ClassVar[t.Pattern] = re.compile(r'^([^=]+)=\"?([^\"\n]*)\"?\n*$')
|
|
@@ -115,7 +114,6 @@ class App(BaseModel):
|
|
|
115
114
|
copy_sdkconfig: bool = False
|
|
116
115
|
|
|
117
116
|
# build_apps() related
|
|
118
|
-
parallel_index: t.Optional[int] = None # used for expand
|
|
119
117
|
index: t.Optional[int] = None
|
|
120
118
|
|
|
121
119
|
# build status related
|
|
@@ -244,8 +242,6 @@ class App(BaseModel):
|
|
|
244
242
|
|
|
245
243
|
if self.index is not None:
|
|
246
244
|
path = path.replace(self.INDEX_PLACEHOLDER, str(self.index))
|
|
247
|
-
if self.parallel_index:
|
|
248
|
-
path = path.replace(self.PARALLEL_INDEX_PLACEHOLDER, str(self.parallel_index))
|
|
249
245
|
path = path.replace(
|
|
250
246
|
self.IDF_VERSION_PLACEHOLDER, f'{IDF_VERSION_MAJOR}_{IDF_VERSION_MINOR}_{IDF_VERSION_PATCH}'
|
|
251
247
|
)
|