idf-build-apps 2.4.3__tar.gz → 2.5.0rc1__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.
Files changed (80) hide show
  1. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.github/workflows/check-pre-commit.yml +1 -1
  2. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.github/workflows/test-build-docs.yml +2 -1
  3. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.github/workflows/test-build-idf-apps.yml +3 -3
  4. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.gitignore +2 -2
  5. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.pre-commit-config.yaml +13 -5
  6. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.readthedocs.yml +0 -3
  7. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/CHANGELOG.md +30 -1
  8. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/CONTRIBUTING.md +2 -1
  9. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/PKG-INFO +3 -4
  10. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/README.md +1 -1
  11. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/docs/_static/theme_overrides.css +4 -0
  12. idf_build_apps-2.5.0rc1/docs/conf_common.py +91 -0
  13. idf_build_apps-2.5.0rc1/docs/en/conf.py +13 -0
  14. idf_build_apps-2.5.0rc1/docs/en/explanations/build.rst +90 -0
  15. idf_build_apps-2.5.0rc1/docs/en/explanations/config_rules.rst +203 -0
  16. idf_build_apps-2.5.0rc1/docs/en/explanations/dependency_driven_build.rst +116 -0
  17. idf_build_apps-2.5.0rc1/docs/en/explanations/find.rst +159 -0
  18. idf_build_apps-2.5.0rc1/docs/en/index.rst +36 -0
  19. idf_build_apps-2.5.0rc1/docs/en/others/CHANGELOG.md +2 -0
  20. idf_build_apps-2.5.0rc1/docs/en/others/CONTRIBUTING.md +2 -0
  21. idf_build_apps-2.5.0rc1/docs/en/references/cli.rst +11 -0
  22. {idf_build_apps-2.4.3/docs → idf_build_apps-2.5.0rc1/docs/en/references}/config_file.md +1 -1
  23. idf_build_apps-2.5.0rc1/docs/en/references/manifest.rst +281 -0
  24. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/__init__.py +1 -1
  25. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/app.py +31 -27
  26. idf_build_apps-2.5.0rc1/idf_build_apps/args.py +1022 -0
  27. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/config.py +19 -2
  28. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/constants.py +17 -28
  29. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/finder.py +34 -54
  30. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/log.py +2 -0
  31. idf_build_apps-2.5.0rc1/idf_build_apps/main.py +436 -0
  32. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/manifest/manifest.py +112 -24
  33. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/utils.py +22 -0
  34. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/pyproject.toml +4 -7
  35. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/setup.py +2 -3
  36. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/tests/conftest.py +15 -1
  37. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/tests/test_app.py +1 -10
  38. idf_build_apps-2.5.0rc1/tests/test_args.py +82 -0
  39. idf_build_apps-2.5.0rc1/tests/test_cmd.py +73 -0
  40. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/tests/test_finder.py +53 -10
  41. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/tests/test_manifest.py +78 -43
  42. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/tests/test_utils.py +15 -1
  43. idf_build_apps-2.4.3/docs/CHANGELOG.md +0 -2
  44. idf_build_apps-2.4.3/docs/CONTRIBUTING.md +0 -2
  45. idf_build_apps-2.4.3/docs/cli.rst +0 -6
  46. idf_build_apps-2.4.3/docs/conf.py +0 -68
  47. idf_build_apps-2.4.3/docs/find_build.md +0 -349
  48. idf_build_apps-2.4.3/docs/index.rst +0 -22
  49. idf_build_apps-2.4.3/docs/manifest.md +0 -305
  50. idf_build_apps-2.4.3/idf_build_apps/build_apps_args.py +0 -64
  51. idf_build_apps-2.4.3/idf_build_apps/main.py +0 -949
  52. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.editorconfig +0 -0
  53. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.git-blame-ignore-revs +0 -0
  54. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.gitattributes +0 -0
  55. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.github/dependabot.yml +0 -0
  56. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.github/workflows/issue_comment.yml +0 -0
  57. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.github/workflows/new_issues.yml +0 -0
  58. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.github/workflows/new_prs.yml +0 -0
  59. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/.github/workflows/publish-pypi.yml +0 -0
  60. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/LICENSE +0 -0
  61. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/docs/_apidoc_templates/module.rst_t +0 -0
  62. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/docs/_apidoc_templates/package.rst_t +0 -0
  63. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/docs/_apidoc_templates/toc.rst_t +0 -0
  64. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/docs/_static/espressif-logo.svg +0 -0
  65. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/docs/_templates/layout.html +0 -0
  66. {idf_build_apps-2.4.3/docs → idf_build_apps-2.5.0rc1/docs/en}/Makefile +0 -0
  67. {idf_build_apps-2.4.3/docs/migration → idf_build_apps-2.5.0rc1/docs/en/guides}/1.x_to_2.x.md +0 -0
  68. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/__main__.py +0 -0
  69. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/autocompletions.py +0 -0
  70. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/junit/__init__.py +0 -0
  71. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/junit/report.py +0 -0
  72. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/junit/utils.py +0 -0
  73. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/manifest/__init__.py +0 -0
  74. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/manifest/if_parser.py +0 -0
  75. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/manifest/soc_header.py +0 -0
  76. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/session_args.py +0 -0
  77. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/yaml/__init__.py +0 -0
  78. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/idf_build_apps/yaml/parser.py +0 -0
  79. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/license_header.txt +0 -0
  80. {idf_build_apps-2.4.3 → idf_build_apps-2.5.0rc1}/tests/test_build.py +0 -0
