本文档翻译自:https://docs.conan.io/en/latest/reference/commands/creator/export.html
$ conan export [-h] [-k] [-l [LOCKFILE]] [--ignore-dirty]
path [reference]
将配方(conanfile.py和关联文件)复制到本地缓存。
使用”引用”参数来指定用户和导出位置。 一旦配方进入本地缓存,就可以使用”conan upload”命令将其共享,重复使用并分发到任何远程服务器。
positional arguments:
path Path to a folder containing a conanfile.py or to a
recipe file e.g., my_folder/conanfile.py
reference user/channel, or Pkg/version@user/channel (if name and
version are not declared in the conanfile.py
optional arguments:
-h, --help show this help message and exit
-k, -ks, --keep-source
Do not remove the source folder in the local cache,
even if the recipe changed. Use this for testing
purposes only
-l [LOCKFILE], --lockfile [LOCKFILE]
Path to a lockfile or folder containing 'conan.lock'
file. Lockfile will be updated with the exported
package
--ignore-dirty When using the "scm" feature with "auto" values,
capture the revision and url even if there are
uncommitted changes
参考字段可以是:
完整的软件包参考:pkg/version@user/channel
。 在这种情况下,配方无需声明名称或版本。 如果配方声明了它们,则它们应与命令行中提供的值匹配。
user和channel:user/channel。 该命令将假定配方提供名称和版本。
version,user和channel:version@user/channel。 配方必须提供名称,如果提供了版本,则必须与命令行之一匹配。
官方挂钩存储库中还有一个”recipe_linter”挂钩,可以将其激活以在导出配方时对它们执行自动棉绒检查。
Examples
使用完整参考导出配方。 仅当配方中未声明名称和版本时才有效:
$ conan export . mylib/1.0@myuser/channel
从myuser / stable用户和通道下的任何文件夹目录导出配方:
$ conan export ./folder_name myuser/stable
导出配方而不删除本地缓存中的源文件夹:
$ conan export . fenix/stable -k