Skip to content

Commit c32a5cd

Browse files
AbrilRBSczoido
andauthored
Add more explicit info on profile patterns (#4195)
* Add more explicit info on profile patterns * Update reference/config_files/profiles.rst Co-authored-by: Carlos Zoido <[email protected]> * Update reference/config_files/profiles.rst Co-authored-by: Carlos Zoido <[email protected]> * Update reference/config_files/profiles.rst Co-authored-by: Carlos Zoido <[email protected]> * Update reference/config_files/profiles.rst Co-authored-by: Carlos Zoido <[email protected]> * Update reference/config_files/profiles.rst Co-authored-by: Carlos Zoido <[email protected]> * Update reference/config_files/profiles.rst Co-authored-by: Carlos Zoido <[email protected]> --------- Co-authored-by: Carlos Zoido <[email protected]>
1 parent 777aae2 commit c32a5cd

File tree

2 files changed

+40
-5
lines changed

2 files changed

+40
-5
lines changed

reference/config_files/profiles.rst

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ List of settings available from :ref:`reference_config_files_settings_yml`:
200200
os=Macos
201201
202202
203+
.. seealso::
204+
205+
- This section allows to use patterns to limit which packages are affected by the setting. See :ref:`this section <reference_config_files_profile_patterns>` for more details.
206+
207+
203208
[options]
204209
+++++++++
205210

@@ -212,6 +217,9 @@ List of options available from your recipe and its dependencies:
212217
mypkg/*:my_pkg_option=True
213218
*:shared=True
214219
220+
.. seealso::
221+
222+
- This section allows to use patterns to limit which packages are affected by the options. See :ref:`this section <reference_config_files_profile_patterns>` for more details.
215223

216224
.. _reference_config_files_profiles_tool_requires:
217225

@@ -228,7 +236,8 @@ List of ``tool_requires`` required by your recipe or its dependencies:
228236
229237
.. seealso::
230238

231-
Read more about tool requires in this section: :ref:`consuming_packages_tool_requires`.
239+
- This section allows to use patterns to limit which packages are affected by the tool requirement. See :ref:`this section <reference_config_files_profile_patterns>` for more details.
240+
- Read more about tool requires in this section: :ref:`consuming_packages_tool_requires`.
232241

233242

234243
.. _reference_config_files_profiles_system_tools:
@@ -238,7 +247,7 @@ List of ``tool_requires`` required by your recipe or its dependencies:
238247

239248
.. note::
240249

241-
This section is **deprecated** and has been replaced by :ref:`reference_config_files_profiles_platform_requires` and :ref:`reference_config_files_profiles_platform_tool_requires` sections.
250+
This section is **deprecated** and has been replaced by :ref:`reference_config_files_profiles_platform_requires` and :ref:`reference_config_files_profiles_platform_tool_requires` sections.
242251

243252

244253
.. _reference_config_files_profiles_buildenv:
@@ -296,6 +305,11 @@ Then, the result of applying this profile is:
296305
using extra spaces around ``=`` in profiles, use the syntax shown above.
297306

298307

308+
.. seealso::
309+
310+
- This section allows to use patterns to limit which packages are affected by the buildenv. See :ref:`this section <reference_config_files_profile_patterns>` for more details.
311+
312+
299313
.. _reference_config_files_profiles_runenv:
300314

301315
[runenv]
@@ -316,6 +330,9 @@ All the operators/patterns explained for :ref:`reference_config_files_profiles_b
316330
MyPath1=+(path)/other path/path12
317331
MyPath1=!
318332
333+
.. seealso::
334+
335+
- This section allows to use patterns to limit which packages are affected by the runenv. See :ref:`this section <reference_config_files_profile_patterns>` for more details.
319336

320337
.. _reference_config_files_profiles_conf:
321338

@@ -386,6 +403,10 @@ Running, for instance, :command:`conan install . -pr myprofile`, the configurati
386403
...
387404
388405
406+
.. seealso::
407+
408+
- This section allows to use patterns to limit which packages are affected by the confs. See :ref:`this section <reference_config_files_profile_patterns>` for more details.
409+
389410
.. _reference_config_files_profiles_replace_requires:
390411

391412
[replace_requires]
@@ -814,8 +835,8 @@ clang 3.5 as compiler, and gcc otherwise:
814835
compiler.version=4.9
815836
compiler.libcxx=libstdc++11
816837
817-
Also `&` can be specified as the package name. It will apply only to the consumer conanfile (.py or .txt).
818-
This is a special case because the consumer conanfile might not declare a `name` so it would be impossible to reference it.
838+
Also ``&`` can be specified as the package name. It will apply only to the consumer conanfile (.py or .txt).
839+
This is a special case because the consumer conanfile might not declare a ``name`` so it would be impossible to reference it.
819840

820841
.. code-block:: text
821842
:caption: *myprofile*
@@ -837,6 +858,20 @@ so it will match everything starting with zlib, like ``zlib``, ``zlibng``, ``zli
837858
zlib*:compiler.libcxx=libstdc++11
838859
839860
861+
If a pattern begins with ``!``, it's considered an exclusion pattern, meaning that it will match
862+
everything except the specified pattern. This also works for the consumer ``&`` pattern mentioned above.
863+
864+
Care must be taken when using exclusion patterns, as they can lead to unexpected results if not used carefully.
865+
866+
For example, to define a ``shared=True`` option for all packages except to `zlib`, you can use:
867+
868+
.. code-block:: text
869+
:caption: *myprofile*
870+
871+
[options]
872+
!zlib/*:shared=True
873+
874+
840875
Profile includes
841876
----------------
842877

tutorial/consuming_packages/use_tools_as_conan_packages.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ the environment activation:
242242
.. seealso::
243243

244244
- `JFrog Academy Conan 2 Essentials: Using Build Tools As Conan Packages <https://academy.jfrog.com/conan-2-essentials/2164300?utm_source=Conan+Docs>`__
245-
- :ref:`Using [system_tools] in your profiles <reference_config_files_profiles_system_tools>`.
245+
- :ref:`Using [platform_tool_requires] in your profiles <reference_config_files_profiles_platform_tool_requires>`.
246246
- :ref:`Creating recipes for tool_requires: packaging build tools <tutorial_other_tool_requires_packages>`.
247247
- :ref:`examples_graph_tool_requires_protobuf`
248248
- :ref:`examples_dev_flow_tool_requires_mingw`

0 commit comments

Comments
 (0)