本文档翻译自:https://docs.conan.io/en/latest/reference/commands/output/install.html
:::success
Warning**
这是一项实验性功能,可能会在将来的发行版中进行重大更改。
:::
conan install
和conan create
提供了--json
参数来生成包含安装过程信息的文件。
输出JSON包含两个第一级密钥:
- error:如果安装成功完成且没有错误,则为
True
,否则为False
。 - installed:已安装软件包的列表。每个元素包含:
- recipe:代表下载配方的文档。
- remote:远程URL(如果已下载配方)。否则为null。
- cache:
true
/false
。从缓存中检索(未下载)。 - downloaded:
true
/false
。从远程下载(不在缓存中)。 - time:
ISO 8601
字符串以及下载/检索配方的时间。 - error:
true
/false
。 - id:参考。例如“ openssl / 1.0.2u”
- name:打包库的名称。例如“ openssl”
- version:打包库的版本。例如“ 1.0.2u”
- user:打包库的用户。例如“柯南”
- channel:打包库的通道。例如“稳定”
- dependency:
true
/false
。是要安装/创建的软件包还是依赖项。与develop conanfile属性相同。
- packages:元素列表,代表为配方下载的二进制软件包。通常,此列表中只有1个元素,只有在特殊情况下,如果有构建要求,被此列表覆盖的私有依赖项和设置,可能会有多个元素。
- remote:远程URL(如果已下载配方)。否则为
null
。 - cache:
true
/false
。从缓存中检索(未下载)。 - downloaded:
true
/false
。从远程下载(不在缓存中)。 - time:ISO 8601字符串以及下载/检索配方的时间。
- error:
true
/false
。 - id:包ID。例如“ 8018a4df6e7d2b4630a814fa40c81b85b9182d2b”
- cpp_info:字典,包含在配方的
package_info
方法中定义的构建信息。
- remote:远程URL(如果已下载配方)。否则为
- recipe:代表下载配方的文档。
Example:
$ conan install openssl/1.0.2u@ --json install.json
install.json¶
{
"error": false,
"installed": [{
"recipe": {
"id": "openssl/1.0.2u",
"downloaded": true,
"exported": false,
"error": null,
"remote": "https://conan.bintray.com",
"time": "2020-01-30T19:19:21.217923",
"dependency": true,
"name": "openssl",
"version": "1.0.2u",
"user": null,
"channel": null
},
"packages": [{
"id": "f99afdbf2a1cc98ba2029817b35103455b6a9b77",
"downloaded": true,
"exported": false,
"error": null,
"remote": "https://conan.bintray.com",
"time": "2020-01-30T19:19:27.662199",
"built": false,
"cpp_info": {
"name": "openssl",
"names": {
"cmake_find_package": "OpenSSL",
"cmake_find_package_multi": "OpenSSL"
},
"includedirs": ["include"],
"libdirs": ["lib"],
"resdirs": ["res"],
"bindirs": ["bin"],
"builddirs": [""],
"frameworkdirs": ["Frameworks"],
"libs": ["ssl", "crypto", "dl", "pthread"],
"rootpath": "/home/user/.conan/data/openssl/1.0.2u/_/_/package/f99afdbf2a1cc98ba2029817b35103455b6a9b77",
"version": "1.0.2u",
"description": "A toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols",
"filter_empty": true,
"public_deps": ["zlib"]
}
}]
}, {
"recipe": {
"id": "zlib/1.2.11#1cd4a227e1b846f961bf91fcb6f3980f",
"downloaded": false,
"exported": false,
"error": null,
"remote": null,
"time": "2020-01-30T19:19:21.237131",
"dependency": true,
"name": "zlib",
"version": "1.2.11",
"user": null,
"channel": null
},
"packages": [{
"id": "6af9cc7cb931c5ad942174fd7838eb655717c709",
"downloaded": false,
"exported": false,
"error": null,
"remote": null,
"time": "2020-01-30T19:19:22.061885",
"built": false,
"cpp_info": {
"name": "ZLIB",
"includedirs": ["include"],
"libdirs": ["lib"],
"resdirs": ["res"],
"bindirs": ["bin"],
"builddirs": [""],
"frameworkdirs": ["Frameworks"],
"libs": ["z"],
"rootpath": "/home/user/.conan/data/zlib/1.2.11/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709",
"version": "1.2.11",
"description": "A Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also Free, Not to Mention Unencumbered by Patents)",
"filter_empty": true
}
}]
}]
}
:::info
Note
由于这被标记为实验性的,因此可能会删除或添加一些字段:cpp_info中的字段版本和说明最终将被删除,并且绝对值的路径可能会更改。
:::