The IDF Component manager is a tool that downloads dependencies for any ESP-IDF CMake project. The download happens automatically during a run of CMake. It can source components either from `the component registry <https://components.espressif.com>`_ or from a git repository.
A list of components can be found on `<https://components.espressif.com/>`_
Using with a project
====================
Dependencies for each component in the project are defined in a separate manifest file named ``idf_component.yml`` placed in the root of the component. The manifest file template can be created for a component by running ``idf.py create-manifest --component=my_component``. When a new manifest is added to one of the components in the project it's necessary to reconfigure it manually by running ``idf.py reconfigure``. Then build will track changes in ``idf_component.yml`` manifests and automatically triggers CMake when necessary.
There is an example application: example:`build_system/cmake/component_manager` that uses components installed by the component manager.
It's not necessary to have a manifest for components that don't need any managed dependencies.
When CMake configures the project (e.g. ``idf.py reconfigure``) component manager does a few things:
- Processes ``idf_component.yml`` manifests for every component in the project and recursively solves dependencies
- Creates a ``dependencies.lock`` file in the root of the project with a full list of dependencies
- Downloads all dependencies to the ``managed_components`` directory
The lock-file ``dependencies.lock`` and content of ``managed_components`` directory is not supposed to be modified by a user. When the component manager runs it always make sure they are up to date. If these files were accidentally modified it's possible to re-run the component manager by triggering CMake with ``idf.py reconfigure``
You may set build property ``DEPENDENCIES_LOCK`` to specify the lock-file path in the top-level CMakeLists.txt. For example, adding ``idf_build_set_property(DEPENDENCIES_LOCK dependencies.lock.${IDF_TARGET})`` before ``project(PROJECT_NAME)`` could help generate different lock files for different targets.