未验证 提交 b89152c8 编写于 作者: O openharmony_ci 提交者: Gitee

!16656 【挑单3.2-Release】翻译完成 16453:IDE最新的版本package.json文件变更为oh-package.json5,资料适配修改

Merge pull request !16656 from ester.zhou/cherry-pick-1680071714
......@@ -30,7 +30,7 @@ When obfuscation is enabled, DevEco Studio compiles, obfuscates, and compresses
- The HAR of the stage model cannot reference content in the **AppScope** folder. This is because the content in the **AppScope** folder is not packaged into the HAR during compilation and building.
## Exporting ArkUI Components, APIs, and Resources of the HAR
The **index.ets** file acts as the entry of the HAR export declaration file and is where the HAR exports APIs. This file is automatically generated by DevEco Studio by default. You can specify another file as the entry declaration file in the **main** field in the **package.json** file of the module. The code snippet is as follows:
The **index.ets** file acts as the entry of the HAR export declaration file and is where the HAR exports APIs. This file is automatically generated by DevEco Studio by default. You can specify another file as the entry declaration file in the **main** field in the **oh-package.json5** file of the module. The code snippet is as follows:
```json
{
"main": "index.ets"
......
......@@ -15,7 +15,7 @@ library
│ │ └── index.ets
│ ├── resources
│ └── module.json5
└── package.json
└── oh-package.json5
```
In the **module.json5** file, set **type** to **shared** for the HSP.
```json
......@@ -24,7 +24,7 @@ In the **module.json5** file, set **type** to **shared** for the HSP.
}
```
The HSP provides capabilities for external systems by exporting APIs in the entry file. Specify the entry file in **main** in the **package.json** file. For example:
The HSP provides capabilities for external systems by exporting APIs in the entry file. Specify the entry file in **main** in the **oh-package.json5** file. For example:
```json
{
"main": "./src/main/ets/index.ets"
......@@ -103,9 +103,9 @@ export { nativeMulti } from './utils/nativeTest'
```
## Using the In-Application HSP
To use APIs in the HSP, first configure the dependency on the HSP in the **package.json** file of the module that needs to call the APIs (called the invoking module). If the HSP and the invoking module are in the same project, the APIs can be referenced locally. The sample code is as follows:
To use APIs in the HSP, first configure the dependency on the HSP in the **oh-package.json5** file of the module that needs to call the APIs (called the invoking module). If the HSP and the invoking module are in the same project, the APIs can be referenced locally. The sample code is as follows:
```json
// entry/src/main/module.json5
// entry/oh-package.json5
"dependencies": {
"library": "file:../library"
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册