本文档翻译自:https://docs.conan.io/en/latest/reference/commands/development/editable.html

管理可编辑程序包(驻留在用户工作区中的程序包,但是像在高速缓存中一样被使用)。
使用子命令“添加”,“删除”和“列表”来创建,删除或列出当前在此模式下安装的软件包。

  1. positional arguments:
  2. {add,remove,list} sub-command help
  3. add Put a package in editable mode
  4. remove Disable editable mode for a package
  5. list List packages in editable mode
  6. optional arguments:
  7. -h, --help show this help message and exit

conan editable add

  1. $ conan editable add [-h] [-l LAYOUT] path reference

在用户文件夹中以可编辑模式打开包

  1. positional arguments:
  2. path Path to the package folder in the user workspace
  3. reference Package reference e.g.: mylib/1.X@user/channel
  4. optional arguments:
  5. -h, --help show this help message and exit
  6. -l LAYOUT, --layout LAYOUT
  7. Relative or absolute path to a file containing the
  8. layout. Relative paths will be resolved first relative
  9. to current dir, then to local cache "layouts" folder

此命令将程序包置于“可编辑模式”,并且该程序包的使用者将从给定的用户文件夹中使用它,而不是从缓存中使用它。 path指向的路径应该存在并且包含conanfile.py。
示例:使用文件win_layout指定的布局,将包cool / version @ user / dev置于可编辑模式。

  1. $ conan editable add . cool/version@user/dev --layout=win_layout

conan editable remove

  1. $ conan editable remove [-h] reference

删除软件包引用的可编辑模式。

  1. positional arguments:
  2. reference Package reference e.g.: mylib/1.X@user/channel
  3. optional arguments:
  4. -h, --help show this help message and exit

示例:删除“可编辑模式”,从缓存中再次使用包:

  1. $ conan editable remove cool/version@user/dev

conan editable list

  1. $ conan editable list [-h]

显示以“可编辑”模式打开的软件包的列表。