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

:::success Warning
这是一项实验性功能,可能会在将来的发行版中进行重大更改。 :::

conan info 提供了--json参数来生成包含命令输出的文件。
根据其他参数,有几种可能的输出:

Build order

:::success Warning
不建议使用conan info --build-order命令,而建议使用conan graph构建顺序。 :::

用参数—build-order打印的构建顺序可以格式化为JSON。 它将显示一个列表列表,其中每个嵌套列表中的引用都可以并行构建。

build_order.json

  1. {
  2. "groups":[
  3. [
  4. "liba/0.1@lasote/stable",
  5. "libe/0.1@lasote/stable",
  6. "libf/0.1@lasote/stable"
  7. ],
  8. [
  9. "libb/0.1@lasote/stable",
  10. "libc/0.1@lasote/stable"
  11. ]
  12. ]
  13. }

Nodes to build

当使用参数—build调用时,它将根据构建策略检索要构建的节点列表。 输出将只是参考列表。

nodes_to_build.json

  1. [
  2. "h0/0.1@lu/st",
  3. "h1a/0.1@lu/st",
  4. "h1c/0.1@lu/st",
  5. "h2a/0.1@lu/st",
  6. "h2c/0.1@lu/st"
  7. ]

Info output

通过引用或路径的柯南信息调用的输出给出了有关其构建图中涉及的所有节点的信息; 生成的JSON文件将包含一个列表,其中包含每个节点的信息。

info.json

  1. [
  2. {
  3. "reference":"liba/0.1@lasote/stable",
  4. "is_ref":true,
  5. "display_name":"liba/0.1@lasote/stable",
  6. "id":"8da7d879f40d12efabc9a1f26ab12f1b6cafb6ad",
  7. "build_id":null,
  8. "url":"myurl",
  9. "license":[
  10. "MIT"
  11. ],
  12. "description": "project A",
  13. "recipe":"No remote",
  14. "binary":"Missing",
  15. "creation_date":"2019-01-29 17:22:41",
  16. "required_by":[
  17. "libc/0.1@lasote/stable",
  18. "libb/0.1@lasote/stable"
  19. ]
  20. },
  21. {
  22. "reference":"libb/0.1@lasote/stable",
  23. "is_ref":true,
  24. "display_name":"libb/0.1@lasote/stable",
  25. "id":"c4ec2bf350e2a02405029ab366535e26372a4f63",
  26. "build_id":null,
  27. "url":"myurl",
  28. "license":[
  29. "MIT"
  30. ],
  31. "description": "project C",
  32. "recipe":"No remote",
  33. "binary":"Missing",
  34. "creation_date":"2019-01-29 17:22:41",
  35. "required_by":[
  36. "conanfile.py (libd/0.1@None/None)"
  37. ],
  38. "requires":[
  39. "liba/0.1@lasote/stable",
  40. "libe/0.1@lasote/stable"
  41. ]
  42. },
  43. { "...": "..."}
  44. ]

:::info Note
由于这被标记为实验性的,因此某些字段可能会被删除或添加。 :::