@@ -12,7 +12,7 @@ jobs:
12
12
  fetch-depth: 0
13
13
  - uses: actions/setup-python@v5
14
14
  - id: changed-files
15
- uses: tj-actions/changed-files@v44
15
+ uses: tj-actions/changed-files@v45
16
16
  - uses: pre-commit/action@v3.0.1
17
17
  with:
18
18
  extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}
@@ -19,6 +19,7 @@ jobs:
19
19
  flit install -s
20
20
  - name: Build the docs
21
21
  run: |
22
- cd docs && make html
22
+ cd docs
23
+ pushd en && make html && popd
23
24
  - name: markdown-link-check
24
25
  uses: gaurav-nelson/github-action-markdown-link-check@1.0.15
@@ -34,11 +34,11 @@ jobs:
34
34
  path: dist/idf_build_apps-*.whl
35
35
 
36
36
  build-apps-on-idf-env:
37
- if: ${{ github.ref == 'refs/heads/main' }}
37
+ if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'test-old-idf-releases') }}
38
38
  needs: build-python-packages
39
39
  strategy:
40
40
  matrix:
41
- idf-branch: [ release-v5.0, release-v5.1, release-v5.2 ]
41
+ idf-branch: [ release-v5.0, release-v5.1, release-v5.2, release-v5.3 ]
42
42
  runs-on: ubuntu-latest
43
43
  container:
44
44
  image: espressif/idf:${{ matrix.idf-branch }}
@@ -53,7 +53,7 @@ jobs:
53
53
  . $IDF_PATH/export.sh
54
54
  pip install idf_build_apps-*.whl
55
55
  cd $IDF_PATH/examples/get-started/hello_world
56
- cat 'CONFIG_IDF_TARGET="esp32"' >sdkconfig.defaults
56
+ echo 'CONFIG_IDF_TARGET="esp32"' >sdkconfig.defaults
57
57
  idf-build-apps build --build-dir build_@t --size-file size_info.json
58
58
  test -f build_esp32/hello_world.bin
59
59
  test -f build_esp32/size_info.json
@@ -69,8 +69,8 @@ instance/
69
69
  .scrapy
70
70
 
71
71
  # Sphinx documentation
