harmony 鸿蒙Converting HSP to HAR
Converting HSP to HAR
The HSP has requirements on the consistency of bundle names and signatures and the HSP file needs to be installed in the debugging phase. As a result, many integration problems occur in multi-module integration development. In this case, you are advised to use the HAR file to avoid these problems. This topic describes how to convert an HSP project to an HAR project by changing the configuration items.
How to Convert
In the module.json5 file of the HSP module, change the value of the type field to har and delete the deliveryWithInstall and pages fields.
json // MyApplication\library\src\main\module.json5 { "module": { "name": "har", "type": "har", "deviceTypes": [ "default", "tablet", "2in1" ] } }
Delete the main_pages.json file from the resource\base\profile folder.
Replace the content in the hvigorfile.ts file of the HSP module with the following content:
// MyApplication\library\hvigorfile.ts import { harTasks } from '@ohos/hvigor-ohos-plugin'; export default { system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ }
Delete the packageType configuration from the oh-package.json5 file.
Modify the project-level build-profile.json5 configuration file and delete targets from the HSP configuration in the modules module.
你可能感兴趣的鸿蒙文章
harmony 鸿蒙Creating an Application Clone
harmony 鸿蒙app.json5 Configuration File
harmony 鸿蒙Structure of the app Tag
harmony 鸿蒙Overview of Application Configuration Files in FA Model
harmony 鸿蒙Overview of Application Configuration Files in Stage Model
harmony 鸿蒙Application Installation, Uninstall, and Update
harmony 鸿蒙Application Package Overview
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