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

Docs for 10731 #2468

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions migrating_to_2.0/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ The ``conan search`` will search, by default, in all the remotes (not in the loc
If you want to explore the local cache there is a command ``conan list recipes <pattern>``.


.. _conan_v2_unified_arguments:

Unified patterns in command arguments
-------------------------------------

Expand Down
32 changes: 30 additions & 2 deletions migrating_to_2.0/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,34 @@ Settings
pass


Options
-------

The definition of the ``default_options`` attribute has changed when referring to a dependency. It is related to the
:ref:`unified patterns in the command line<conan_v2_unified_arguments>`.


.. code-block:: python
:caption: **From:**

from conans import ConanFile

class Pkg(Conanfile):
default_options = {"pkg:some_option": "value"}


.. code-block:: python
:caption: **To:**

from conan import ConanFile

class Pkg(Conanfile):
# "pkg/*:some_option" or ""pkg/1.0:some_option" or "pkg*:some_option" would be valid
default_options = {"pkg/*:some_option": "value"}




The layout() method
-------------------

Expand All @@ -129,8 +157,8 @@ If your recipe is using CMake, you might want to use the ``cmake_layout(self)``:

class Pkg(Conanfile):

def layout(self):
cmake_layout(self)
def layout(self):
cmake_layout(self)

A typical anti-pattern in the recipes that can be solved with a ``layout()`` declaration would be:

Expand Down