72
- docs/_build/
73
- docs/api/
72
+ docs/*/_build/
73
+ docs/en/references/api/
74
74
 
75
75
  # PyBuilder
76
76
  .pybuilder/
@@ -16,23 +16,31 @@ repos:
16
16
  - license_header.txt # defaults to: LICENSE.txt
17
17
  - --use-current-year
18
18
  - repo: https://github.com/charliermarsh/ruff-pre-commit
19
- rev: 'v0.5.5'
19
+ rev: 'v0.6.2'
20
20
  hooks:
21
21
  - id: ruff
22
22
  args: ['--fix']
23
23
  - id: ruff-format
24
24
  - repo: https://github.com/pre-commit/mirrors-mypy
25
- rev: 'v1.8.0' # 1.9 doesn't support python 3.7
25
+ rev: 'v1.11.2'
26
26
  hooks:
27
27
  - id: mypy
28
28
  args: ['--warn-unused-ignores']
29
29
  additional_dependencies:
30
- - pydantic<2.6 # 2.6 does not support python 3.7
30
+ - pydantic
31
31
  - packaging
32
32
  - toml
33
33
  - pyparsing
34
34
  - types-PyYAML
35
35
  - types-toml
36
- - pytest<8 # 8.0.0 does not support python 3.7
36
+ - pytest
37
37
  - argcomplete>=3
38
- - annotated_types<0.7.0 # 0.7.0 does not support python 3.7
38
+ - repo: https://github.com/hfudev/rstfmt
39
+ rev: v0.1.4
40
+ hooks:
41
+ - id: rstfmt
42
+ args: ['-w', '-1']
43
+ files: "docs\/.+rst$"
44
+ additional_dependencies:
45
+ - sphinx-argparse
46
+ - sphinxcontrib-mermaid
@@ -9,9 +9,6 @@ build:
9
9
  tools:
10
10
  python: "3.7"
11
11
 
12
- sphinx:
13
- configuration: docs/conf.py
14
-
15
12
  python:
16
13
  install:
17
14
  - method: pip
@@ -2,6 +2,35 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## v2.5.0rc1 (2024-09-17)
6
+
7
+ ### Fix
8
+
9
+ - build_arguments expand @p placeholders
10
+
11
+ ### Refactor
12
+
13
+ - rename BuildArguments.ignore_warning_strings to ignore_warning_strs
14
+
15
+ ## v2.5.0rc0 (2024-09-10)
16
+
17
+ ### Feat
18
+
19
+ - support `idf-build-apps find` with checking modified manfiest files
20
+ - support `idf-build-apps dump-manifest-sha`
21
+
22
+ ### Fix
23
+
24
+ - loose env var requirements. IDF_PATH not required
25
+ - stop print build log as error when build with warning-as-error
26
+ - requires typing-extensions below 3.11
27
+ - temp build log got wrongly created/deleted
28
+
29
+ ### Refactor
30
+
31
+ - declare argument once. used in both function, cli, and docs
32
+ - move Manifest.ROOTPATH to params
33
+
5
34
  ## v2.4.3 (2024-08-07)
6
35
 
7
36
  ### Feat
@@ -134,7 +163,7 @@ All notable changes to this project will be documented in this file.
134
163
 
135
164
  ### BREAKING CHANGES
136
165
 
137
- 2.x introduces a lot of breaking changes. For a detailed migration guide, please refer to our [Migration From 1.x to 2.x Guide](https://github.com/espressif/idf-build-apps/blob/main/docs/migration/1.x_to_2.x.md)
166
+ 2.x introduces a lot of breaking changes. For a detailed migration guide, please refer to our [Migration From 1.x to 2.x Guide](https://docs.espressif.com/projects/idf-build-apps/en/latest/guides/1.x_to_2.x.html)
138
167
 
139
168
  Here are the breaking changes:
140
169
 
@@ -15,7 +15,8 @@ Here's a table shows the supported ESP-IDF versions and the corresponding Python
15
15
  | 5.0 | 3.7+ | main (2.x) |
16
16
  | 5.1 | 3.7+ | main (2.x) |
17
17
  | 5.2 | 3.7+ | main (2.x) |
18
- | master (5.3) | 3.8+ | main (2.x) |
18
+ | 5.3 | 3.8+ | main (2.x) |
19
+ | master (5.4) | 3.8+ | main (2.x) |
19
20
 
20
21
  `idf-build-apps` is following the semantic versioning. The major version of `idf-build-apps` is the same as the ESP-IDF version it supports. For example, `idf-build-apps` 1.x supports ESP-IDF 4.x, and `idf-build-apps` 2.x supports ESP-IDF 5.x.
21
22
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: idf-build-apps
3
- Version: 2.4.3
3
+ Version: 2.5.0rc1
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
@@ -19,7 +19,7 @@ Requires-Dist: packaging
19
19
  Requires-Dist: toml; python_version < '3.11'
20
20
  Requires-Dist: pydantic~=2.0
21
21
  Requires-Dist: argcomplete>=3
22
- Requires-Dist: typing-extensions ; extra == "dev" and ( python_version < '3.8')
22
+ Requires-Dist: typing-extensions; python_version < '3.11'
23
23
  Requires-Dist: sphinx ; extra == "doc"
24
24
  Requires-Dist: sphinx-rtd-theme ; extra == "doc"
25
25
  Requires-Dist: sphinx_copybutton ; extra == "doc"
@@ -32,7 +32,6 @@ Project-URL: changelog, https://github.com/espressif/idf-build-apps/blob/master/
32
32
  Project-URL: documentation, https://docs.espressif.com/projects/idf-build-apps
33
33
  Project-URL: homepage, https://github.com/espressif/idf-build-apps
34
34
  Project-URL: repository, https://github.com/espressif/idf-build-apps
35
- Provides-Extra: dev
36
35
  Provides-Extra: doc
37
36
  Provides-Extra: test
38
37
 
@@ -113,5 +112,5 @@ Thanks for your contribution! Please refer to our [Contributing Guide](CONTRIBUT
113
112
  [hello-world]: https://github.com/espressif/esp-idf/tree/master/examples/get-started/hello_world
114
113
  [supported-targets]: https://github.com/espressif/esp-idf/tree/v5.0#esp-idf-release-and-soc-compatibility
115
114
  [doc]: https://docs.espressif.com/projects/idf-build-apps/en/latest/
116
- [api-doc]: https://docs.espressif.com/projects/idf-build-apps/en/latest/api/modules.html
115
+ [api-doc]: https://docs.espressif.com/projects/idf-build-apps/en/latest/references/api/modules.html
117
116
 
@@ -75,4 +75,4 @@ Thanks for your contribution! Please refer to our [Contributing Guide](CONTRIBUT
75
75
  [hello-world]: https://github.com/espressif/esp-idf/tree/master/examples/get-started/hello_world
76
76
  [supported-targets]: https://github.com/espressif/esp-idf/tree/v5.0#esp-idf-release-and-soc-compatibility
77
77
  [doc]: https://docs.espressif.com/projects/idf-build-apps/en/latest/
78
- [api-doc]: https://docs.espressif.com/projects/idf-build-apps/en/latest/api/modules.html
78
+ [api-doc]: https://docs.espressif.com/projects/idf-build-apps/en/latest/references/api/modules.html
@@ -49,3 +49,7 @@
49
49
  font-weight: bold;
50
50
  font-style: italic;
51
51
  }
52
+
53
+ pre {
54
+ white-space: pre-wrap !important;
55
+ }
@@ -0,0 +1,91 @@
1
+ # SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ import os
5
+ import shutil
6
+ import subprocess
7
+
8
+ # Configuration file for the Sphinx documentation builder.
9
+ #
10
+ # For the full list of built-in configuration values, see the documentation:
11
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
12
+ from datetime import datetime
13
+
14
+ # -- Project information -----------------------------------------------------
15
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
16
+
17
+ project = 'idf-build-apps'
18
+ project_homepage = 'https://github.com/espressif/idf-build-apps'
19
+ copyright = f'2023-{datetime.now().year}, Espressif Systems (Shanghai) Co., Ltd.' # noqa: A001
20
+ author = 'Fu Hanxi'
21
+ languages = ['en']
22
+ version = '2.x'
23
+
24
+ # -- General configuration ---------------------------------------------------
25
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
26
+
27
+ extensions = [
28
+ 'sphinx.ext.autodoc',
29
+ 'sphinx_copybutton',
30
+ 'myst_parser',
31
+ 'sphinxcontrib.mermaid',
32
+ 'sphinxarg.ext',
33
+ ]
34
+
35
+ templates_path = ['_templates']
36
+ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
37
+
38
+ # -- Options for HTML output -------------------------------------------------
39
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
40
+
41
+ html_css_files = ['theme_overrides.css']
42
+ html_logo = '../_static/espressif-logo.svg'
43
+ html_static_path = ['../_static']
44
+ html_theme = 'sphinx_rtd_theme'
45
+
46
+ # mermaid 10.2.0 will show syntax error
47
+ # use fixed version instead
48
+ mermaid_version = '10.6.1'
49
+
50
+ autodoc_default_options = {
51
+ 'members': True,
52
+ 'member-order': 'bysource',
53
+ 'show-inheritance': True,
54
+ 'exclude-members': 'model_computed_fields,model_config,model_fields',
55
+ }
56
+
57
+
58
+ def generate_api_docs(language):
59
+ from idf_build_apps.args import (
60
+ BuildArguments,
61
+ FindArguments,
62
+ add_arguments_to_obj_doc_as_params,
63
+ )
64
+ from idf_build_apps.main import build_apps, find_apps
65
+
66
+ docs_dir = os.path.dirname(__file__)
67
+ api_dir = os.path.join(docs_dir, language, 'references', 'api')
68
+ if os.path.isdir(api_dir):
69
+ shutil.rmtree(api_dir)
70
+
71
+ # --- MOCK DOCSTRINGS By Arguments ---
72
+ add_arguments_to_obj_doc_as_params(FindArguments)
73
+ add_arguments_to_obj_doc_as_params(BuildArguments)
74
+ add_arguments_to_obj_doc_as_params(FindArguments, find_apps)
75
+ add_arguments_to_obj_doc_as_params(BuildArguments, build_apps)
76
+ # --- MOCK DOCSTRINGS FINISHED ---
77
+
78
+ subprocess.run(
79
+ [
80
+ 'sphinx-apidoc',
81
+ os.path.join(docs_dir, '..', 'idf_build_apps'),
82
+ '-f',
83
+ '-H',
84
+ 'API Reference',
85
+ '--no-headings',
86
+ '-t',
87
+ '_apidoc_templates',
88
+ '-o',
89
+ api_dir,
90
+ ]
91
+ )
@@ -0,0 +1,13 @@
1
+ # SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ import os
5
+ import sys
6
+
7
+ language = 'en'
8
+
9
+ sys.path.insert(0, os.path.abspath('../'))
10
+
11
+ from conf_common import * # noqa
12
+
13
+ generate_api_docs(language) # noqa
@@ -0,0 +1,90 @@
1
+ ###############
2
+ Build Command
3
+ ###############
4
+
5
+ .. note::
6
+
7
+ If you are unfamiliar with the the find command yet, please read the :doc:`find` first.
8
+
9
+ This page explains the process of build apps, and how to use the ``idf-build-apps build`` command to build apps in the projects.
10
+
11
+ .. note::
12
+
13
+ For detailed list of arguments, please refer to the :class:`~idf_build_apps.args.FindArguments` reference.
14
+
15
+ *************************
16
+ Basic ``build`` Command
17
+ *************************
18
+
19
+ .. code:: shell
20
+
21
+ idf-build-apps build
22
+
23
+ *****************************
24
+ ``build`` With Placeholders
25
+ *****************************
26
+
27
+ Besides of the :ref:`placeholders supported in find command <find-placeholders>`, the build command also supports the following placeholders:
28
+
29
+ - ``@i``: Would be replaced by the build index.
30
+ - ``@p``: Would be replaced by the parallel build index.
31
+
32
+ *******************************
33
+ ``build`` With Warnings Check
34
+ *******************************
35
+
36
+ You may use `--check-warnings` to enable this check. If any warning is captured while the building process, the exit code would turn to a non-zero value. Besides, `idf-build-apps` provides CLI options `--ignore-warnings-str` and `--ignore-warnings-file` to let you bypass some false alarms.
37
+
38
+ ***************************
39
+ ``build`` With Debug Mode
40
+ ***************************
41
+
42
+ It's useful to call `--dry-run` with verbose mode `-vv` to know the whole build process in detail before the build actually happens. For example:
43
+
44
+ .. code:: shell
45
+
46
+ idf-build-apps build -p . --recursive --target esp32 --dry-run -vv --config "sdkconfig.ci.*="
47
+
48
+ The output would be:
49
+
50
+ .. code:: text
51
+
52
+ 2024-08-12 15:48:01 DEBUG Looking for CMakeApp apps in . recursively with target esp32
53
+ 2024-08-12 15:48:01 DEBUG Entering .
54
+ 2024-08-12 15:48:01 DEBUG Skipping. . is not an app
55
+ 2024-08-12 15:48:01 DEBUG Entering ./test-1
56
+ 2024-08-12 15:48:01 DEBUG sdkconfig file sdkconfig.defaults not found, checking under app_dir...
57
+ 2024-08-12 15:48:01 DEBUG Use sdkconfig file ./test-1/sdkconfig.defaults
58
+ 2024-08-12 15:48:01 DEBUG Use sdkconfig file /tmp/test/examples/test-1/sdkconfig.ci.bar
59
+ 2024-08-12 15:48:01 DEBUG Found app: (cmake) App ./test-1, target esp32, sdkconfig /tmp/test/examples/test-1/sdkconfig.ci.bar, build in ./test-1/build
60
+ 2024-08-12 15:48:01 DEBUG
61
+ 2024-08-12 15:48:01 DEBUG sdkconfig file sdkconfig.defaults not found, checking under app_dir...
62
+ 2024-08-12 15:48:01 DEBUG Use sdkconfig file ./test-1/sdkconfig.defaults
63
+ 2024-08-12 15:48:01 DEBUG Use sdkconfig file /tmp/test/examples/test-1/sdkconfig.ci.foo
64
+ 2024-08-12 15:48:01 DEBUG Found app: (cmake) App ./test-1, target esp32, sdkconfig /tmp/test/examples/test-1/sdkconfig.ci.foo, build in ./test-1/build
65
+ 2024-08-12 15:48:01 DEBUG
66
+ 2024-08-12 15:48:01 DEBUG => Stop iteration sub dirs of ./test-1 since it has apps
67
+ 2024-08-12 15:48:01 DEBUG Entering ./test-2
68
+ 2024-08-12 15:48:01 DEBUG sdkconfig file sdkconfig.defaults not found, checking under app_dir...
69
+ 2024-08-12 15:48:01 DEBUG sdkconfig file ./test-2/sdkconfig.defaults not found, skipping...
70
+ 2024-08-12 15:48:01 DEBUG Found app: (cmake) App ./test-2, target esp32, sdkconfig (default), build in ./test-2/build
71
+ 2024-08-12 15:48:01 DEBUG
72
+ 2024-08-12 15:48:01 DEBUG => Stop iteration sub dirs of ./test-2 since it has apps
73
+ 2024-08-12 15:48:01 INFO Found 3 apps in total
74
+ 2024-08-12 15:48:01 INFO Total 3 apps. running build for app 1-3
75
+ 2024-08-12 15:48:01 INFO (1/3) Building app: (cmake) App ./test-1, target esp32, sdkconfig /tmp/test/examples/test-1/sdkconfig.ci.bar, build in ./test-1/build
76
+ 2024-08-12 15:48:01 INFO [ Dry Run] Writing build log to ./test-1/build/.temp.build.-4727026790408965348.log
77
+ 2024-08-12 15:48:01 INFO skipped (dry run)
78
+ 2024-08-12 15:48:01 INFO
79
+ 2024-08-12 15:48:01 INFO (2/3) Building app: (cmake) App ./test-1, target esp32, sdkconfig /tmp/test/examples/test-1/sdkconfig.ci.foo, build in ./test-1/build
80
+ 2024-08-12 15:48:01 INFO [ Dry Run] Writing build log to ./test-1/build/.temp.build.4508471977171905517.log
81
+ 2024-08-12 15:48:01 INFO skipped (dry run)
82
+ 2024-08-12 15:48:01 INFO
83
+ 2024-08-12 15:48:01 INFO (3/3) Building app: (cmake) App ./test-2, target esp32, sdkconfig (default), build in ./test-2/build
84
+ 2024-08-12 15:48:01 INFO [ Dry Run] Writing build log to ./test-2/build/.temp.build.4188038822526638365.log
85
+ 2024-08-12 15:48:01 INFO skipped (dry run)
86
+ 2024-08-12 15:48:01 INFO
87
+ Skipped building the following apps:
88
+ (cmake) App ./test-1, target esp32, sdkconfig /tmp/test/examples/test-1/sdkconfig.ci.bar, build in ./test-1/build, skipped in 0.000635s: dry run
89
+ (cmake) App ./test-1, target esp32, sdkconfig /tmp/test/examples/test-1/sdkconfig.ci.foo, build in ./test-1/build, skipped in 0.000309s: dry run
90
+ (cmake) App ./test-2, target esp32, sdkconfig (default), build in ./test-2/build, skipped in 0.000265s: dry run
@@ -0,0 +1,203 @@
1
+ ##########################
2
+ Sdkconfig & Config Rules
3
+ ##########################
4
+
5
+ This page explains the concept of `Sdkconfig Files`_ and `Config Rules`_. All examples are based on the following demo project, with the folder structure:
6
+
7
+ .. code:: text
8
+
9
+ test-1/
10
+ ├── CMakeLists.txt
11
+ ├── main/
12
+ │ ├── CMakeLists.txt
13
+ │ └── test-1.c
14
+ ├── sdkconfig.ci.bar
15
+ ├── sdkconfig.ci.foo
16
+ ├── sdkconfig.ci.foo.esp32
17
+ ├── sdkconfig.defaults
18
+ └── sdkconfig.defaults.esp32
19
+
20
+ *****************
21
+ Sdkconfig Files
22
+ *****************
23
+
24
+ In general, `sdkconfig files`_ are text files that contains the Kconfig items in the form of ``key=value`` pairs.
25
+
26
+ Specifically, in ESP-IDF, the ``sdkconfig`` file is the file that contains all the Kconfig items used by the ESP-IDF build system to configure the build process. The ``sdkconfig`` file is generated by the ESP-IDF build system based on the default Kconfig settings, and the `pre-set configurations`_ values.
27
+
28
+ Pre-set Configurations
29
+ ======================
30
+
31
+ `Pre-set configurations`_ are the Kconfig items that are set in `sdkconfig files`_ before the real build process starts.
32
+
33
+ By default, ESP-IDF uses the ``sdkconfig.defaults`` file to set the pre-set configurations.
34
+
35
+ In ESP-IDF, the target-specific sdkconfig files are used to override the pre-set configurations, when building the project for a specific target. Target-specific sdkconfig files are always endswith the target name. For example, when building the project for the ESP32 target, the ESP-IDF build system will consider the `sdkconfig files`_ with the ``.esp32`` suffix. The values in these target-specific sdkconfig files will override the pre-set values in the ``sdkconfig.defaults`` file. The `override order`_ is explained in more detail in a later section.
36
+
37
+ .. _config-rules:
38
+
39
+ **************
40
+ Config Rules
41
+ **************
42
+
43
+ In most common CI workflows, the project is built with different configurations. Different combinations of configuration options are tested to ensure the project's robustness.
44
+
45
+ The `idf-build-apps` tool uses the concept of `config rules`_ to define the way how the project is built with different pre-set configurations. Each matched `sdkconfig file <#sdkconfig-files>`_ will be built into a separate application, which can be used for testing individually at a later stage.
46
+
47
+ Definition
48
+ ==========
49
+
50
+ To define a Config Rule, use the following format: ``[SDKCONFIG_FILEPATTERN]=[CONFIG_NAME]``.
51
+
52
+ - ``SDKCONFIG_FILEPATTERN``: This can be a file name to match a `sdkconfig file <#sdkconfig-files>`_ or a pattern with one wildcard (``*``) character to match multiple `sdkconfig files`_.
53
+ - ``CONFIG_NAME``: The name of the corresponding build configuration. This value can be skipped if the wildcard value is to be used.
54
+
55
+ The config rules and the corresponding matched `sdkconfig files`_ for the example project are as follows:
56
+
57
+ .. list-table:: Config Rules
58
+ :widths: 15 15 55 15
59
+ :header-rows: 1
60
+
61
+ - - Config Rule
62
+ - Config Name
63
+ - Explanation
64
+ - Matched sdkconfig file
65
+
66
+ - - ``=``
67
+ - ``default``
68
+ - The default value of the config name is ``default``.
69
+ -
70
+
71
+ - - ``sdkconfig.ci.foo=test``
72
+ - ``test``
73
+ -
74
+ - ``sdkconfig.ci.foo``
75
+
76
+ - - ``sdkconfig.not_exists=test``
77
+ - ``default``
78
+ - The config rule doesn't match any sdkconfig file. The default value is used instead.
79
+ -
80
+
81
+ - - ``sdkconfig.ci.*=``
82
+ - - ``foo``
83
+ - ``bar``
84
+ - The wildcard matches two files. Two apps are built based on each sdkconfig file.
85
+ - - ``sdkconfig.ci.foo``
86
+ - ``sdkconfig.ci.bar``
87
+
88
+ ****************
89
+ Override Order
90
+ ****************
91
+
92
+ The override order is explained using graphs to make it easier to understand.
93
+
94
+ Basic ``sdkconfig.defaults``
95
+ ============================
96
+
97
+ The matched `sdkconfig files`_ override the pre-set configurations in the ``sdkconfig.defaults`` file. The priority order is as follows (the arrow points to the higher priority):
98
+
99
+ .. mermaid::
100
+
101
+ graph TD
102
+ A[sdkconfig.defaults]
103
+ B[sdkconfig.ci.foo]
104
+ C[sdkconfig.ci.bar]
105
+ D{{app foo}}
106
+ E{{app bar}}
107
+
108
+ subgraph pre-set configurations
109
+ A
110
+ B
111
+ C
112
+ end
113
+
114
+ A --> B -- "populates sdkconfig file, then build" --> D
115
+ A --> C -- "populates sdkconfig file, then build" --> E
116
+
117
+ Target-specific Sdkconfig Files
118
+ ===============================
119
+
120
+ When building the project for the ESP32 target, `sdkconfig files`_ with the ``.esp32`` suffix are considered in addition to the following order (the arrow points to the higher priority):
121
+
122
+ .. mermaid::
123
+
124
+ graph TD
125
+ A[sdkconfig.defaults]
126
+ B[sdkconfig.defaults.esp32]
127
+ C[sdkconfig.ci.foo]
128
+ D[sdkconfig.ci.foo.esp32]
129
+ E[sdkconfig.ci.bar]
130
+ F{{app foo}}
131
+ G{{app bar}}
132
+
133
+ subgraph pre-set configurations
134
+
135
+ subgraph only apply when building esp32
136
+ B
137
+ D
138
+ end
139
+
140
+ A
141
+ C
142
+ E
143
+ end
144
+
145
+ A --> B
146
+ B --> C --> D -- "populates sdkconfig file, then build" --> F
147
+ B --> E -- "populates sdkconfig file, then build" --> G
148
+
149
+ Override In CLI
150
+ ===============
151
+
152
+ ``idf-build-apps`` also supports overriding the pre-set configurations using CLI options.
153
+
154
+ - ``--override-sdkconfig-items``
155
+
156
+ A comma-separated list of key-value pairs representing the configuration options.
157
+
158
+ - ``--override-sdkconfig-files``
159
+
160
+ A comma-separated list of file paths pointing to the `sdkconfig files`_.
161
+
162
+ To make the example more complex, assume that the following CLI options are used:
163
+
164
+ - ``--override-sdkconfig-items=CONFIG1=VALUE1,CONFIG2=VALUE2``
165
+ - ``--override-sdkconfig-files=temp1,temp2``
166
+
167
+ Now the priority order of the configuration options is as follows (the arrow points to the higher priority):
168
+
169
+ .. mermaid::
170
+
171
+ graph TD
172
+ A[sdkconfig.defaults]
173
+ B[sdkconfig.defaults.esp32]
174
+ C[sdkconfig.ci.foo]
175
+ D[sdkconfig.ci.foo.esp32]
176
+ E[sdkconfig.ci.bar]
177
+ F[temp1]
178
+ G[temp2]
179
+ H[A temp file, that contains the value of --override-sdkconfig-items
180
+ CONFIG1=VALUE1
181
+ CONFIG2=VALUE2]
182
+
183
+ I{{app foo}}
184
+ J{{app bar}}
185
+
186
+ subgraph pre-set configurations
187
+
188
+ subgraph only apply when building esp32
189
+ B
190
+ D
191
+ end
192
+
193
+ A
194
+ C
195
+ E
196
+ F
197
+ G
198
+ H
199
+ end
200
+
201
+ A --> B
202
+ B --> C --> D --> F --> G --> H -- "populates sdkconfig file, then build" --> I
203
+ B --> E --> F --> G --> H -- "populates sdkconfig file, then build" --> J