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

Track ref in host version syntax example #3575

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions versioning/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ The ``<host_version>`` will take the version from the regular ``requires``, so i
Note this can be useful if for some reason the "host" requirement changes, like when it is overridden from downstream, or if it defined
a version range and resolved to another version.

Additionally, the syntax ``<host_version:mylib>`` can be used to specify the name of the package to be tracked,
should the *requires* and *tool_requires* have different names. For instance:

.. code-block:: python

from conan import ConanFile
class mylibRecipe(ConanFile):
name = "mylib"
version = "0.1"
def requirements(self):
self.requires("gettext/2.31")
def build_requirements(self):
self.tool_requires("libgettext/<host_version:gettext>")


Package revisions
+++++++++++++++++
Expand Down