cordova插件文件夹中的fetch.json文件的目的是什么? [英] What is the purpose of fetch.json file inside cordova plugins folder?
问题描述
文件 fetch.json 在第一次执行 cordova插件添加之后在插件文件夹中创建。
File fetch.json created inside plugins folder after cordova plugin add executed first time. This file also modified each time I add/remove plugins.
- 此文件的目的是什么?
- 有没有办法使用fetch.json来恢复插件(尽量不要将插件放入存储库)?
- 我在哪里可以找到关于此文件内容的文档?
<
- What purpose of this file exactly?
- What tools use this file, when and why?
- Is there a way to restore plugins using fetch.json (try not to place plugins into repositiory)?
- Where can I find some docs about content of this file?
fetch.json的内容:
Content of fetch.json:
{
"com.phonegap.plugins.PushPlugin": {
"source": {
"type": "git",
"url": "https://github.com/phonegap-build/PushPlugin.git",
"subdir": "."
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-file": {
"source": {
"type": "registry",
"id": "cordova-plugin-file"
},
"is_top_level": true,
"variables": {}
}
}
推荐答案
看起来像这个文件跟踪已安装的插件,其来源和修订,如npm package.json依赖,但对于plugman。
Looks like this file tracks installed plugins, their origin and revision, like npm package.json dependencies does, but for plugman. I guess and hope this should migrate to the npm standard soon.
此文件在cordova添加/删除插件( https://github.com/apache/cordova-lib/blob/e4e5904619bab05705d62bce92a4c4cd0d45bb82/ cordova-lib / src / cordova / plugin.js#L272 )
This file is updated on cordova add/remove plugins (https://github.com/apache/cordova-lib/blob/e4e5904619bab05705d62bce92a4c4cd0d45bb82/cordova-lib/src/cordova/plugin.js#L272)
当我们 cordova准备
,cordova从 plugins / ios.json
(对于ios)读取插件列表,然后对每一个:
When we cordova prepare
, cordova reads plugin list from plugins/ios.json
(for ios), then, for each one :
- 从
plugins / fetch.json
获取插件信息 - 尝试在本地查找插件
- get the plugin infos from
plugins/fetch.json
- try to find the plugin locally
看起来像无法使用此文件恢复插件。我的工作流程是:
looks like its not possible to restore plugins with this file. My workflow is :
- 在config.xml中定义插件依赖
- 远程平台和空插件文件夹
- 运行
cordova平台add xxx
- define plugins dependencies in config.xml
- remote platforms and empty plugins folder
- run
cordova platform add xxx
这将按照 config.xml中定义的方式重新提取插件
看起来像是唯一的文档是源代码: https://github.com/apache/ cordova-lib / search?utf8 =%E2%9C%93& q = fetch
Looks like the only doc is the source code : https://github.com/apache/cordova-lib/search?utf8=%E2%9C%93&q=fetch
这篇关于cordova插件文件夹中的fetch.json文件的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!