diff --git a/README.md b/README.md index c4783fe4db99..c9b33cafa10c 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ indentation. Documentation makes an extensive use of bash, python, txt and cmake [requires] poco/1.9.4 - zlib/1.2.11 + zlib/1.3.1 ``` ``` diff --git a/examples/graph/requires/consume_cmake_macro.rst b/examples/graph/requires/consume_cmake_macro.rst index 48bd3643c0c9..77228adc2f9b 100644 --- a/examples/graph/requires/consume_cmake_macro.rst +++ b/examples/graph/requires/consume_cmake_macro.rst @@ -48,7 +48,7 @@ recipes, for example this application: class App(ConanFile): package_type = "application" - generators = "CMakeToolchain" + generators = "CMakeToolchain", "CMakeDeps" settings = "os", "compiler", "arch", "build_type" requires = "pkg/0.1" diff --git a/examples/tools/meson/build_simple_meson_project.rst b/examples/tools/meson/build_simple_meson_project.rst index 834181e489ab..16c0a4401b51 100644 --- a/examples/tools/meson/build_simple_meson_project.rst +++ b/examples/tools/meson/build_simple_meson_project.rst @@ -89,7 +89,7 @@ Let's create a *conanfile.txt* with the following content to install **Zlib**: :caption: **conanfile.txt** [requires] - zlib/1.2.11 + zlib/1.3.1 [generators] PkgConfigDeps diff --git a/knowledge.rst b/knowledge.rst index cc35428dc4da..9c877495f7a1 100644 --- a/knowledge.rst +++ b/knowledge.rst @@ -12,4 +12,5 @@ Knowledge knowledge/guidelines knowledge/faq knowledge/videos + knowledge/academy diff --git a/knowledge/academy.rst b/knowledge/academy.rst new file mode 100644 index 000000000000..5351dfd16ef8 --- /dev/null +++ b/knowledge/academy.rst @@ -0,0 +1,19 @@ +.. _academy: + +Conan 2 Essentials Training +=========================== + +This new course has been created from the ground up to cover the fundamental features and best practices of Conan 2. +It will provide you with the essential knowledge needed to start working with the tool effectively, +whether you are a new user or migrating from a previous version. + +A Hands-On, Free, and Self-Paced Course +--------------------------------------- +This course is designed to be a practical learning experience. +There’s `a dedicated GitHub repository `__ +with the source code that you will use throughout the lessons to apply the concepts with hands-on examples, +allowing you to experiment firsthand with the features of Conan 2. + +The course is completely free and available for you to take at your own pace, with no schedules or deadlines. + +Register `here `__ to freely access the course. diff --git a/knowledge/faq.rst b/knowledge/faq.rst index 632596c1ef63..ed431dc2e194 100644 --- a/knowledge/faq.rst +++ b/knowledge/faq.rst @@ -19,9 +19,9 @@ that you get an error like the following one: .. code-block:: text - ERROR: Missing binary: zlib/1.2.11:b1d267f77ddd5d10d06d2ecf5a6bc433fbb7eeed + ERROR: Missing binary: zlib/1.3.1:b1d267f77ddd5d10d06d2ecf5a6bc433fbb7eeed - zlib/1.2.11: WARN: Can't find a 'zlib/1.2.11' package binary 'b1d267f77ddd5d10d06d2ecf5a6bc433fbb7eeed' for the configuration: + zlib/1.3.1: WARN: Can't find a 'zlib/1.3.1' package binary 'b1d267f77ddd5d10d06d2ecf5a6bc433fbb7eeed' for the configuration: [settings] arch=x86_64 build_type=Release @@ -34,14 +34,14 @@ that you get an error like the following one: fPIC=True shared=False - ERROR: Missing prebuilt package for 'zlib/1.2.11'. You can try: + ERROR: Missing prebuilt package for 'zlib/1.3.1'. You can try: - List all available packages using 'conan list "{ref}:*" -r=remote' - Explain missing binaries: replace 'conan install ...' with 'conan graph explain ...' - - Try to build locally from sources using the '--build=zlib/1.2.11' argument + - Try to build locally from sources using the '--build=zlib/1.3.1' argument More Info at 'https://docs.conan.io/en/2/knowledge/faq.html#error-missing-prebuilt-package' -This means that the package recipe ``zlib/1.2.11`` exists, but for some reason there is no +This means that the package recipe ``zlib/1.3.1`` exists, but for some reason there is no precompiled package for your current settings or options. Maybe the package creator didn't build and shared pre-built packages at all and only uploaded the package recipe, or they are only providing packages for some platforms or compilers. E.g. the package creator built diff --git a/reference/commands/cache.rst b/reference/commands/cache.rst index 106971884db2..d2c87815da5b 100644 --- a/reference/commands/cache.rst +++ b/reference/commands/cache.rst @@ -208,8 +208,8 @@ For example, to verify the integrity of the whole Conan local cache, do: mypkg/1.0: Integrity checked: ok mypkg/1.0:454923cd42d0da27b9b1294ebc3e4ecc84020747: Integrity checked: ok mypkg/1.0:454923cd42d0da27b9b1294ebc3e4ecc84020747: Integrity checked: ok - zlib/1.2.11: Integrity checked: ok - zlib/1.2.11:6fe7fa69f760aee504e0be85c12b2327c716f9e7: Integrity checked: ok + zlib/1.3.1: Integrity checked: ok + zlib/1.3.1:6fe7fa69f760aee504e0be85c12b2327c716f9e7: Integrity checked: ok conan cache backup-upload diff --git a/reference/commands/list.rst b/reference/commands/list.rst index d21cf8f5ea0b..017980cae9ab 100644 --- a/reference/commands/list.rst +++ b/reference/commands/list.rst @@ -49,7 +49,7 @@ Listing recipe references string-view-lite string-view-lite/1.6.0 zlib - zlib/1.2.11 + zlib/1.3.1 This command is equivalent to ``$ conan list "*"`` (make sure to quote the argument), if no argument is provided Conan will list all packages. @@ -61,7 +61,7 @@ is provided Conan will list all packages. $ conan list zlib Local Cache zlib - zlib/1.2.11 + zlib/1.3.1 zlib/1.2.12 @@ -75,7 +75,7 @@ search. $ conan list "zlib/*" Local Cache zlib - zlib/1.2.11 + zlib/1.3.1 zlib/1.2.12 You can also use version ranges in the version field to define the versions you want: @@ -87,7 +87,7 @@ You can also use version ranges in the version field to define the versions you $ conan list "zlib/[<1.2.12]" -r=conancenter Local Cache zlib - zlib/1.2.11 + zlib/1.3.1 $ conan list "zlib/[>1.2.11]" -r=conancenter Local Cache zlib @@ -115,7 +115,7 @@ Use the ``...@`` pattern for searching only references that don't have *user* an string-view-lite string-view-lite/1.6.0 zlib - zlib/1.2.11 + zlib/1.3.1 Listing recipe revisions ------------------------ @@ -126,10 +126,10 @@ we can use the ``#latest`` placeholder: .. code-block:: text :caption: *list latest recipe revision* - $ conan list zlib/1.2.11#latest + $ conan list zlib/1.3.1#latest Local Cache zlib - zlib/1.2.11 + zlib/1.3.1 revisions ffa77daf83a57094149707928bdce823 (2022-11-02 13:46:53 UTC) @@ -138,10 +138,10 @@ To list all recipe revisions use the ``*`` wildcard: .. code-block:: text :caption: *list all recipe revisions* - $ conan list "zlib/1.2.11#*" + $ conan list "zlib/1.3.1#*" Local Cache zlib - zlib/1.2.11 + zlib/1.3.1 revisions ffa77daf83a57094149707928bdce823 (2022-11-02 13:46:53 UTC) 8b23adc7acd6f1d6e220338a78e3a19e (2022-10-19 09:19:10 UTC) @@ -160,10 +160,10 @@ using ``name/version@user/channel:*`` as the pattern: :caption: *list all package IDs for latest recipe revision* # Make sure to quote the argument - $ conan list "zlib/1.2.11:*" + $ conan list "zlib/1.3.1:*" Local Cache zlib - zlib/1.2.11 + zlib/1.3.1 revisions d77ee68739fcbe5bf37b8a4690eea6ea (2022-08-05 17:17:30 UTC) packages @@ -193,7 +193,7 @@ using ``name/version@user/channel:*`` as the pattern: .. note:: Here the ``#latest`` for the recipe revision is implicit, i.e., that pattern is - equivalent to ``zlib/1.2.11#latest:*`` + equivalent to ``zlib/1.3.1#latest:*`` To list all the package IDs for all the recipe revisions use the ``*`` wildcard in the @@ -203,10 +203,10 @@ revision ``#`` part: :caption: *list all the package IDs for all the recipe revisions* # Make sure to quote the argument - $ conan list "zlib/1.2.11#*:*" + $ conan list "zlib/1.3.1#*:*" Local Cache zlib - zlib/1.2.11 + zlib/1.3.1 revisions d77ee68739fcbe5bf37b8a4690eea6ea (2022-08-05 17:17:30 UTC) packages @@ -245,10 +245,10 @@ package ID is using the pattern ``name/version@user/channel#rrev:pkgid`` .. code-block:: text :caption: *list latest package revision for a specific recipe revision and package ID* - $ conan list zlib/1.2.11#8b23adc7acd6f1d6e220338a78e3a19e:fdb823f07bc228621617c6397210a5c6c4c8807b + $ conan list zlib/1.3.1#8b23adc7acd6f1d6e220338a78e3a19e:fdb823f07bc228621617c6397210a5c6c4c8807b Local Cache zlib - zlib/1.2.11 + zlib/1.3.1 revisions 8b23adc7acd6f1d6e220338a78e3a19e (2022-08-05 17:17:30 UTC) packages @@ -263,10 +263,10 @@ To list all the package revisions for for the latest recipe revision: :caption: *list all the package revisions for all package-ids the latest recipe revision* # Make sure to quote the argument - $ conan list "zlib/1.2.11:*#*" + $ conan list "zlib/1.3.1:*#*" Local Cache zlib - zlib/1.2.11 + zlib/1.3.1 revisions 6a6451bbfcb0e591333827e9784d7dfa (2022-12-29 11:51:39 UTC) packages @@ -282,7 +282,7 @@ To list all the package revisions for for the latest recipe revision: .. note:: Here the ``#latest`` for the recipe revision is implicit, i.e., that pattern is - equivalent to ``zlib/1.2.11#latest:*#*`` + equivalent to ``zlib/1.3.1#latest:*#*`` Listing graph artifacts @@ -366,7 +366,7 @@ with the following structure: .. code-block:: text # Make sure to quote the argument - $ conan list "zlib/1.2.11:*#*" --format=json + $ conan list "zlib/1.3.1:*#*" --format=json { "Local Cache": { "zli/1.0.0": { diff --git a/reference/commands/search.rst b/reference/commands/search.rst index b6fc07c78514..24b7ef198e88 100644 --- a/reference/commands/search.rst +++ b/reference/commands/search.rst @@ -16,7 +16,7 @@ This command is equivalent to ``conan list -r=*``, and is provided for s conancenter zlib zlib/1.2.8 - zlib/1.2.11 + zlib/1.3.1 zlib/1.2.12 zlib/1.2.13 @@ -24,21 +24,21 @@ This command is equivalent to ``conan list -r=*``, and is provided for s conancenter zlib zlib/1.2.8 - zlib/1.2.11 + zlib/1.3.1 zlib/1.2.12 zlib/1.2.13 $ conan search zlib/1.2.1* -r=conancenter conancenter zlib - zlib/1.2.11 + zlib/1.3.1 zlib/1.2.12 zlib/1.2.13 $ conan search zlib/1.2.1* -r=conancenter --format=json { "conancenter": { - "zlib/1.2.11": {}, + "zlib/1.3.1": {}, "zlib/1.2.12": {}, "zlib/1.2.13": {} } diff --git a/reference/commands/workspace.rst b/reference/commands/workspace.rst index 695609a24d75..f7a8cf383d5e 100644 --- a/reference/commands/workspace.rst +++ b/reference/commands/workspace.rst @@ -146,6 +146,17 @@ The command ``conan workspace source`` performs the equivalent of ``conan source defined within the workspace. +conan workspace install +----------------------- + +.. autocommand:: + :command: conan workspace install -h + + +The command ``conan workspace install`` performs the equivalent of ``conan install `` for every ``package`` +defined within the workspace in the correct order. + + conan workspace build --------------------- @@ -171,7 +182,7 @@ conan workspace super-install ----------------------------- .. autocommand:: - :command: conan workspace install -h + :command: conan workspace super-install -h The command ``conan workspace super-install`` is useful to install and build the current workspace diff --git a/reference/conanfile/methods/generate.rst b/reference/conanfile/methods/generate.rst index 47c4b625a895..5f43ba2f4f8e 100644 --- a/reference/conanfile/methods/generate.rst +++ b/reference/conanfile/methods/generate.rst @@ -214,7 +214,7 @@ Iterating the dependencies can be done as: .. code-block:: python - requires = "zlib/1.2.11", "poco/1.9.4" + requires = "zlib/1.3.1", "poco/1.9.4" def generate(self): for require, dependency in self.dependencies.items(): @@ -224,7 +224,7 @@ will output: .. code-block:: bash - conanfile.py (hello/0.1): Dependency is direct=True: zlib/1.2.11 + conanfile.py (hello/0.1): Dependency is direct=True: zlib/1.3.1 conanfile.py (hello/0.1): Dependency is direct=True: poco/1.9.4 conanfile.py (hello/0.1): Dependency is direct=False: pcre/8.44 conanfile.py (hello/0.1): Dependency is direct=False: expat/2.4.1 @@ -255,7 +255,7 @@ They can be used in the same way: .. code-block:: python - requires = "zlib/1.2.11", "poco/1.9.4" + requires = "zlib/1.3.1", "poco/1.9.4" def generate(self): cmake = self.dependencies.direct_build["cmake"] diff --git a/reference/conanfile/methods/requirements.rst b/reference/conanfile/methods/requirements.rst index cb0a4456d133..2ff3f162e2e9 100644 --- a/reference/conanfile/methods/requirements.rst +++ b/reference/conanfile/methods/requirements.rst @@ -8,10 +8,10 @@ The ``requirements()`` method is used to specify the dependencies of a package. .. code-block:: python def requirements(self): - self.requires("zlib/1.2.11") + self.requires("zlib/1.3.1") -For simple cases the attribute syntax can be used, like ``requires = "zlib/1.2.11"``. +For simple cases the attribute syntax can be used, like ``requires = "zlib/1.3.1"``. Requirement traits diff --git a/reference/conanfile_txt.rst b/reference/conanfile_txt.rst index ae89e07b6d16..2e8697a482fe 100644 --- a/reference/conanfile_txt.rst +++ b/reference/conanfile_txt.rst @@ -20,7 +20,7 @@ List of requirements, specifying the full reference. Equivalent to ``self.requir [requires] poco/1.9.4 - zlib/1.2.11 + zlib/1.3.1 This section supports references with version-ranges too: @@ -29,7 +29,7 @@ This section supports references with version-ranges too: [requires] poco/[>1.0 <1.9] - zlib/1.2.11 + zlib/1.3.1 And specific recipe revisions can be pinned too: @@ -103,7 +103,7 @@ List of options scoped for each package with a pattern like **package_name*:opti [requires] poco/1.9.4 - zlib/1.2.11 + zlib/1.3.1 [generators] CMakeDeps diff --git a/reference/config_files/profiles.rst b/reference/config_files/profiles.rst index 1fc0b19762ed..937c34abd01d 100644 --- a/reference/config_files/profiles.rst +++ b/reference/config_files/profiles.rst @@ -445,6 +445,12 @@ Same usage as the `replace_requires` section but in this case for `tool_requires In this case, whatever version of ``cmake`` declared in recipes, will be replaced by the reference `cmake/3.25.2`. +.. note:: + + * This section should be added to the profile whose context is the one that requires the tool, i.e., if the + tool is required in the host context, then it should be added to the host profile, so that the requirement + itself can be replaced. + .. _reference_config_files_profiles_platform_requires: @@ -463,7 +469,7 @@ you could specify so as: :caption: *myprofile* [platform_requires] - zlib/1.2.11 + zlib/1.3.1 .. _reference_config_files_profiles_platform_tool_requires: @@ -540,9 +546,13 @@ declaration: Build requirements cmake/3.24.2 - Platform -Note that if the ``platform_tool_requires`` declared **does not make a strict match** with the ``tool_requires`` one (version or -version range), then Conan will try to bring them remotely or locally as usual. +.. note:: + * If the ``platform_tool_requires`` declared **does not make a strict match** with the ``tool_requires`` one (version or + version range), then Conan will try to bring them remotely or locally as usual. + * This section should be added to the profile whose context is the one that requires the tool, i.e., if the + tool is required in the host context, then it should be added to the host profile, so that the requirement + itself can be replaced by the platform one. .. _reference_config_files_profiles_rendering: diff --git a/reference/config_files/remotes.rst b/reference/config_files/remotes.rst index 845f3b71f2bc..a35810e24589 100644 --- a/reference/config_files/remotes.rst +++ b/reference/config_files/remotes.rst @@ -29,7 +29,7 @@ Essentially, it tells Conan where to list/upload/download the recipes/binaries f The fields for each remote are: * ``name`` (Required, ``string`` value): Name of the remote. This name will be used in commands - like :ref:`reference_commands_list`, e.g., :command:`conan list zlib/1.2.11 --remote my_remote_name`. + like :ref:`reference_commands_list`, e.g., :command:`conan list zlib/1.3.1 --remote my_remote_name`. * ``url`` (Required, ``string`` value): indicates the URL to be used by Conan to search for the recipes/binaries. * ``verify_ssl`` (Required, ``bool`` value): Verify SSL certificate of the specified url. * ``disabled`` (Optional, ``bool`` value, ``false`` by default): If the remote is enabled or not to be used by commands diff --git a/reference/extensions/custom_generators.rst b/reference/extensions/custom_generators.rst index 009128c89b75..71ec19f16bdd 100644 --- a/reference/extensions/custom_generators.rst +++ b/reference/extensions/custom_generators.rst @@ -52,7 +52,7 @@ And then ``conan create mygenerator`` and use it in the generate method of your version = "1.0" python_requires = "mygenerator/1.0" - requires = "zlib/1.2.11", "bzip2/1.0.8" + requires = "zlib/1.3.1", "bzip2/1.0.8" def generate(self): mygenerator = self.python_requires["mygenerator"].module.MyGenerator(self) diff --git a/reference/tools/apple/xcodedeps.rst b/reference/tools/apple/xcodedeps.rst index 7b018ecef0d5..001a038337e6 100644 --- a/reference/tools/apple/xcodedeps.rst +++ b/reference/tools/apple/xcodedeps.rst @@ -128,7 +128,7 @@ option: settings = "os", "compiler", "arch", "build_type" options = {"shared": [True, False]} default_options = {"shared": False} - requires = "zlib/1.2.11" + requires = "zlib/1.3.1" def generate(self): xcode = XcodeDeps(self) diff --git a/reference/tools/cmake/cmakedeps.rst b/reference/tools/cmake/cmakedeps.rst index 2916dbfd283f..959035f2fdce 100644 --- a/reference/tools/cmake/cmakedeps.rst +++ b/reference/tools/cmake/cmakedeps.rst @@ -289,7 +289,7 @@ Overwrite properties from the consumer side using CMakeDeps.set_property() Using ``CMakeDeps.set_property()`` method you can overwrite the property values set by the Conan recipes from the consumer. This can be done for every property listed above. -Imagine we have a *compressor/1.0* package that depends on *zlib/1.2.11*. The *zlib* recipe +Imagine we have a *compressor/1.0* package that depends on *zlib/1.3.1*. The *zlib* recipe defines some properties: @@ -319,7 +319,7 @@ compressor recipe using the ``CMakeDeps.set_property()`` method: class Compressor(ConanFile): name = "compressor" - requires = "zlib/1.2.11" + requires = "zlib/1.3.1" ... def generate(self): @@ -338,7 +338,7 @@ value ``None`` to the property like this: class Compressor(ConanFile): name = "compressor" - requires = "zlib/1.2.11" + requires = "zlib/1.3.1" ... def generate(self): diff --git a/reference/tools/env/virtualbuildenv.rst b/reference/tools/env/virtualbuildenv.rst index 28314f8e108a..7d285d8f25c9 100644 --- a/reference/tools/env/virtualbuildenv.rst +++ b/reference/tools/env/virtualbuildenv.rst @@ -35,7 +35,7 @@ And it can also be fully instantiated in the conanfile ``generate()`` method: class Pkg(ConanFile): settings = "os", "compiler", "arch", "build_type" - requires = "zlib/1.2.11", "bzip2/1.0.8" + requires = "zlib/1.3.1", "bzip2/1.0.8" def generate(self): ms = VirtualBuildEnv(self) diff --git a/reference/tools/env/virtualrunenv.rst b/reference/tools/env/virtualrunenv.rst index 3af485cb1135..a514ca3ceb05 100644 --- a/reference/tools/env/virtualrunenv.rst +++ b/reference/tools/env/virtualrunenv.rst @@ -38,7 +38,7 @@ And it can also be fully instantiated in the conanfile ``generate()`` method: class Pkg(ConanFile): settings = "os", "compiler", "arch", "build_type" - requires = "zlib/1.2.11", "bzip2/1.0.8" + requires = "zlib/1.3.1", "bzip2/1.0.8" def generate(self): ms = VirtualRunEnv(self) diff --git a/reference/tools/gnu/pkgconfigdeps.rst b/reference/tools/gnu/pkgconfigdeps.rst index 4546ff02812f..9a5df17e18d4 100644 --- a/reference/tools/gnu/pkgconfigdeps.rst +++ b/reference/tools/gnu/pkgconfigdeps.rst @@ -31,7 +31,7 @@ And it can also be fully instantiated in the conanfile ``generate()`` method: class App(ConanFile): settings = "os", "arch", "compiler", "build_type" - requires = "zlib/1.2.11" + requires = "zlib/1.3.1" def generate(self): pc = PkgConfigDeps(self) @@ -46,7 +46,7 @@ The ``prefix`` variable is automatically adjusted to the ``package_folder``: .. code-block:: text - prefix=/Users/YOUR_USER/.conan/data/zlib/1.2.11/_/_/package/647afeb69d3b0a2d3d316e80b24d38c714cc6900 + prefix=/Users/YOUR_USER/.conan/data/zlib/1.3.1/_/_/package/647afeb69d3b0a2d3d316e80b24d38c714cc6900 libdir=${prefix}/lib includedir=${prefix}/include bindir=${prefix}/bin @@ -66,7 +66,7 @@ Naming By default, the ``*.pc`` files will be named following these rules: -* For packages, it uses the package name, e.g., package ``zlib/1.2.11`` -> ``zlib.pc``. +* For packages, it uses the package name, e.g., package ``zlib/1.3.1`` -> ``zlib.pc``. * For components, the package name + hyphen + component name, e.g., ``openssl/3.0.0`` with ``self.cpp_info.components["crypto"]`` -> ``openssl-crypto.pc``. You can change that default behavior with the ``pkg_config_name`` and ``pkg_config_aliases`` properties. See :ref:`Properties section below `. diff --git a/reference/tools/google/bazeldeps.rst b/reference/tools/google/bazeldeps.rst index 0e98e420bbff..d53a22555485 100644 --- a/reference/tools/google/bazeldeps.rst +++ b/reference/tools/google/bazeldeps.rst @@ -35,7 +35,7 @@ And it can also be fully instantiated in the conanfile ``generate()`` method: class App(ConanFile): settings = "os", "arch", "compiler", "build_type" - requires = "zlib/1.2.11" + requires = "zlib/1.3.1" def generate(self): bz = BazelDeps(self) @@ -238,7 +238,7 @@ You can put all the files generated by ``BazelDeps`` into another folder using t class App(ConanFile): settings = "os", "arch", "compiler", "build_type" - requires = "zlib/1.2.11" + requires = "zlib/1.3.1" def layout(self): bazel_layout(self) @@ -293,7 +293,7 @@ Naming The ``/BUILD.bazel`` file contains all the targets declared by the dependency. Both the ``/`` folder and the targets declared in there will be named following these rules by default: -* For packages, it uses the package name as folder/target name, e.g., package ``zlib/1.2.11`` will have: +* For packages, it uses the package name as folder/target name, e.g., package ``zlib/1.3.1`` will have: * Folder: ``zlib/BUILD.bazel``. * Global target: ``zlib``. * How it can be consumed: ``@zlib//:zlib``. diff --git a/reference/tools/microsoft/msbuilddeps.rst b/reference/tools/microsoft/msbuilddeps.rst index 43a45b534787..95bdd7eaf7d5 100644 --- a/reference/tools/microsoft/msbuilddeps.rst +++ b/reference/tools/microsoft/msbuilddeps.rst @@ -34,7 +34,7 @@ And it can also be fully instantiated in the conanfile ``generate()`` method: class Pkg(ConanFile): settings = "os", "compiler", "arch", "build_type" - requires = "zlib/1.2.11", "bzip2/1.0.8" + requires = "zlib/1.3.1", "bzip2/1.0.8" def generate(self): ms = MSBuildDeps(self) @@ -112,7 +112,7 @@ option: settings = "os", "compiler", "arch", "build_type" options = {"shared": [True, False]} default_options = {"shared": False} - requires = "zlib/1.2.11" + requires = "zlib/1.3.1" def generate(self): ms = MSBuildDeps(self) diff --git a/reference/tools/microsoft/vcvars.rst b/reference/tools/microsoft/vcvars.rst index 2c69399bed3b..ae7bcdb669ae 100644 --- a/reference/tools/microsoft/vcvars.rst +++ b/reference/tools/microsoft/vcvars.rst @@ -33,7 +33,7 @@ And it can also be fully instantiated in the conanfile ``generate()`` method: class Pkg(ConanFile): settings = "os", "compiler", "arch", "build_type" - requires = "zlib/1.2.11", "bzip2/1.0.8" + requires = "zlib/1.3.1", "bzip2/1.0.8" def generate(self): ms = VCVars(self) diff --git a/reference/tools/premake/premakedeps.rst b/reference/tools/premake/premakedeps.rst index d19c02a8b128..9b3e8f2589c1 100644 --- a/reference/tools/premake/premakedeps.rst +++ b/reference/tools/premake/premakedeps.rst @@ -30,7 +30,7 @@ And it can also be fully instantiated in the conanfile ``generate()`` method: class App(ConanFile): settings = "os", "arch", "compiler", "build_type" - requires = "zlib/1.2.11" + requires = "zlib/1.3.1" def generate(self): deps = PremakeDeps(self) diff --git a/security/audit.rst b/security/audit.rst index c869e65d0cb7..dc773f5128eb 100644 --- a/security/audit.rst +++ b/security/audit.rst @@ -35,6 +35,7 @@ vulnerability scanning. See the :ref:`Adding private providers .. seealso:: + - `JFrog Academy Conan 2 Essentials: Scanning C++ packages for Vulnerabilities using Conan Audit `__ - For detailed reference documentation on all ``conan audit`` subcommands and their options, consult the :ref:`conan audit command reference `. diff --git a/tutorial.rst b/tutorial.rst index 6bcde3edfe51..41c6ec731735 100644 --- a/tutorial.rst +++ b/tutorial.rst @@ -8,6 +8,7 @@ The purpose of this section is to guide you through the most important Conan fea practical examples. From using libraries already packaged by Conan, to how to package your libraries and store them on a remote server alongside all the precompiled binaries. + .. toctree:: :maxdepth: 2 @@ -17,3 +18,10 @@ libraries and store them on a remote server alongside all the precompiled binari tutorial/developing_packages tutorial/versioning tutorial/other_features + + +.. note:: + + The Conan 2 Essentials training course is available for free at the JFrog Academy, + which covers the same topics as this documentation but in a more interactive way. + You can access it `here `__. diff --git a/tutorial/conan_repositories.rst b/tutorial/conan_repositories.rst index a05137429e41..bfc2f2416b2f 100644 --- a/tutorial/conan_repositories.rst +++ b/tutorial/conan_repositories.rst @@ -20,6 +20,7 @@ central repository. Finally, we will explain the `local_recipes_index`, a special type of remote that allows the use of a source folder with recipes as a Conan remote repository. + .. toctree:: :maxdepth: 1 :caption: Table of contents @@ -28,3 +29,10 @@ the use of a source folder with recipes as a Conan remote repository. conan_repositories/uploading_packages.rst conan_repositories/conan_center.rst conan_repositories/setup_local_recipes_index.rst + + +.. note:: + + The Conan 2 Essentials training course is available for free at the JFrog Academy, + which covers the same topics as this documentation but in a more interactive way. + You can access it `here `__. diff --git a/tutorial/conan_repositories/setting_up_conan_remotes.rst b/tutorial/conan_repositories/setting_up_conan_remotes.rst index 5678a10df7c0..3d34627d07c0 100644 --- a/tutorial/conan_repositories/setting_up_conan_remotes.rst +++ b/tutorial/conan_repositories/setting_up_conan_remotes.rst @@ -37,3 +37,7 @@ There are several options to set up a Conan repository: setting_up_conan_remotes/artifactory/artifactory_ce_cpp.rst setting_up_conan_remotes/conan_server.rst + +.. seealso:: + + - `JFrog Academy Conan 2 Essentials: Working with Conan Repositories `__ diff --git a/tutorial/conan_repositories/uploading_packages.rst b/tutorial/conan_repositories/uploading_packages.rst index 595202743980..f0f417148c1b 100644 --- a/tutorial/conan_repositories/uploading_packages.rst +++ b/tutorial/conan_repositories/uploading_packages.rst @@ -60,6 +60,7 @@ You can check whether the package exists on your local computer again with: .. seealso:: + - `JFrog Academy Conan 2 Essentials: Working with Conan Repositories `__ - :ref:`conan upload command reference ` - :ref:`conan remote command reference ` - :ref:`conan search command reference ` diff --git a/tutorial/consuming_packages.rst b/tutorial/consuming_packages.rst index b858cae4139b..f0d7599feed2 100644 --- a/tutorial/consuming_packages.rst +++ b/tutorial/consuming_packages.rst @@ -35,3 +35,10 @@ to lockfiles to achieve reproducibility of the dependency graph. consuming_packages/the_flexibility_of_conanfile_py consuming_packages/cross_building_with_conan.rst consuming_packages/intro_to_versioning + + +.. note:: + + The Conan 2 Essentials training course is available for free at the JFrog Academy, + which covers the same topics as this documentation but in a more interactive way. + You can access it `here `__. diff --git a/tutorial/consuming_packages/build_simple_cmake_project.rst b/tutorial/consuming_packages/build_simple_cmake_project.rst index 2557942d9d84..c9650e1a9068 100644 --- a/tutorial/consuming_packages/build_simple_cmake_project.rst +++ b/tutorial/consuming_packages/build_simple_cmake_project.rst @@ -88,7 +88,7 @@ Our application relies on the **Zlib** library. Conan, by default, tries to inst libraries from a remote server called `ConanCenter `_. You can search there for libraries and also check the available versions. In our case, after checking the available versions for `Zlib `__ we -choose to use one of the latest versions: **zlib/1.2.11**. +choose to use one of the latest versions: **zlib/1.3.1**. The easiest way to install the **Zlib** library and find it from our project with Conan is using a *conanfile.txt* file. Let's create one with the following content: @@ -97,7 +97,7 @@ using a *conanfile.txt* file. Let's create one with the following content: :caption: **conanfile.txt** [requires] - zlib/1.2.11 + zlib/1.3.1 [generators] CMakeDeps @@ -106,7 +106,7 @@ using a *conanfile.txt* file. Let's create one with the following content: As you can see we added two sections to this file with a syntax similar to an *INI* file. * The **[requires]** section is where we declare the libraries we want to use in the - project, in this case, **zlib/1.2.11**. + project, in this case, **zlib/1.3.1**. * The **[generators]** section tells Conan to generate the files that the compilers or build systems will use to find the dependencies and build the project. In this case, @@ -186,33 +186,33 @@ You will get something similar to this as the output of that command: $ conan install . --output-folder=build --build=missing ... -------- Computing dependency graph ---------- - zlib/1.2.11: Not found in local cache, looking in remotes... - zlib/1.2.11: Checking remote: conancenter - zlib/1.2.11: Trying with 'conancenter'... + zlib/1.3.1: Not found in local cache, looking in remotes... + zlib/1.3.1: Checking remote: conancenter + zlib/1.3.1: Trying with 'conancenter'... Downloading conanmanifest.txt Downloading conanfile.py Downloading conan_export.tgz Decompressing conan_export.tgz - zlib/1.2.11: Downloaded recipe revision f1fadf0d3b196dc0332750354ad8ab7b + zlib/1.3.1: Downloaded recipe revision f1fadf0d3b196dc0332750354ad8ab7b Graph root conanfile.txt: /home/conan/examples2/tutorial/consuming_packages/simple_cmake_project/conanfile.txt Requirements - zlib/1.2.11#f1fadf0d3b196dc0332750354ad8ab7b - Downloaded (conancenter) + zlib/1.3.1#f1fadf0d3b196dc0332750354ad8ab7b - Downloaded (conancenter) -------- Computing necessary packages ---------- Requirements - zlib/1.2.11#f1fadf0d3b196dc0332750354ad8ab7b:cdc9a35e010a17fc90bb845108cf86cfcbce64bf#dd7bf2a1ab4eb5d1943598c09b616121 - Download (conancenter) + zlib/1.3.1#f1fadf0d3b196dc0332750354ad8ab7b:cdc9a35e010a17fc90bb845108cf86cfcbce64bf#dd7bf2a1ab4eb5d1943598c09b616121 - Download (conancenter) -------- Installing packages ---------- Installing (downloading, building) binaries... - zlib/1.2.11: Retrieving package cdc9a35e010a17fc90bb845108cf86cfcbce64bf from remote 'conancenter' + zlib/1.3.1: Retrieving package cdc9a35e010a17fc90bb845108cf86cfcbce64bf from remote 'conancenter' Downloading conanmanifest.txt Downloading conaninfo.txt Downloading conan_package.tgz Decompressing conan_package.tgz - zlib/1.2.11: Package installed cdc9a35e010a17fc90bb845108cf86cfcbce64bf - zlib/1.2.11: Downloaded package revision dd7bf2a1ab4eb5d1943598c09b616121 + zlib/1.3.1: Package installed cdc9a35e010a17fc90bb845108cf86cfcbce64bf + zlib/1.3.1: Downloaded package revision dd7bf2a1ab4eb5d1943598c09b616121 -------- Finalizing install (deploy, generators) ---------- conanfile.txt: Generator 'CMakeToolchain' calling 'generate()' @@ -273,6 +273,7 @@ See :ref:`Building with CMake presets`__ - :ref:`Building with CMake presets` - :ref:`Getting started with Autotools` - :ref:`Getting started with Meson` diff --git a/tutorial/consuming_packages/cross_building_with_conan.rst b/tutorial/consuming_packages/cross_building_with_conan.rst index bb009de59a0e..aa9affc2329e 100644 --- a/tutorial/consuming_packages/cross_building_with_conan.rst +++ b/tutorial/consuming_packages/cross_building_with_conan.rst @@ -136,44 +136,44 @@ Now that we have our two profiles prepared, let's have a look at our *conanfile. generators = "CMakeToolchain", "CMakeDeps" def requirements(self): - self.requires("zlib/1.2.11") + self.requires("zlib/1.3.1") def build_requirements(self): - self.tool_requires("cmake/3.22.6") + self.tool_requires("cmake/3.27.9") def layout(self): cmake_layout(self) As you can see, this is practically the same *conanfile.py* we used in the :ref:`previous -example`. We will require **zlib/1.2.11** -as a regular dependency and **cmake/3.22.6** as a tool needed for building the +example`. We will require **zlib/1.3.1** +as a regular dependency and **cmake/3.27.9** as a tool needed for building the application. We will need the application to build for the Raspberry Pi with the cross-build -toolchain and also link the **zlib/1.2.11** library built for the same platform. On the -other side, we need the **cmake/3.22.6** binary to run on Ubuntu Linux. Conan manages this +toolchain and also link the **zlib/1.3.1** library built for the same platform. On the +other side, we need the **cmake/3.27.9** binary to run on Ubuntu Linux. Conan manages this internally in the dependency graph differentiating between what we call the "build context" and the "host context": * The **host context** is populated with the root package (the one specified in the :command:`conan install` or :command:`conan create` command) and all its requirements added via ``self.requires()``. In this case, this includes the compressor application - and the **zlib/1.2.11** dependency. + and the **zlib/1.3.1** dependency. * The **build context** contains the tool requirements used on the build machine. This category typically includes all the developer tools like CMake, compilers and linkers. - In this case, this includes the **cmake/3.22.6** tool. + In this case, this includes the **cmake/3.27.9** tool. These contexts define how Conan will manage each of the dependencies. For example, as -**zlib/1.2.11** belongs to the **host context**, the ``[buildenv]`` build environment we -defined in the **raspberry** profile (profile host) will only apply to the **zlib/1.2.11** +**zlib/1.3.1** belongs to the **host context**, the ``[buildenv]`` build environment we +defined in the **raspberry** profile (profile host) will only apply to the **zlib/1.3.1** library when building and won't affect anything that belongs to the **build context** like -the **cmake/3.22.6** dependency. +the **cmake/3.27.9** dependency. Now, let's build the application. First, call :command:`conan install` with the -profiles for the build and host platforms. This will install the **zlib/1.2.11** -dependency built for the *armv7hf* architecture and a **cmake/3.22.6** version that runs on a +profiles for the build and host platforms. This will install the **zlib/1.3.1** +dependency built for the *armv7hf* architecture and a **cmake/3.27.9** version that runs on a 64-bit architecture. .. code-block:: bash @@ -219,6 +219,7 @@ You could check that we built the application for the correct architecture by ru .. seealso:: + - `JFrog Academy Conan 2 Essentials: Cross-Compiling Your Applications With Conan `__ - :ref:`Creating a Conan package for a toolchain` - :ref:`Cross building to Android with the NDK` - :ref:`VirtualBuildEnv reference ` diff --git a/tutorial/consuming_packages/different_configurations.rst b/tutorial/consuming_packages/different_configurations.rst index 7f0f9bfb2917..208e811ebf47 100644 --- a/tutorial/consuming_packages/different_configurations.rst +++ b/tutorial/consuming_packages/different_configurations.rst @@ -168,7 +168,7 @@ using the ``--options`` argument. To do so, please run: .. code-block:: bash - $ conan install . --output-folder=build --build=missing --options=zlib/1.2.11:shared=True + $ conan install . --output-folder=build --build=missing --options=zlib/1.3.1:shared=True Doing this, Conan will install the *Zlib* shared libraries, generate the files to build with @@ -178,7 +178,7 @@ application. .. note:: Options are defined per-package. In this case we were defining that we wanted that specific - version of zlib/1.2.11 as a shared library. If we had other dependencies and we want all of + version of zlib/1.3.1 as a shared library. If we had other dependencies and we want all of our dependencies (whenever possible) as shared libraries, we would use ``-o *:shared=True``, with the ``*`` pattern that matches all package references. @@ -333,6 +333,7 @@ matched our specified configuration. .. seealso:: + - `JFrog Academy Conan 2 Essentials: Building For Multiple Configurations With Conan And CMake Presets `__ - :ref:`VirtualRunEnv reference ` - :ref:`Cross-compiling using --profile:build and --profile:host ` - :ref:`creating_packages_configure_options_settings` diff --git a/tutorial/consuming_packages/intro_to_versioning.rst b/tutorial/consuming_packages/intro_to_versioning.rst index 47450ecbde47..049d93a70f9a 100644 --- a/tutorial/consuming_packages/intro_to_versioning.rst +++ b/tutorial/consuming_packages/intro_to_versioning.rst @@ -96,9 +96,9 @@ We see it resolved to the latest available CMake package, with at least version Requirements zlib/1.2.12#87a7211557b6690ef5bf7fc599dd8349 - Cache Build requirements - cmake/3.22.6#f305019023c2db74d1001c5afa5cf362 - Downloaded + cmake/3.27.9#f305019023c2db74d1001c5afa5cf362 - Downloaded Resolved version ranges - cmake/[>3.10]: cmake/3.22.6 + cmake/[>3.10]: cmake/3.27.9 zlib/[~1.2]: zlib/1.2.12 @@ -218,5 +218,5 @@ allowed range ``zlib/[~1.2]``, because the ``conan.lock`` lockfile is forcing it .. seealso:: + - `JFrog Academy Conan 2 Essentials: Intro To Versioning `__ - :ref:`Introduction to Versioning` - diff --git a/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst b/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst index 2f06efb80b47..97ee69ac2dc2 100644 --- a/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst +++ b/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst @@ -10,10 +10,10 @@ In the previous examples, we declared our dependencies (*Zlib* and *CMake*) in a :caption: **conanfile.txt** [requires] - zlib/1.2.11 + zlib/1.3.1 [tool_requires] - cmake/3.22.6 + cmake/3.27.9 [generators] CMakeDeps @@ -50,10 +50,10 @@ Remember that in the previous examples the *conanfile.txt* had this information: :caption: **conanfile.txt** [requires] - zlib/1.2.11 + zlib/1.3.1 [tool_requires] - cmake/3.22.6 + cmake/3.27.9 [generators] CMakeDeps @@ -82,10 +82,10 @@ The equivalent of the *conanfile.txt* in the form of a Conan recipe could look l generators = "CMakeToolchain", "CMakeDeps" def requirements(self): - self.requires("zlib/1.2.11") + self.requires("zlib/1.3.1") def build_requirements(self): - self.tool_requires("cmake/3.22.6") + self.tool_requires("cmake/3.27.9") To create the Conan recipe, we declared a new class that inherits from the ``ConanFile`` @@ -100,9 +100,9 @@ class. This class has different class attributes and methods: call the :command:`conan install` command. In this case, we added **CMakeToolchain** and **CMakeDeps** as in the *conanfile.txt*. * In the **requirements()** method, we use the ``self.requires()`` method to declare the - *zlib/1.2.11* dependency. + *zlib/1.3.1* dependency. * In the **build_requirements()** method, we use the ``self.tool_requires()`` method to declare the - *cmake/3.22.6* dependency. + *cmake/3.27.9* dependency. .. note:: @@ -189,13 +189,13 @@ platform without adding more changes. generators = "CMakeToolchain", "CMakeDeps" def requirements(self): - self.requires("zlib/1.2.11") + self.requires("zlib/1.3.1") if self.settings.os == "Windows": self.requires("base64/0.4.0") def build_requirements(self): if self.settings.os != "Windows": - self.tool_requires("cmake/3.22.6") + self.tool_requires("cmake/3.27.9") def layout(self): # We make the assumption that if the compiler is msvc the @@ -281,10 +281,10 @@ CMake case, there's a :ref:`cmake_layout()` already defined in Con generators = "CMakeToolchain", "CMakeDeps" def requirements(self): - self.requires("zlib/1.2.11") + self.requires("zlib/1.3.1") def build_requirements(self): - self.tool_requires("cmake/3.22.6") + self.tool_requires("cmake/3.27.9") def layout(self): cmake_layout(self) @@ -334,7 +334,7 @@ Windows or that you want to use the system's CMake installation instead of using generators = "CMakeToolchain", "CMakeDeps" def requirements(self): - self.requires("zlib/1.2.11") + self.requires("zlib/1.3.1") # Add base64 dependency for Windows if self.settings.os == "Windows": @@ -343,7 +343,7 @@ Windows or that you want to use the system's CMake installation instead of using def build_requirements(self): # Use the system's CMake for Windows if self.settings.os != "Windows": - self.tool_requires("cmake/3.22.6") + self.tool_requires("cmake/3.27.9") .. _copy_resources_on_generate: @@ -396,7 +396,7 @@ demonstrates how to import bindings for the library depending on the graphics AP .. seealso:: + - `JFrog Academy Conan 2 Essentials: The Flexibility Of Using A conanfile.py `__ - :ref:`Using "cmake_layout" + "CMakeToolchain" + "CMakePresets feature" to build your project`. - :ref:`Understanding the Conan Package layout`. - :ref:`Documentation for all conanfile.py available methods`. - - Conditional generators in configure() diff --git a/tutorial/consuming_packages/use_tools_as_conan_packages.rst b/tutorial/consuming_packages/use_tools_as_conan_packages.rst index 085ca8ee2480..4816af20fed4 100644 --- a/tutorial/consuming_packages/use_tools_as_conan_packages.rst +++ b/tutorial/consuming_packages/use_tools_as_conan_packages.rst @@ -40,10 +40,10 @@ using CMake **v3.22.6**. :emphasize-lines: 4,5 [requires] - zlib/1.2.11 + zlib/1.3.1 [tool_requires] - cmake/3.22.6 + cmake/3.27.9 [generators] CMakeDeps @@ -52,12 +52,12 @@ using CMake **v3.22.6**. .. important:: - Please note that this *conanfile.txt* will install *zlib/1.2.11* and *cmake/3.22.6* + Please note that this *conanfile.txt* will install *zlib/1.3.1* and *cmake/3.27.9* separately. However, if Conan does not find a binary for Zlib in Conan Center and it needs to be built from sources, a CMake installation must already be present on your - system, because the ``cmake/3.22.6`` declared in your ``conanfile.txt`` only applies to + system, because the ``cmake/3.27.9`` declared in your ``conanfile.txt`` only applies to your current project, not all dependencies. - If you want to use that *cmake/3.22.6* to also build Zlib, when installing if + If you want to use that *cmake/3.27.9* to also build Zlib, when installing if necessary, you may add the ``[tool_requires]`` section to the profile you are using. Please check :ref:`the profile doc` for more information. @@ -103,36 +103,36 @@ You can check the output: .. code-block:: bash -------- Computing dependency graph ---------- - cmake/3.22.6: Not found in local cache, looking in remotes... - cmake/3.22.6: Checking remote: conancenter - cmake/3.22.6: Trying with 'conancenter'... + cmake/3.27.9: Not found in local cache, looking in remotes... + cmake/3.27.9: Checking remote: conancenter + cmake/3.27.9: Trying with 'conancenter'... Downloading conanmanifest.txt Downloading conanfile.py - cmake/3.22.6: Downloaded recipe revision 3e3d8f3a848b2a60afafbe7a0955085a + cmake/3.27.9: Downloaded recipe revision 3e3d8f3a848b2a60afafbe7a0955085a Graph root conanfile.txt: /Users/user/Documents/developer/conan/examples2/tutorial/consuming_packages/tool_requires/conanfile.txt Requirements - zlib/1.2.11#f1fadf0d3b196dc0332750354ad8ab7b - Cache + zlib/1.3.1#f1fadf0d3b196dc0332750354ad8ab7b - Cache Build requirements - cmake/3.22.6#3e3d8f3a848b2a60afafbe7a0955085a - Downloaded (conancenter) + cmake/3.27.9#3e3d8f3a848b2a60afafbe7a0955085a - Downloaded (conancenter) -------- Computing necessary packages ---------- Requirements - zlib/1.2.11#f1fadf0d3b196dc0332750354ad8ab7b:2a823fda5c9d8b4f682cb27c30caf4124c5726c8#48bc7191ec1ee467f1e951033d7d41b2 - Cache + zlib/1.3.1#f1fadf0d3b196dc0332750354ad8ab7b:2a823fda5c9d8b4f682cb27c30caf4124c5726c8#48bc7191ec1ee467f1e951033d7d41b2 - Cache Build requirements - cmake/3.22.6#3e3d8f3a848b2a60afafbe7a0955085a:f2f48d9745706caf77ea883a5855538256e7f2d4#6c519070f013da19afd56b52c465b596 - Download (conancenter) + cmake/3.27.9#3e3d8f3a848b2a60afafbe7a0955085a:f2f48d9745706caf77ea883a5855538256e7f2d4#6c519070f013da19afd56b52c465b596 - Download (conancenter) -------- Installing packages ---------- Installing (downloading, building) binaries... - cmake/3.22.6: Retrieving package f2f48d9745706caf77ea883a5855538256e7f2d4 from remote 'conancenter' + cmake/3.27.9: Retrieving package f2f48d9745706caf77ea883a5855538256e7f2d4 from remote 'conancenter' Downloading conanmanifest.txt Downloading conaninfo.txt Downloading conan_package.tgz Decompressing conan_package.tgz - cmake/3.22.6: Package installed f2f48d9745706caf77ea883a5855538256e7f2d4 - cmake/3.22.6: Downloaded package revision 6c519070f013da19afd56b52c465b596 - zlib/1.2.11: Already installed! + cmake/3.27.9: Package installed f2f48d9745706caf77ea883a5855538256e7f2d4 + cmake/3.27.9: Downloaded package revision 6c519070f013da19afd56b52c465b596 + zlib/1.3.1: Already installed! -------- Finalizing install (deploy, generators) ---------- conanfile.txt: Generator 'CMakeToolchain' calling 'generate()' @@ -241,6 +241,7 @@ the environment activation: .. seealso:: + - `JFrog Academy Conan 2 Essentials: Using Build Tools As Conan Packages `__ - :ref:`Using [system_tools] in your profiles `. - :ref:`Creating recipes for tool_requires: packaging build tools `. - :ref:`examples_graph_tool_requires_protobuf` diff --git a/tutorial/creating_packages.rst b/tutorial/creating_packages.rst index 6444762d4c69..cfefff26e015 100644 --- a/tutorial/creating_packages.rst +++ b/tutorial/creating_packages.rst @@ -33,6 +33,7 @@ peculiarities of different types of Conan packages like, for example, header-onl libraries, packages for pre-built binaries, packaging tools for building other packages or packaging your own applications. + .. toctree:: :maxdepth: 2 :caption: Table of contents @@ -47,3 +48,10 @@ packaging your own applications. creating_packages/define_package_information creating_packages/test_conan_packages creating_packages/other_types_of_packages + + +.. note:: + + The Conan 2 Essentials training course is available for free at the JFrog Academy, + which covers the same topics as this documentation but in a more interactive way. + You can access it `here `__. diff --git a/tutorial/creating_packages/add_dependencies_to_packages.rst b/tutorial/creating_packages/add_dependencies_to_packages.rst index c4012ce5ee44..a453313aecc4 100644 --- a/tutorial/creating_packages/add_dependencies_to_packages.rst +++ b/tutorial/creating_packages/add_dependencies_to_packages.rst @@ -156,5 +156,6 @@ That will propagate the necessary compilation flags and headers ``includedirs`` .. seealso:: + - `JFrog Academy Conan 2 Essentials: Dependencies, Generators And Building `__ - :ref:`Reference for requirements() method `. - :ref:`Introduction to versioning `. diff --git a/tutorial/creating_packages/build_packages.rst b/tutorial/creating_packages/build_packages.rst index d6bc840b0931..3354fe7eae28 100644 --- a/tutorial/creating_packages/build_packages.rst +++ b/tutorial/creating_packages/build_packages.rst @@ -300,4 +300,5 @@ CMake and on Linux and macOS using Autotools. This can be easily handled in the .. seealso:: + - `JFrog Academy Conan 2 Essentials: Dependencies, Generators And Building `__ - :ref:`Patching sources ` diff --git a/tutorial/creating_packages/configure_options_settings.rst b/tutorial/creating_packages/configure_options_settings.rst index 7e6ac275398f..cfe1013143a1 100644 --- a/tutorial/creating_packages/configure_options_settings.rst +++ b/tutorial/creating_packages/configure_options_settings.rst @@ -288,6 +288,7 @@ more detail. .. seealso:: + - `JFrog Academy Conan 2 Essentials: Configuring Settings And Options `__ - :ref:`Header-only packages`. - Check the binary compatibility :ref:`compatibility.py extension `. - Conan :ref:`package types`. diff --git a/tutorial/creating_packages/create_your_first_package.rst b/tutorial/creating_packages/create_your_first_package.rst index e14717bb8539..db2e95858057 100644 --- a/tutorial/creating_packages/create_your_first_package.rst +++ b/tutorial/creating_packages/create_your_first_package.rst @@ -336,6 +336,7 @@ An **important** note: the Conan cache is private to the Conan client - modifyin .. seealso:: + - `JFrog Academy Conan 2 Essentials: Creating Your First Conan Package `__ - :ref:`Create your first Conan package with Visual Studio/MSBuild`. - :ref:`Create your first Conan package with Meson`. - :ref:`Create your first Conan package with Autotools (only Linux)`. diff --git a/tutorial/creating_packages/define_package_information.rst b/tutorial/creating_packages/define_package_information.rst index 39b15de0481f..b2cc74fb0a46 100644 --- a/tutorial/creating_packages/define_package_information.rst +++ b/tutorial/creating_packages/define_package_information.rst @@ -345,6 +345,7 @@ example` in the examples section. .. seealso:: + - `JFrog Academy Conan 2 Essentials: The package() And package_info() Methods `__ - :ref:`Propagating environment and configuration information to consumers example` - :ref:`Define components for Conan packages that provide multiple libraries example` - :ref:`package_info() reference` diff --git a/tutorial/creating_packages/handle_sources_in_packages.rst b/tutorial/creating_packages/handle_sources_in_packages.rst index 6d36bbd01f35..81cf133ea463 100644 --- a/tutorial/creating_packages/handle_sources_in_packages.rst +++ b/tutorial/creating_packages/handle_sources_in_packages.rst @@ -251,6 +251,7 @@ zip file has the correct ``sha256``. So we could modify the source method to thi .. seealso:: + - `JFrog Academy Conan 2 Essentials: `__ - :ref:`Patching sources` - :ref:`Capturing Git SCM source information` instead of copying sources with ``exports_sources``. - :ref:`source() method reference` diff --git a/tutorial/creating_packages/other_types_of_packages/header_only_packages.rst b/tutorial/creating_packages/other_types_of_packages/header_only_packages.rst index b421a42fcf21..1e124148c26a 100644 --- a/tutorial/creating_packages/other_types_of_packages/header_only_packages.rst +++ b/tutorial/creating_packages/other_types_of_packages/header_only_packages.rst @@ -260,3 +260,7 @@ We can run ``conan create`` again specifying a different ``compiler.cppstd`` and We could call ``conan install --require sum/0.1`` with an empty profile and would get the binary package from the server. But if we miss the binary and we need to build the package again, it will fail because of the lack of settings. + +.. seealso:: + + - `JFrog Academy Conan 2 Essentials: Creating A Recipe For Header-Only Libraries `__ diff --git a/tutorial/creating_packages/other_types_of_packages/package_prebuilt_binaries.rst b/tutorial/creating_packages/other_types_of_packages/package_prebuilt_binaries.rst index 82fdb8b2c8ea..71b64acd4e74 100644 --- a/tutorial/creating_packages/other_types_of_packages/package_prebuilt_binaries.rst +++ b/tutorial/creating_packages/other_types_of_packages/package_prebuilt_binaries.rst @@ -403,3 +403,7 @@ package could be to define a :command:`build_policy="missing"`, especially if th under the team's control. If they are external (on the internet), it could be better to create the packages and store them on your own Conan repository, so that the builds do not rely on third-party URLs being available. + +.. seealso:: + + - `JFrog Academy Conan 2 Essentials: Creating a Recipe For Prebuilt Binaries `__ diff --git a/tutorial/creating_packages/other_types_of_packages/tool_requires_packages.rst b/tutorial/creating_packages/other_types_of_packages/tool_requires_packages.rst index 5e2903e2c333..10ddb16d10f3 100644 --- a/tutorial/creating_packages/other_types_of_packages/tool_requires_packages.rst +++ b/tutorial/creating_packages/other_types_of_packages/tool_requires_packages.rst @@ -236,6 +236,7 @@ then the approach would be not removing the ``del self.info.settings.build_type` .. seealso:: + - `JFrog Academy Conan 2 Essentials: Creating Tool Require Packages `__ - :ref:`examples_graph_tool_requires_protobuf` - Toolchains (compilers) - :ref:`Usage of runenv_info` diff --git a/tutorial/creating_packages/package_method.rst b/tutorial/creating_packages/package_method.rst index 30a5e7db21b6..dc325ffcf4c7 100644 --- a/tutorial/creating_packages/package_method.rst +++ b/tutorial/creating_packages/package_method.rst @@ -170,4 +170,5 @@ absolute links into relative paths and make the package relocatable. .. seealso:: + - `JFrog Academy Conan 2 Essentials: The package() And package_info() Methods `__ - :ref:`package() method reference` diff --git a/tutorial/creating_packages/preparing_the_build.rst b/tutorial/creating_packages/preparing_the_build.rst index 384f1157d0fd..7c408d0bba07 100644 --- a/tutorial/creating_packages/preparing_the_build.rst +++ b/tutorial/creating_packages/preparing_the_build.rst @@ -194,5 +194,6 @@ could do in the ``generate()`` method like: .. seealso:: + - `JFrog Academy Conan 2 Essentials: Dependencies, Generators And Building `__ - Use the ``generate()`` method to :ref:`import files from dependencies`. - :ref:`generate() method reference` diff --git a/tutorial/creating_packages/test_conan_packages.rst b/tutorial/creating_packages/test_conan_packages.rst index d86b4107046b..b9fe7d4bc9cb 100644 --- a/tutorial/creating_packages/test_conan_packages.rst +++ b/tutorial/creating_packages/test_conan_packages.rst @@ -159,3 +159,7 @@ test` command: As you can see in the output, our *test_package* builds successfully testing that the *hello/1.0* Conan package can be consumed with no problem. + +.. seealso:: + + - `JFrog Academy Conan 2 Essentials: Testing Conan Packages `__ diff --git a/tutorial/developing_packages/workspaces.rst b/tutorial/developing_packages/workspaces.rst index c374314e0530..6b5e781fbc07 100644 --- a/tutorial/developing_packages/workspaces.rst +++ b/tutorial/developing_packages/workspaces.rst @@ -20,7 +20,7 @@ Introduction A Conan *workspace* gives you the chance to manage several packages as ``editable`` mode in an -*orchestrated* or *monolithic* (also called *super-project*) way: +*orchestrated* or *monolithic* (also called *super-build*) way: * *orchestrated*, we denote Conan building the editable packages one by one starting on the applications/consumers if exist. * *monolithic*, we denote the editable packages built as a monolith, generating a single result (generators, etc) for the whole workspace. @@ -55,7 +55,7 @@ Let's see it with an example: .. code-block:: bash $ conan new workspace - $ conan workspace install + $ conan workspace super-install $ cmake --preset conan-release # use conan-default in Win $ cmake --build --preset conan-release @@ -171,7 +171,7 @@ The other important part is the ``conanws.py`` file: The role of the ``class MyWs(ConanFile)`` embedded conanfile is important, it defines the super-project necessary generators and layout. -The ``conan workspace install`` does not install the different editables separately, for +The ``conan workspace super-install`` does not install the different editables separately, for this command, the editables do not exist, they are just treated as a single "node" in the dependency graph, as they will be part of the super-project build. So there is only a single generated ``conan_toolchain.cmake`` and a single common set of dependencies @@ -186,7 +186,7 @@ the same when there are external dependencies. This can be tested with: $ conan new cmake_lib -d name=mymath $ conan create . $ conan new workspace -d requires=mymath/0.1 - $ conan workspace install + $ conan workspace super-install $ cmake ... diff --git a/tutorial/versioning.rst b/tutorial/versioning.rst index 31158c68efa8..d7f9f195751c 100644 --- a/tutorial/versioning.rst +++ b/tutorial/versioning.rst @@ -33,3 +33,10 @@ errors and how to address them. versioning/revisions versioning/lockfiles versioning/conflicts + + +.. note:: + + The Conan 2 Essentials training course is available for free at the JFrog Academy, + which covers the same topics as this documentation but in a more interactive way. + You can access it `here `__.