同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
A basic bundle.json file needs to be enriched by bundle dependencies to implement more complex features. Bundle names and version numbers should be defined in the dependencies field of bundle.json.
{
"name": "my-bundle",
"version": "1.0.0",
"dependencies": {
"net": "1.0.0"
}
}
In this example, my-bundle depends on net 1.0.0. After you globally install the hpm-cli tool, run the following command to obtain bundle dependencies from the remote repository:
hpm install
Bundle dependencies are then stored in the ohos_bundles folder in the root directory of the current bundle. A tree structure illustrating the bundle and its dependencies will be generated. You need to run the following command in the root directory of the bundle:
username@server MINGW64 /f/showcase/demo/demo
$ hpm list
+--demo@1.0.0
| +--@huawei/media@1.0.2
| +--@demo/sport_hi3518ev300_liteos_a@1.0.0
| | +--@demo/app@4.0.1
| | | +--@demo/build@4.0.1
| | | +--@demo/arm_harmonyeabi_gcc@4.0.0
| | +--@demo/liteos_a@4.0.0
| | | +--@demo/third_party_fatfs@4.0.0
| | | +--@demo/arm_harmonyeabi_gcc@4.0.0
| | +--@demo/init@4.0.0
| | +--@demo/dist_tools@4.0.0
Alternatively, you can view the dependencies of the current bundle in a graph by running the following command:
hpm dependencies
A deps_visual folder is generated in the current directory. The folder contains the deps.html and deps-data.js files. After you open the deps.html file via a browser, you can view bundle dependencies illustrated by a graph, as shown in the following figure.
Each dependency type is indicated by a different color at the corresponding node. You can move the mouse pointer to a node to view the implied information.
You can use the hpm-cli tool to manage the lifecycle of a bundle. The following table describes available HPM commands. (You can run the hpm -h command to get the command details).
Table 1 HPM commands
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。