在README.md中添加了syscap的相关内容,添加了requirements.txt

Signed-off-by: aodongbiao <aodongbiao@huawei.com>
This commit is contained in:
aodongbiao
2022-08-08 18:46:22 +08:00
parent 240d9b2b6f
commit 826f065e12
4 changed files with 80 additions and 1 deletions
+39 -1
View File
@@ -27,7 +27,10 @@ Main function
│ │ ├── main.c # command line implement
│ │ └── syscap_tool.c # codec implement
│ └── test
│ └── syscap_tool_test.c # syscap_tool test codec implement
| └── syscap_tool_test.c # syscap_tool test codec implement
| |—— tools
| │ │
| │ └── syscap_check.py # syscap一致性检查脚本
```
### API
@@ -79,6 +82,41 @@ SysCap tools usually integrate to IDE, APP store and bundle tools. Follow instru
-o outpath, --input outpath : output path
```
### Description and usage of Syscap Consistency Check Tool
The tool provides the following functions:
1. Collect syscap fields of all components (or specified components), compare them with arraySyscap in developtools/syscap_codec/include/syscap_define.h, and output the check results. If they are inconsistent, output the cause of the discrepancy
2. Collect the syscap fields of all components and compare them with the @syscap property set in *.d.ts in the interface/sdk-js/api directory. If the check results are inconsistent, output the cause of the inconsistency
3. Compare syscap attributes in all *.d.ts in interface/ sdk-js/api directory with arraySyscap in developtools/syscap_codec/include/syscap_define.h. If they are inconsistent, output the cause of the the inconsistency
requirements
```txt
prettytable==3.3.0
```
usage
```shell
# see the help
python3 syscap-check.py --help
# The comparison of these three different types of data is mainly controlled by the check_target parameter, which has three values to choose fromcomponent_codec、component_sdk、sdk_codec
# check syscap field in all components for consistency with arraySyscap in syscap_define.h
python3 syscap_check.py --project_path path_of_openarmony --check_target component_codec
# check that the SYSCAP field in bundle.json of the specified part is consistent with arraySyscap in syscap_define.h. Note --bundles is valid only if --check_target is component_codec
python3 syscap_check.py --project_path path_of_openarmony --check_target component_codec --bundles path_of_component1/bundle.json path_of_component2/bundle.json
# check the consistency of the syscap field of all components with the "@syscap" property set in *.d.ts
python3 syscap_check.py --project_path path_of_openarmony --check_target component_sdk
# check the "@syscap" attribute set in *.d.ts for consistency with arraSyscap in syscap_define.h
python3 syscap_check.py --project_path path_of_openarmony --check_target sdk_codec
```
### Release Note
v1.0.0 2022-3-8 first release, SysCap codec supported for Windows/Linux/Mac host.
+40
View File
@@ -43,6 +43,9 @@
│ │ │ │ └── syscap_codec_test.h
│ │ │ └── syscap_codec_test.cpp
│ │ └── syscap_tool_test.c # syscap_tool功能测试代码实现
| |—— tools
| │ │
| │ └── syscap_check.py # syscap一致性检查脚本
```
## API
@@ -113,6 +116,43 @@ syscap_tool -Pdsi pcid.txt -o path/
```
**说明:** -o 选项指定输出目录,缺省为当前目录。
### syscap一致性看护脚本的说明与使用
本工具主要提供如下功能:
1. 收集所有部件(或指定部件)的syscap字段并与developtools/sysap_codec/include/syscap_define.h中的arraySyscap比较,输出检查结果,若不一致,输出不一致的原因
2. 收集所有部件的syscap字段并与interface/sdk-js/api目录下的*.d.ts中的“@syscap”属性集合比较,输出检查结果,若不一致,输出不一致的原因
3. 收集所有interface/sdk-js/api目录下的*.d.ts中的syscap属性与developtools/syscap_codec/include/syscap_define.h中的arraySyscap比较,若不一致,输出不一致的原因
requirements
```txt
prettytable==3.3.0
```
使用方法:
```shell
# 查看帮助
python3 syscap-check.py --help
# 上述三种不同数据的比较主要通过--check_target参数控制,该参数有三个值可选:component_codec、component_sdk、sdk_codec
# 检查所有部件的syscap字段与syscap_define.h中的arraySyscap一致性情况
python3 syscap_check.py --project_path path_of_openarmony --check_target component_codec
# 检查指定的部件的bundle.json中的syscap字段与syscap_define.h中的arraySyscap一致性情况,注意,只要当--check_target为component_codec时,--bundles才生效
python3 syscap_check.py --project_path path_of_openarmony --check_target component_codec --bundles path_of_component1/bundle.json path_of_component2/bundle.json
# 检查所有部件的syscap字段与*.d.ts中的“@syscap”属性集合的一致性情况
python3 syscap_check.py --project_path path_of_openarmony --check_target component_sdk
# 检查*.d.ts中的“@syscap"属性集合与syscap_define.h中的arraSyscap的一致性情况
python3 syscap_check.py --project_path path_of_openarmony --check_target sdk_codec
```
## Release Note
v1.1.0 2022-6-17 添加转字符串格式以及比较功能。
v1.0.0 2022-3-8 首版本,提供Windows/Linux/Mac平台的系统能力编解码。
+1
View File
@@ -0,0 +1 @@
prettytable==3.3.0