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 methods order for conan create #3682

Merged
merged 6 commits into from May 8, 2024
Merged
Changes from 2 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
56 changes: 56 additions & 0 deletions reference/commands/create.rst
Expand Up @@ -59,6 +59,62 @@ The same happens for lockfiles created with ``--lockfile-out`` argument. The loc
dependencies, you can control their build using the ``--build-test`` argument.


Methods execution order
-----------------------

The ``conan create`` executes :ref:`methods <reference_conanfile_methods>` of a *conanfile.py* in the following order:
RubenRBS marked this conversation as resolved.
Show resolved Hide resolved

#. Export recipe to the cache
#. ``init()``
#. ``set_name()``
#. ``set_version()``
#. ``export()``
#. ``export_sources()``
#. Compute dependency graph
#. ``ìnit()``
#. ``config_options()``
#. ``configure()``
#. ``requirements()``
#. ``build_requirements()``
#. Compute necessary packages
#. ``validate_build()``
#. ``validate()``
#. ``package_id()``
#. ``layout()``
#. ``system_requirements()``
#. Install packages
#. ``build_id()``
RubenRBS marked this conversation as resolved.
Show resolved Hide resolved
#. ``generate()``
#. ``build()``
#. ``package()``
RubenRBS marked this conversation as resolved.
Show resolved Hide resolved
#. ``package_info()``

After that, if you have a folder named *test_package* in your project or you call the ``conan create`` command with the
``--test-folder`` flag, the command will call the *conanfile.py* file inside the folder in the following order:
czoido marked this conversation as resolved.
Show resolved Hide resolved

#. Compute dependency graph
#. ``ìnit()``
#. ``config_options()``
#. ``configure()``
#. ``requirements()``
#. ``build_requirements()``
#. Compute necessary packages
#. ``validate_build()``
#. ``validate()``
#. ``package_id()``
#. ``layout()``
#. ``system_requirements()``
#. Install packages
#. ``build_id()``
#. ``generate()``
#. ``build()``
#. ``package()``
#. ``package_info()``
RubenRBS marked this conversation as resolved.
Show resolved Hide resolved

Steps ``3.1, 3.2, 3.3, 3.4`` will be skipped if the project is already installed. Typically, it should be installed
RubenRBS marked this conversation as resolved.
Show resolved Hide resolved
just as it was installed in the previous "install packages" step.


.. seealso::

- Read more about creating packages in the :ref:`dedicated
Expand Down