Skip to content

Commit

Permalink
Automatic deploy (build number 491)
Browse files Browse the repository at this point in the history
  • Loading branch information
ConanCI bot committed May 23, 2023
1 parent 7364a3c commit ab66add
Show file tree
Hide file tree
Showing 475 changed files with 677 additions and 495 deletions.
2 changes: 1 addition & 1 deletion 2.0/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ <h1>Page Not Found<a class="headerlink" href="#page-not-found" title="Permalink
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/Page Not Found.html
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ <h1>Page not found</h1>
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ Important classes to manage user input and user output:
Conan public API
++++++++++++++++

.. include:: ../../../../common/experimental_warning.inc

The most important part of this example is the usage of the Conan API via ``conan_api`` parameter. These are some examples
which are being used in this custom command:

Expand Down
59 changes: 52 additions & 7 deletions 2.0/_sources/reference/extensions/custom_commands.rst.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _reference_commands_custom_commands:

Custom commands
=================
===============

It's possible to create your own Conan commands to solve self-needs thanks to Python and Conan public API powers altogether.

Expand All @@ -17,7 +17,7 @@ existing Conan one: :command:`conan your_command_name`.


Scoping
++++++++++
+++++++

It's possible to have another folder layer to group some commands under the same topic.

Expand Down Expand Up @@ -87,7 +87,7 @@ Main decorator to declare a function as a new Conan command. Where the parameter


conan_subcommand(formatters=None)
++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++

Similar to ``conan_command``, but this one is declaring a sub-command of an existing custom command. For instance:

Expand Down Expand Up @@ -120,8 +120,53 @@ The command call looks like :command:`conan hello moon`.
Notice that to declare a sub-command is required an empty Python function acts as the main command.


Formatters arguments
++++++++++++++++++++
Argument definition and parsing
-------------------------------

Commands can define their own arguments with the ``argparse`` Python library.


.. code-block:: python
@conan_command(group='Creator')
def build(conan_api, parser, *args):
"""
Command help
"""
parser.add_argument("path", nargs="?", help='help for command')
add_reference_args(parser)
args = parser.parse_args(*args)
# Use args.path
When there are sub-commands, the base command cannot define arguments, only the sub-commands can do it. If you have a set of common arguments to all sub-commands, you can define a function that adds them.

.. code-block:: python
@conan_command(group="MyGroup")
def mycommand(conan_api, parser, *args):
"""
Command help
"""
# Do not define arguments in the base command
pass
@conan_subcommand()
def mycommand_mysubcommand(conan_api: ConanAPI, parser, subparser, *args):
"""
Subcommand help
"""
# Arguments are added to "subparser"
subparser.add_argument("reference", help="Recipe reference or Package reference")
# You can add common args with your helper
# add_my_common_args(subparser)
# But parsing all of them happens to "parser"
args = parser.parse_args(*args)
# use args.reference
Formatters
----------

The return of the command will be passed as argument to the formatters. If there are different formatters that
require different arguments, the approach is to return a dictionary, and let the formatters chose the
Expand Down Expand Up @@ -152,8 +197,8 @@ arguments they need. For example, the ``graph info`` command uses several format
"conan_api": conan_api}
Command function arguments
----------------------------
Commands parameters
-------------------

These are the passed arguments to any custom command and its sub-commands functions:

Expand Down
2 changes: 1 addition & 1 deletion 2.0/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ <h2>2.0.0-beta1 (20-Jun-2022)<a class="headerlink" href="#beta1-20-jun-2022" tit
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
Binary file modified 2.0/conan.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion 2.0/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/conanfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/conanfile/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/conanfile/layout/conanfile_in_subfolder.html
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/conanfile/layout/editable_components.html
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/conanfile/layout/multiple_subprojects.html
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/conanfile/layout/third_party_libraries.html
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/conanfile/package_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/conanfile/package_info/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/config_files.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/config_files/settings/settings_user.html
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ <h2>Use your new settings<a class="headerlink" href="#use-your-new-settings" tit
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/cross_build.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/cross_build/android/android_studio.html
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ <h2>Building the application<a class="headerlink" href="#building-the-applicatio
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/cross_build/android/ndk.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ <h2>Read more<a class="headerlink" href="#read-more" title="Permalink to this he
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/dev_flow.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/dev_flow/debug/step_into_dependencies.html
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ <h2>Step into a dependency with Visual Studio<a class="headerlink" href="#step-i
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/extensions.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ <h3>User input and user output<a class="headerlink" href="#user-input-and-user-o
</div>
<div class="section" id="conan-public-api">
<h3>Conan public API<a class="headerlink" href="#conan-public-api" title="Permalink to this headline"></a></h3>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This feature is experimental and subject to breaking changes.</p>
</div>
<p>The most important part of this example is the usage of the Conan API via <code class="docutils literal notranslate"><span class="pre">conan_api</span></code> parameter. These are some examples
which are being used in this custom command:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">conan_api</span><span class="o">.</span><span class="n">remotes</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">args</span><span class="o">.</span><span class="n">remote</span><span class="p">)</span>
Expand Down Expand Up @@ -437,7 +441,7 @@ <h3>Conan public API<a class="headerlink" href="#conan-public-api" title="Permal
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/extensions/commands/custom_commands.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/extensions/deployers/builtin_deployers.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/extensions/deployers/custom_deployers.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ <h3>deploy()<a class="headerlink" href="#deploy" title="Permalink to this headli
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/graph/tool_requires/different_options.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ <h1>Depending on same version of a tool-require with different options<a class="
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/graph/tool_requires/different_versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ <h1>Depending on different versions of the same tool-require<a class="headerlink
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 2.0/examples/tools.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2016-2023, JFrog.
Last updated on May 19, 2023.
Last updated on May 23, 2023.
<span><a href="#" class="ot-sdk-show-settings">Cookies Settings</a></span>
</p>
</div>
Expand Down
Loading

0 comments on commit ab66add

Please sign in to comment.