Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add export_conandata_patches docs #2720

Merged
merged 2 commits into from
Aug 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions reference/conanfile/tools/files/patches.rst
Expand Up @@ -98,3 +98,28 @@ Example of ``conandata.yml`` with different patches for different versions:

ret = g_test_run ();
- patch_file: "patches/0003-fix-content-length-calculation.patch"


conan.tools.files.export_conandata_patches()
--------------------------------------------

Available since: `1.52.0 <https://github.com/conan-io/conan/releases/tag/1.52.0>`_

.. code-block:: python

def export_conandata_patches(conanfile):

Exports (copies from ``conanfile.recipe_folder`` to ``conanfile.exports_sources_folder``)
patches stored in ``conanfile.conan_data`` (read from ``conandata.yml`` file). It will
export all the patches under ``patches`` entry that matches the given
``conanfile.version``. If versions are not defined in ``conandata.yml`` it will export all
the patches directly under ``patches`` keyword.

Example of ``conandata.yml`` without versions defined:

.. code-block:: python

from conan.tools.files import export_conandata_patches

def export_sources(self):
export_conandata_patches(self)