想了解更多关于开源的起学内容,请访问:
51CTO 开源基础软件社区
https://ost.51cto.com
在开源鸿蒙系统下
.
├── example
│ ├── BluetoothTest
│ │ ├── build-profile.json5
│ │ ├── hvigorfile.js
│ │ ├── package.json
│ │ ├── package-lock.json
│ │ ├── BUILD.gn
│ │ ├── entry/src/main
│ │ │ ├── config.json
│ │ │ ├── ets
│ │ │ │ ├── Component
│ │ │ │ ├── MainAbility
│ │ │ │ │ ├── app.ets
│ │ │ │ │ ├── controller
│ │ │ │ │ ├── model
│ │ │ │ │ ├── pages
│ │ │ │ │ └── res
│ │ │ │ │ └── image
│ │ │ │ ├── MainAbility2
│ │ │ │ └── Utils
│ │ │ └── resources
│ │ │ └── base
│ │ │ ├── element
│ │ │ └── media
│ │ └── signature
├── fuzztest
├── moduletest
└── unittest
路径为:foundation/communication/bluetooth/bundle.json
命令为:
"test": [
...
"//foundation/communication/bluetooth/test/example/example_btTest:BluetoothTest"
]
foundation/communication/bluetooth/test/example/BluetoothTest/BUILD.gn
import("//test/xts/tools/build/suite.gni")
ohos_hap("BluetoothTest") {
hap_profile = "entry/src/main/config.json"
hap_name = "BluetoothTest"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${ SUITES_OUTPUT_ROOT}/${ XTS_SUITENAME}/testcases/${ hap_name}.hap"
deps = [
":bluetooth_resources",
":bluetooth_ts_assets",
]
certificate_profile = "signature/auto_ohos_default_com.ohos.bttest.p7b"
}
ohos_js_assets("bluetooth_ts_assets") {
source_dir = "entry/src/main/ets"
hap_profile = "entry/src/main/config.json"
ets2abc = true
}
ohos_resources("bluetooth_resources") {
sources = [ "entry/src/main/resources" ]
hap_profile = "entry/src/main/config.json"
}
路径为:foundation/communication/bluetooth/test/example/example_btTest/signature
签名文件为:Dev-Eco自动签名生成的文件:auto_ohos_default_com.ohos.bttest.p7b
{
"app": {
"vendor": "samples",
"bundleName": "ohos.samples.bttest",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 8,
"target": 8
}
},
"deviceConfig": { },
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
"default",
"phone"
],
"reqPermissions": [
{
"reason": "",
"name": "ohos.permission.DISCOVER_BLUETOOTH"
},
{
"reason": "",
"name": "ohos.permission.USE_BLUETOOTH"
},
{
"name": "ohos.permission.LOCATION"
}
],
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "ets",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
"formsEnabled": false,
"label": "$string:MainAbility_label",
"type": "page",
"launchType": "singleton"
},
{
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility2",
"name": ".MainAbility2",
"srcLanguage": "ets",
"icon": "$media:icon",
"description": "$string:MainAbility2_desc",
"formsEnabled": false,
"label": "$string:MainAbility2_label",
"type": "page",
"launchType": "singleton"
}
],
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"package": "ohos.samples.bttest",
"srcPath": "",
"name": ".entry",
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/homePage",
"pages/manualApiTestPage",
...
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index"
],
"name": ".MainAbility2",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
# 全量编译
./build.sh --product-name { product_name}
# 单独编译HAP
./build.sh --product-name { product_name} --build-target BluetoothTest
想了解更多关于开源的内容,请访问:
51CTO 开源基础软件社区
https://ost.51cto.com。
责任编辑:jianghua 来源: 51CTO开源基础软件社区 Hap程序鸿蒙(责任编辑:时尚)
银保监会完善相关政策措施 支持符合绿色低碳发展需求的保险产品和服务
coser变装、童锦程直播、老外求号……《高能英雄》引爆炎炎夏日
大生农业金融(01103.HK)发布公告:年度公司持有人应占亏损11.25亿元
《Lies of P》将与Koei Tecmo/Team Ninja的《卧龙》开展合作