conan export

$ conan export -h
usage: conan export [-h] [-v [V]] [-cc CORE_CONF] [-f FORMAT] [--name NAME]
                    [--version VERSION] [--user USER] [--channel CHANNEL]
                    [-r REMOTE | -nr] [-l LOCKFILE]
                    [--lockfile-out LOCKFILE_OUT] [--lockfile-partial]
                    [--build-require]
                    path

Export a recipe to the Conan package cache.

positional arguments:
  path                  Path to a folder containing a recipe (conanfile.py)

options:
  -h, --help            show this help message and exit
  -v [V]                Level of detail of the output. Valid options from less
                        verbose to more verbose: -vquiet, -verror, -vwarning,
                        -vnotice, -vstatus, -v or -vverbose, -vv or -vdebug,
                        -vvv or -vtrace
  -cc CORE_CONF, --core-conf CORE_CONF
                        Define core configuration, overwriting global.conf
                        values. E.g.: -cc core:non_interactive=True
  -f FORMAT, --format FORMAT
                        Select the output format: json, pkglist
  --name NAME           Provide a package name if not specified in conanfile
  --version VERSION     Provide a package version if not specified in
                        conanfile
  --user USER           Provide a user if not specified in conanfile
  --channel CHANNEL     Provide a channel if not specified in conanfile
  -r REMOTE, --remote REMOTE
                        Look in the specified remote or remotes server
  -nr, --no-remote      Do not use remote, resolve exclusively in the cache
  -l LOCKFILE, --lockfile LOCKFILE
                        Path to a lockfile.
  --lockfile-out LOCKFILE_OUT
                        Filename of the updated lockfile
  --lockfile-partial    Do not raise an error if some dependency is not found
                        in lockfile
  --build-require       Whether the provided reference is a build-require

conan export 命令将 path 中指定的配方导出到 Conan 包缓存。

输出格式

conan export 命令接受两种格式的 --format 参数

  • json:创建一个包含导出配方引用的信息的 JSON 文件。

  • pkglist:生成一个 pkglist 格式的 JSON 文件,该文件可用作各种命令(如 uploaddownloadremove)的输入。