From d00017f944ffd6c32362fcd92f30ebac25b2efd5 Mon Sep 17 00:00:00 2001 From: zhangwuf Date: Wed, 17 Apr 2024 16:50:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0CAPI=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=BA=A7=E7=BB=9F=E8=AE=A1=E6=8E=A5=E5=8F=A3=E3=80=81CAPI?= =?UTF-8?q?=E6=89=AB=E6=8F=8F=E7=BB=93=E6=9E=9C=E5=92=8Cdiff=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=A2=9E=E5=8A=A0kit=E3=80=81=E5=AD=90=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=BF=A1=E6=81=AF=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangwuf --- build-tools/capi_parser/readme.md | 13 +- build-tools/capi_parser/src/bin/config.py | 3 + .../src/coreImpl/diff/diff_file.py | 9 +- .../src/coreImpl/diff/diff_processor_node.py | 83 ++- .../diff/diff_processor_permission.py | 36 +- .../src/coreImpl/parser/generating_tables.py | 123 ++-- .../kit_sub_system/c_file_kit_sub_system.json | 646 ++++++++++++++++++ .../src/coreImpl/parser/parse_include.py | 22 +- .../capi_parser/src/coreImpl/parser/parser.py | 100 ++- .../capi_parser/src/typedef/diff/diff.py | 127 ++++ .../capi_parser/src/typedef/parser/parser.py | 49 ++ .../capi_parser/src/utils/constants.py | 2 + 12 files changed, 1110 insertions(+), 103 deletions(-) create mode 100644 build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json diff --git a/build-tools/capi_parser/readme.md b/build-tools/capi_parser/readme.md index c08288324..887d2acf1 100644 --- a/build-tools/capi_parser/readme.md +++ b/build-tools/capi_parser/readme.md @@ -22,7 +22,7 @@ StringConstant.INCLUDE_LIB:# 拉到本地仓的三方库路径 options: -h, --help show this help message and exit - -N {collect,diff}, --tool-name {collect,diff} + -N {collect, check, diff, collect_h}, --tool-name {collect, check, diff, collect_h} 工具名称 -P PARSER_PATH, --parser-path PARSER_PATH 解析路径 @@ -38,3 +38,14 @@ options: 3)在test/testCase/run_main.py添加对应的方法执行测试用例的解析,将结果输出到test/output下,与expect对比期望结果 添加的方法需要以test_开头 + +## 5.统计工具使用指令 + +注意:工作路都在interface_sdk_c下(也就是C仓下) +1)统计工具(C仓-含gn文件) +在工作路径下执行:py main.py路径(相对工作路径) -N collect -P 目录文件路径 +生成文件名:result_total.xlsx--扫描结果api数据 + +2)统计工具(直接获取)(这个也可以获取到文件级的kit、子系统和文件当前接口数) +在工作路径下执行:py main.py路径(相对工作路径) -N collect_h -P 目录文件路径/头文件路径 +生成文件名:file_api_json.json--文件级接口数据;parser_direct_data.xlsx--扫描结果api数据 diff --git a/build-tools/capi_parser/src/bin/config.py b/build-tools/capi_parser/src/bin/config.py index b9f2a263e..e1b0c968d 100644 --- a/build-tools/capi_parser/src/bin/config.py +++ b/build-tools/capi_parser/src/bin/config.py @@ -23,6 +23,7 @@ class ToolNameType(enum.Enum): COLLECT = 'collect' DIFF = 'diff' CHECK = 'check' + COLLECT_H = 'collect_h' tool_name_type_set = [ @@ -50,6 +51,8 @@ def run_tools(options): diff.process_dir(options.diff_path_old, options.diff_path_new) elif tool_name == ToolNameType['CHECK'].value: check.curr_entry(options.parser_path) + elif tool_name == ToolNameType['COLLECT_H'].value: + parser.parser_direct(options.parser_path) else: print("工具名称错误") diff --git a/build-tools/capi_parser/src/coreImpl/diff/diff_file.py b/build-tools/capi_parser/src/coreImpl/diff/diff_file.py index e70a4a668..ed25389a5 100644 --- a/build-tools/capi_parser/src/coreImpl/diff/diff_file.py +++ b/build-tools/capi_parser/src/coreImpl/diff/diff_file.py @@ -51,14 +51,19 @@ def generate_excel(result_info_list): info_data.append(diff_info.new_api_full_text) result = '是' if diff_info.is_compatible else '否' info_data.append(result) + api_result = '是' if diff_info.is_api_change else '否' + info_data.append(api_result) + info_data.append(diff_info.api_modification_type) data.append(info_data) wb = op.Workbook() ws = wb['Sheet'] ws.append(['api名称', '所在行', '所在列', '所在文件', '节点类型', - '变更类型', '变更信息', '旧版节点内容', '新版节点内容', '兼容']) + '变更类型', '变更信息', '旧版节点内容', '新版节点内容', + '兼容', 'API变化', 'API修改类型']) for title in data: d = title[0], title[1], title[2], title[3], title[4],\ - title[5], title[6], title[7], title[8], title[9] + title[5], title[6], title[7], title[8], title[9],\ + title[10], title[11] ws.append(d) wb.save('diff.xlsx') diff --git a/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py b/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py index dc8362526..1f10d33e2 100644 --- a/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py +++ b/build-tools/capi_parser/src/coreImpl/diff/diff_processor_node.py @@ -19,7 +19,7 @@ import os from collections import OrderedDict from clang.cindex import CursorKind from coreImpl.diff.diff_processor_permission import compare_permission, RangeChange -from typedef.diff.diff import TAGS, DiffType, DiffInfo, Scene +from typedef.diff.diff import TAGS, DiffType, DiffInfo, Scene, ApiInfo current_file = os.path.dirname(__file__) @@ -28,6 +28,9 @@ def wrap_diff_info(old_info, new_info, diff_info: DiffInfo): if old_info is not None: if 'temporary_name' in old_info['name']: old_info['name'] = '' + if (not diff_info.is_api_change) and 'kind' in old_info \ + and 'MACRO_DEFINITION' != old_info['kind']: + diff_info.set_is_api_change(True) diff_info.set_api_name(old_info['name']) diff_info.set_api_type(old_info['kind']) diff_info.set_api_line(old_info['location']['location_line']) @@ -38,6 +41,9 @@ def wrap_diff_info(old_info, new_info, diff_info: DiffInfo): if new_info is not None: if 'temporary_name' in new_info['name']: new_info['name'] = '' + if (not diff_info.is_api_change) and 'kind' in new_info \ + and 'MACRO_DEFINITION' != new_info['kind']: + diff_info.set_is_api_change(True) diff_info.set_api_name(new_info['name']) diff_info.set_api_type(new_info['kind']) diff_info.set_api_line(new_info['location']['location_line']) @@ -69,6 +75,14 @@ def get_member_result_diff(old_target, new_target): return old_member_result_map, new_member_result_map, all_key_list +def get_initial_result_obj(diff_type: DiffType, new_node, old_node=None): + result_message_obj = DiffInfo(diff_type) + if 'kind' in new_node and 'MACRO_DEFINITION' != new_node['kind']: + result_message_obj.set_is_api_change(True) + + return result_message_obj + + def process_function(old, new): diff_info_list = [] process_func_return(old, new, diff_info_list) # 处理返回值 @@ -78,7 +92,8 @@ def process_function(old, new): def process_func_return(old, new, diff_info_list): if old['return_type'] != new['return_type']: - diff_info = wrap_diff_info(old, new, DiffInfo(DiffType.FUNCTION_RETURN_CHANGE)) + result_message_obj = get_initial_result_obj(DiffType.FUNCTION_RETURN_CHANGE, new, old) + diff_info = wrap_diff_info(old, new, result_message_obj) diff_info_list.append(diff_info) @@ -88,34 +103,38 @@ def process_func_param(old, new, diff_info_list): new_len = len(new['parm']) for i in range(max(old_len, new_len)): if (i + 1) > new_len: # 减少参数 - diff_info = wrap_diff_info(old['parm'][i], new, DiffInfo(DiffType.FUNCTION_PARAM_REDUCE)) + result_message_obj = get_initial_result_obj(DiffType.FUNCTION_PARAM_REDUCE, new, old) + diff_info = wrap_diff_info(old['parm'][i], new, result_message_obj) diff_info_list.append(diff_info) elif (i + 1) > old_len: # 增加参数 - diff_info = wrap_diff_info(old, new['parm'][i], DiffInfo(DiffType.FUNCTION_PARAM_ADD)) + result_message_obj = get_initial_result_obj(DiffType.FUNCTION_PARAM_ADD, new, old) + diff_info = wrap_diff_info(old, new['parm'][i], result_message_obj) diff_info_list.append(diff_info) else: - process_param_scene(old['parm'], new['parm'], diff_info_list, i) + process_param_scene(old['parm'], new['parm'], diff_info_list, i, new) elif 'parm' not in old and 'parm' in new: # 旧无新有 - diff_info = wrap_diff_info(old, new, DiffInfo(DiffType.FUNCTION_PARAM_ADD)) + result_message_obj = get_initial_result_obj(DiffType.FUNCTION_PARAM_ADD, new, old) + diff_info = wrap_diff_info(old, new, result_message_obj) diff_info_list.append(diff_info) elif 'parm' in old and 'parm' not in new: # 旧有新无 - diff_info = wrap_diff_info(old, new, DiffInfo(DiffType.FUNCTION_PARAM_REDUCE)) + result_message_obj = get_initial_result_obj(DiffType.FUNCTION_PARAM_REDUCE, new, old) + diff_info = wrap_diff_info(old, new, result_message_obj) diff_info_list.append(diff_info) -def process_param_scene(old_param, new_param, diff_info_list, index): +def process_param_scene(old_param, new_param, diff_info_list, index, parent_new): if old_param[index]['type'] != new_param[index]['type']: - diff_info = wrap_diff_info(old_param[index], new_param[index], - DiffInfo(DiffType.FUNCTION_PARAM_TYPE_CHANGE)) + result_message_obj = get_initial_result_obj(DiffType.FUNCTION_PARAM_TYPE_CHANGE, parent_new) + diff_info = wrap_diff_info(old_param[index], new_param[index], result_message_obj) diff_info_list.append(diff_info) if old_param[index]['name'] != new_param[index]['name']: - diff_info = wrap_diff_info(old_param[index], new_param[index], - DiffInfo(DiffType.FUNCTION_PARAM_NAME_CHANGE)) + result_message_obj = get_initial_result_obj(DiffType.FUNCTION_PARAM_NAME_CHANGE, parent_new) + diff_info = wrap_diff_info(old_param[index], new_param[index], result_message_obj) diff_info_list.append(diff_info) @@ -128,20 +147,24 @@ def process_define(old, new): def process_define_name(old, new, diff_define_list): if old['name'] != new['name']: - diff_info = wrap_diff_info(old, new, DiffInfo(DiffType.DEFINE_NAME_CHANGE)) + result_message_obj = get_initial_result_obj(DiffType.DEFINE_NAME_CHANGE, new, old) + diff_info = wrap_diff_info(old, new, result_message_obj) diff_define_list.append(diff_info) def process_define_text(old, new, diff_define_list): if 'text' not in old and 'text' in new: # 旧无新有 - diff_info = wrap_diff_info(old, new, DiffInfo(DiffType.DEFINE_TEXT_CHANGE)) + result_message_obj = get_initial_result_obj(DiffType.DEFINE_TEXT_CHANGE, new, old) + diff_info = wrap_diff_info(old, new, result_message_obj) diff_define_list.append(diff_info) elif 'text' in old and 'text' not in new: # 旧有新无 - diff_info = wrap_diff_info(old, new, DiffInfo(DiffType.DEFINE_TEXT_CHANGE)) + result_message_obj = get_initial_result_obj(DiffType.DEFINE_TEXT_CHANGE, new, old) + diff_info = wrap_diff_info(old, new, result_message_obj) diff_define_list.append(diff_info) elif 'text' in old and 'text' in new: if old['text'] != new['text']: - diff_info = wrap_diff_info(old, new, DiffInfo(DiffType.DEFINE_TEXT_CHANGE)) + result_message_obj = get_initial_result_obj(DiffType.DEFINE_TEXT_CHANGE, new, old) + diff_info = wrap_diff_info(old, new, result_message_obj) diff_define_list.append(diff_info) @@ -154,7 +177,8 @@ def process_struct(old, new): def process_struct_name(old, new, diff_struct_list): if old['name'] != new['name']: - diff_info = wrap_diff_info(old, new, DiffInfo(DiffType.STRUCT_NAME_CHANGE)) + result_message_obj = get_initial_result_obj(DiffType.STRUCT_NAME_CHANGE, new, old) + diff_info = wrap_diff_info(old, new, result_message_obj) diff_struct_list.append(diff_info) @@ -164,23 +188,27 @@ def process_struct_member(old, new, diff_struct_list): new['members']) for key in all_key_result: if old_member_result.get(key) is None: + result_message_obj = get_initial_result_obj(DiffType.STRUCT_MEMBER_ADD, new, old) diff_info = wrap_diff_info(old_member_result.get(key), new_member_result.get(key), - DiffInfo(DiffType.STRUCT_MEMBER_ADD)) + result_message_obj) diff_struct_list.append(diff_info) elif new_member_result.get(key) is None: + result_message_obj = get_initial_result_obj(DiffType.STRUCT_MEMBER_REDUCE, new, old) diff_info = wrap_diff_info(old_member_result.get(key), new_member_result.get(key), - DiffInfo(DiffType.STRUCT_MEMBER_REDUCE)) + result_message_obj) diff_struct_list.append(diff_info) else: process_struct_member_scene(old_member_result.get(key), new_member_result.get(key), diff_struct_list) elif 'members' not in old and 'members' in new: # 旧无新有 - diff_info = wrap_diff_info(old, new, DiffInfo(DiffType.STRUCT_MEMBER_ADD)) + result_message_obj = get_initial_result_obj(DiffType.STRUCT_MEMBER_ADD, new, old) + diff_info = wrap_diff_info(old, new, result_message_obj) diff_struct_list.append(diff_info) elif 'members' in old and 'members' not in new: # 旧有新无 - diff_info = wrap_diff_info(old, new, DiffInfo(DiffType.STRUCT_MEMBER_REDUCE)) + result_message_obj = get_initial_result_obj(DiffType.STRUCT_MEMBER_REDUCE, new, old) + diff_info = wrap_diff_info(old, new, result_message_obj) diff_struct_list.append(diff_info) @@ -202,13 +230,15 @@ def process_struct_member_scene(old_member, new_member, diff_struct_list): if (not(old_member['location']['location_path'] in old_member['type'])) and \ (not(new_member['location']['location_path'] in new_member['type'])): if old_member['type'] != new_member['type']: + result_message_obj = get_initial_result_obj(DiffType.STRUCT_MEMBER_TYPE_CHANGE, new_member, old_member) diff_info = wrap_diff_info(old_member, new_member, - DiffInfo(DiffType.STRUCT_MEMBER_TYPE_CHANGE)) + result_message_obj) diff_struct_list.append(diff_info) if old_member['name'] != new_member['name']: + result_message_obj = get_initial_result_obj(DiffType.STRUCT_MEMBER_NAME_CHANGE, new_member, old_member) diff_info = wrap_diff_info(old_member, new_member, - DiffInfo(DiffType.STRUCT_MEMBER_NAME_CHANGE)) + result_message_obj) diff_struct_list.append(diff_info) @@ -221,7 +251,8 @@ def process_union(old, new): def process_union_name(old, new, diff_union_list): if old['name'] != new['name']: - diff_info = wrap_diff_info(old, new, DiffInfo(DiffType.UNION_NAME_CHANGE)) + result_message_obj = get_initial_result_obj(DiffType.STRUCT_MEMBER_NAME_CHANGE, new, old) + diff_info = wrap_diff_info(old, new, result_message_obj) diff_union_list.append(diff_info) @@ -231,10 +262,14 @@ def process_union_member(old, new, diff_union_list): new['members']) for key in all_key_result: if old_member_result.get(key) is None: + result_message_obj = get_initial_result_obj(DiffType.STRUCT_MEMBER_NAME_CHANGE, new, old) + diff_info = wrap_diff_info(old_member_result.get(key), new_member_result.get(key), DiffInfo(DiffType.UNION_MEMBER_ADD)) diff_union_list.append(diff_info) elif new_member_result.get(key) is None: + result_message_obj = get_initial_result_obj(DiffType.STRUCT_MEMBER_NAME_CHANGE, new, old) + diff_info = wrap_diff_info(old_member_result.get(key), new_member_result.get(key), DiffInfo(DiffType.UNION_MEMBER_REDUCE)) diff_union_list.append(diff_info) diff --git a/build-tools/capi_parser/src/coreImpl/diff/diff_processor_permission.py b/build-tools/capi_parser/src/coreImpl/diff/diff_processor_permission.py index ff1635340..b30825902 100644 --- a/build-tools/capi_parser/src/coreImpl/diff/diff_processor_permission.py +++ b/build-tools/capi_parser/src/coreImpl/diff/diff_processor_permission.py @@ -48,6 +48,24 @@ class DiffProcessorPermission: } variable_list = [] # 命题集合 + @staticmethod + def get_bool_in_list(self, number_list, bin_len): + state_list = [bin(i) for i in number_list] + state_list = [x[2:] for x in state_list] + state_list = ['0' * (bin_len - len(x)) + x for x in state_list] + state_list = [tuple([bool(eval(y)) for y in x]) for x in state_list] + return tuple(state_list) + + @staticmethod + def process_value(self, state_value): + calculate = CalculateValue() + for state in state_value: + if state_value[state]: + calculate.pass_data.append(state) + else: + calculate.fail_data.append(state) + return calculate + def find_variable_list(self, string): # return all variable_list in the string. for char in self.splitchar: string = re.sub(re.compile(self.splitchar[char]['splitchar']), '', string) @@ -62,14 +80,6 @@ class DiffProcessorPermission: string = re.sub(re.compile(self.splitchar[char]['splitchar']), self.splitchar[char]['transferchar'], string) return string - @staticmethod - def get_bool_in_list(self, number_list, bin_len): - state_list = [bin(i) for i in number_list] - state_list = [x[2:] for x in state_list] - state_list = ['0' * (bin_len - len(x)) + x for x in state_list] - state_list = [tuple([bool(eval(y)) for y in x]) for x in state_list] - return tuple(state_list) - def calculate(self, string: str, variable_length: int, state_list): state_value = {i: None for i in range(2 ** variable_length)} for state_index in range(2 ** variable_length): @@ -80,16 +90,6 @@ class DiffProcessorPermission: state_value[state_index] = eval(modify_string) return state_value - @staticmethod - def process_value(self, state_value): - calculate = CalculateValue() - for state in state_value: - if state_value[state]: - calculate.pass_data.append(state) - else: - calculate.fail_data.append(state) - return calculate - def calculate_paradigm(self, string): self.variable_list = self.find_variable_list(string) string = self.formatten(string) diff --git a/build-tools/capi_parser/src/coreImpl/parser/generating_tables.py b/build-tools/capi_parser/src/coreImpl/parser/generating_tables.py index c880c0d4c..65312dddf 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/generating_tables.py +++ b/build-tools/capi_parser/src/coreImpl/parser/generating_tables.py @@ -20,10 +20,10 @@ import os import openpyxl -def compare_json_file(js_file1, js_file2): # 获取对比结果 - with open(js_file1, 'r', encoding='utf-8') as js1: +def compare_json_file(generate_json, original_json): # 获取对比结果 + with open(generate_json, 'r', encoding='utf-8') as js1: data1 = json.load(js1) - with open(js_file2, 'r') as js2: + with open(original_json, 'r') as js2: data2 = json.load(js2) compare_result = [] only_file1 = [] # 装file1独有的 @@ -44,9 +44,9 @@ def compare_json_file(js_file1, js_file2): # 获取对比结果 return compare_result, only_file1, only_file2 -def get_difference_data(compare_result, data2): +def get_difference_data(compare_result, original_data): only_file2 = [] - for item in data2: + for item in original_data: name2 = item["name"] key = 0 for it in compare_result: @@ -106,65 +106,73 @@ def filter_func(item): return item -def generate_excel(array, name, only_file1, only_file2): - # 将列名换为中文名 - columns_map = { - 'name': '名称', - 'kind': '节点类型', - 'type': '类型', - 'gn_path': 'gn文件路径', - 'node_content': '节点内容', - 'syscap': 'syscap值', - 'since': 'since版本', - 'location': '位置行', - 'return_type': '返回类型', - 'parm': '参数', - 'location_path': '文件相对路径' - } - +def collated_api_data(api_data: list): + collated_data_total = [] + for api in api_data: + api_content = '' + if 'node_content' in api and 'content' in api['node_content']: + api_content = api['node_content']['content'] + api_content = api_content.replace('\r', '').replace('\n', '') + collated_data = [ + api.get('name'), + api_content, + api.get('kind'), + api.get('since'), + api.get('syscap'), + api.get('kit_name'), + api.get('location_path'), + api.get('sub_system') + ] + collated_data_total.append(collated_data) + return collated_data_total + + +def generate_excel(array, name, generate_json_unique, original_json_unique): + first_line_infor = ['方法名', '方法内容', '类型', '版本', 'syscap', 'kit', + '文件路径', '子系统'] workbook = openpyxl.Workbook() work_sheet1 = workbook.active work_sheet1.title = '对比结果' - write_dict_to_worksheet(work_sheet1, array, header=columns_map) + work_sheet1.append(first_line_infor) + array_update = collated_api_data(array) + write_information_to_worksheet(work_sheet1, array_update) work_sheet2 = workbook.create_sheet('生成json独有') - write_dict_to_worksheet(work_sheet2, only_file1, header=columns_map) + work_sheet2.append(first_line_infor) + generate_json_unique_update = collated_api_data(generate_json_unique) + write_information_to_worksheet(work_sheet2, generate_json_unique_update) work_sheet3 = workbook.create_sheet('原有json独有') - write_dict_to_worksheet(work_sheet3, only_file2) + write_original_infor_to_worksheet(work_sheet3, original_json_unique) workbook.save(name) -def write_dict_to_worksheet(work_sheet, result_data, header=None): - if header is None: - header = { - 'name': '名称' - } - row_num = 1 - for col_num, col_value in enumerate(header.values()): - work_sheet.cell(row_num, col_num + 1, col_value) - - row_num = 2 - for data in result_data: - for col_num, col_value in enumerate(data.values()): - processing_worksheet_data(work_sheet, col_value, row_num, col_num) - row_num += 1 - - -def processing_worksheet_data(work_sheet, col_value, row_num, col_num): - if isinstance(col_value, dict): - param_data = [] - for dict_value in col_value.values(): - if isinstance(dict_value, int): - dict_value = str(dict_value) - param_data.append(dict_value) - param_str = ','.join(param_data) - work_sheet.cell(row_num, col_num + 1, param_str) - elif isinstance(col_value, list): - list_data = ','.join(col_value) - work_sheet.cell(row_num, col_num + 1, list_data) - else: - work_sheet.cell(row_num, col_num + 1, col_value) +def write_information_to_worksheet(work_sheet, information_data): + for data in information_data: + write_data = data[0], data[1], data[2], data[3], data[4], \ + data[5], data[6], data[7] + work_sheet.append(write_data) + + +def write_original_infor_to_worksheet(work_sheet, original_data): + first_line_infor = ['first_introduced', '名称'] + work_sheet.append(first_line_infor) + collated_original_total = [] + for element in original_data: + original_list = [] + if 'first_introduced' in element: + original_list.append(element['first_introduced']) + else: + original_list.append('') + if 'name' in element: + original_list.append(element['name']) + else: + original_list.append('') + collated_original_total.append(original_list) + + for collated_element in collated_original_total: + write_data = collated_element[0], collated_element[1] + work_sheet.append(write_data) def del_repetition_value(only_file_list, compare_list): @@ -191,3 +199,10 @@ def get_json_file(json_file_new, json_file): # 获取生成的json文件 only_file2.extend(only_file2_part) only_file1_new = del_repetition_value(only_file1, result_list) return result_list, head_name, only_file1_new, only_file2 # 返回对比数据,和所需表格名 + + +def get_api_data(parser_data, excel_file_name): + generate_json_unique = [] + original_json_unique = [] + api_data_list = filter_compare(parser_data) + generate_excel(api_data_list, excel_file_name, generate_json_unique, original_json_unique) diff --git a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json new file mode 100644 index 000000000..668e349de --- /dev/null +++ b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json @@ -0,0 +1,646 @@ +{ + "data": [ + { "filePath": "ai/neural_network_runtime/neural_network_core.h", "kitName": "NA", "subSystem": "AI业务" }, + { + "filePath": "ai/neural_network_runtime/neural_network_runtime.h", + "kitName": "NeuralNetworkRuntimeKit", + "subSystem": "AI业务" + }, + { + "filePath": "ai/neural_network_runtime/neural_network_runtime_type.h", + "kitName": "NeuralNetworkRuntimeKit", + "subSystem": "AI业务" + }, + { + "filePath": "arkui/ace_engine/native/native_interface_xcomponent.h", + "kitName": "ArkUI", + "subSystem": "ArkUI开发框架" + }, + { + "filePath": "arkui/ace_engine/native/native_xcomponent_key_event.h", + "kitName": "ArkUI", + "subSystem": "ArkUI开发框架" + }, + { "filePath": "arkui/ace_engine/native/native_dialog.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "arkui/ace_engine/native/native_event.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "arkui/ace_engine/native/native_gesture.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "arkui/ace_engine/native/native_interface.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" }, + { "filePath": "arkui/ace_engine/native/native_node.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" }, + { "filePath": "arkui/ace_engine/native/native_node_napi.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" }, + { "filePath": "arkui/ace_engine/native/native_type.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" }, + { "filePath": "arkui/ace_engine/native/ui_input_event.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" }, + { "filePath": "arkui/napi/common.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" }, + { "filePath": "arkui/napi/native_api.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" }, + { "filePath": "ark_runtime/jsvm/jsvm.h", "kitName": "ArkTS", "subSystem": "方舟编译允许时" }, + { "filePath": "ark_runtime/jsvm/jsvm_types.h", "kitName": "ArkTS", "subSystem": "方舟编译允许时" }, + { + "filePath": "bundlemanager/bundle_framework/bundle/include/native_interface_bundle.h", + "kitName": "AbilityKit", + "subSystem": "包管理" + }, + { + "filePath": "commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h", + "kitName": "NA", + "subSystem": "内核" + }, + { + "filePath": "distributeddatamgr/relational_store/include/oh_cursor.h", + "kitName": "ArkData", + "subSystem": "分布式数据管理" + }, + { + "filePath": "distributeddatamgr/relational_store/include/oh_predicates.h", + "kitName": "ArkData", + "subSystem": "分布式数据管理" + }, + { + "filePath": "distributeddatamgr/relational_store/include/oh_value_object.h", + "kitName": "ArkData", + "subSystem": "分布式数据管理" + }, + { + "filePath": "distributeddatamgr/relational_store/include/oh_values_bucket.h", + "kitName": "ArkData", + "subSystem": "分布式数据管理" + }, + { + "filePath": "distributeddatamgr/relational_store/include/relational_store.h", + "kitName": "ArkData", + "subSystem": "分布式数据管理" + }, + { + "filePath": "distributeddatamgr/relational_store/include/relational_store_error_code.h", + "kitName": "ArkData", + "subSystem": "分布式数据管理" + }, + { + "filePath": "distributeddatamgr/relational_store/include/data_asset.h", + "kitName": "ArkData", + "subSystem": "分布式数据管理" + }, + { + "filePath": "drivers/external_device_manager/hid/hid_ddk_api.h", + "kitName": "DriverDevelopmentKit", + "subSystem": "驱动" + }, + { + "filePath": "drivers/external_device_manager/hid/hid_ddk_types.h", + "kitName": "DriverDevelopmentKit", + "subSystem": "驱动" + }, + { + "filePath": "drivers/external_device_manager/usb/usb_ddk_api.h", + "kitName": "DriverDevelopmentKit", + "subSystem": "驱动" + }, + { + "filePath": "drivers/external_device_manager/usb/usb_ddk_types.h", + "kitName": "DriverDevelopmentKit", + "subSystem": "驱动" + }, + { "filePath": "filemanagement/fileio/include/error_code.h", "kitName": "NA", "subSystem": "文件管理" }, + { "filePath": "filemanagement/environment/include/oh_environment.h", "kitName": "NA", "subSystem": "文件管理" }, + { "filePath": "filemanagement/fileio/include/error_code.h", "kitName": "NA", "subSystem": "文件管理" }, + { "filePath": "filemanagement/fileio/include/oh_fileio.h", "kitName": "NA", "subSystem": "文件管理" }, + { "filePath": "filemanagement/fileio/include/error_code.h", "kitName": "NA", "subSystem": "文件管理" }, + { "filePath": "filemanagement/fileshare/include/oh_file_share.h", "kitName": "NA", "subSystem": "文件管理" }, + { "filePath": "filemanagement/fileio/include/error_code.h", "kitName": "NA", "subSystem": "文件管理" }, + { "filePath": "filemanagement/file_uri/include/oh_file_uri.h", "kitName": "NA", "subSystem": "文件管理" }, + { "filePath": "global/resource_management/include/raw_dir.h", "kitName": "NA", "subSystem": "全球化" }, + { "filePath": "global/resource_management/include/raw_file.h", "kitName": "NA", "subSystem": "全球化" }, + { "filePath": "global/resource_management/include/raw_file_manager.h", "kitName": "NA", "subSystem": "全球化" }, + { "filePath": "third_party/egl/EGL/egl.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "third_party/egl/EGL/eglext.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "third_party/egl/EGL/eglplatform.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "third_party/openGLES/GLES2/gl2.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "third_party/openGLES/GLES2/gl2ext.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "third_party/openGLES/GLES2/gl2platform.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "third_party/openGLES/GLES3/gl3.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "third_party/openGLES/GLES3/gl31.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "third_party/openGLES/GLES3/gl32.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "third_party/openGLES/GLES3/gl3platform.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { + "filePath": "graphic/graphic_2d/native_buffer/native_buffer.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_bitmap.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_brush.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_canvas.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_color.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_color_filter.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_color_space.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_filter.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_font.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_font_collection.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_font_mgr.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_gpu_context.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_image.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_mask_filter.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_matrix.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_memory_stream.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_path.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_path_effect.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_pen.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_pixel_map.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_point.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_rect.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_region.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_register_font.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_round_rect.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_sampling_options.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_shader_effect.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_surface.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_text_blob.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_text_declaration.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_text_typography.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_typeface.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { + "filePath": "graphic/graphic_2d/native_drawing/drawing_types.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { "filePath": "graphic/graphic_2d/native_image/native_image.h", "kitName": "NA", "subSystem": "图形图像" }, + { "filePath": "graphic/graphic_2d/native_vsync/native_vsync.h", "kitName": "NA", "subSystem": "图形图像" }, + { "filePath": "graphic/graphic_2d/native_window/buffer_handle.h", "kitName": "NA", "subSystem": "图形图像" }, + { + "filePath": "graphic/graphic_2d/native_window/external_window.h", + "kitName": "ArkGraphicsD", + "subSystem": "图形图像" + }, + { "filePath": "third_party/vulkan-headers/vulkan/vk_platform.h", "kitName": "NA", "subSystem": "图形图像" }, + { "filePath": "third_party/vulkan-headers/vulkan/vulkan.h", "kitName": "NA", "subSystem": "图形图像" }, + { "filePath": "third_party/vulkan-headers/vulkan/vulkan_core.h", "kitName": "NA", "subSystem": "图形图像" }, + { "filePath": "third_party/vulkan-headers/vulkan/vulkan_ohos.h", "kitName": "NA", "subSystem": "图形图像" }, + { + "filePath": "hiviewdfx/hiappevent/include/hiappevent/hiappevent.h", + "kitName": "PerformanceAnalysisKit", + "subSystem": "DFX" + }, + { + "filePath": "hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h", + "kitName": "PerformanceAnalysisKit", + "subSystem": "DFX" + }, + { + "filePath": "hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h", + "kitName": "PerformanceAnalysisKit", + "subSystem": "DFX" + }, + { + "filePath": "hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h", + "kitName": "PerformanceAnalysisKit", + "subSystem": "DFX" + }, + { + "filePath": "hiviewdfx/hidebug/include/hidebug/hidebug.h", + "kitName": "PerformanceAnalysisKit", + "subSystem": "DFX" + }, + { + "filePath": "hiviewdfx/hidebug/include/hidebug/hidebug_type.h", + "kitName": "PerformanceAnalysisKit", + "subSystem": "DFX" + }, + { "filePath": "hiviewdfx/hilog/include/hilog/log.h", "kitName": "PerformanceAnalysisKit", "subSystem": "DFX" }, + { + "filePath": "hiviewdfx/hitrace/include/hitrace/trace.h", + "kitName": "PerformanceAnalysisKit", + "subSystem": "DFX" + }, + { + "filePath": "multimedia/audio_framework/audio_capturer/native_audiocapturer.h", + "kitName": "AudioKit", + "subSystem": "OS媒体软件" + }, + { + "filePath": "multimedia/audio_framework/audio_renderer/native_audiorenderer.h", + "kitName": "AudioKit", + "subSystem": "OS媒体软件" + }, + { + "filePath": "multimedia/audio_framework/common/native_audiostream_base.h", + "kitName": "AudioKit", + "subSystem": "OS媒体软件" + }, + { + "filePath": "multimedia/audio_framework/common/native_audiostreambuilder.h", + "kitName": "AudioKit", + "subSystem": "OS媒体软件" + }, + { "filePath": "multimedia/av_codec/native_avcodec_audiocodec.h", "kitName": "AudioKit", "subSystem": "OS媒体软件" }, + { + "filePath": "multimedia/av_codec/native_avcodec_audiodecoder.h", + "kitName": "AudioKit", + "subSystem": "OS媒体软件" + }, + { + "filePath": "multimedia/av_codec/native_avcodec_audioencoder.h", + "kitName": "AudioKit", + "subSystem": "OS媒体软件" + }, + { "filePath": "multimedia/av_codec/native_avdemuxer.h", "kitName": "AudioKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/av_codec/native_avmuxer.h", "kitName": "AudioKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/av_codec/native_avsource.h", "kitName": "AudioKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/av_codec/avcodec_audio_channel_layout.h", "kitName": "NA", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/av_codec/native_avcapability.h", "kitName": "AudioKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/av_codec/native_avcodec_base.h", "kitName": "AudioKit", "subSystem": "OS媒体软件" }, + { + "filePath": "multimedia/av_codec/native_avcodec_videodecoder.h", + "kitName": "AudioKit", + "subSystem": "OS媒体软件" + }, + { + "filePath": "multimedia/av_codec/native_avcodec_videoencoder.h", + "kitName": "AudioKit", + "subSystem": "OS媒体软件" + }, + { "filePath": "multimedia/camera_framework/camera.h", "kitName": "CameraKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/camera_framework/camera_input.h", "kitName": "CameraKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/camera_framework/camera_manager.h", "kitName": "CameraKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/camera_framework/capture_session.h", "kitName": "CameraKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/camera_framework/metadata_output.h", "kitName": "CameraKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/camera_framework/photo_output.h", "kitName": "CameraKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/camera_framework/preview_output.h", "kitName": "CameraKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/camera_framework/video_output.h", "kitName": "CameraKit", "subSystem": "OS媒体软件" }, + { + "filePath": "multimedia/drm_framework/common/native_drm_common.h", + "kitName": "DRMKit", + "subSystem": "OS媒体软件" + }, + { "filePath": "multimedia/drm_framework/common/native_drm_err.h", "kitName": "DRMKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/drm_framework/native_mediakeysession.h", "kitName": "DRMKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/drm_framework/native_mediakeysystem.h", "kitName": "DRMKit", "subSystem": "OS媒体软件" }, + { + "filePath": "multimedia/image_framework/include/image_pixel_map_mdk.h", + "kitName": "ImageKit", + "subSystem": "OS媒体软件" + }, + { + "filePath": "multimedia/image_framework/include/image_pixel_map_napi.h", + "kitName": "ImageKit", + "subSystem": "OS媒体软件" + }, + { "filePath": "multimedia/image_framework/include/image_mdk.h", "kitName": "ImageKit", "subSystem": "OS媒体软件" }, + { + "filePath": "multimedia/image_framework/include/image_mdk_common.h", + "kitName": "ImageKit", + "subSystem": "OS媒体软件" + }, + { + "filePath": "multimedia/image_framework/include/image_receiver_mdk.h", + "kitName": "ImageKit", + "subSystem": "OS媒体软件" + }, + { + "filePath": "multimedia/image_framework/include/image_source_mdk.h", + "kitName": "ImageKit", + "subSystem": "OS媒体软件" + }, + { + "filePath": "multimedia/image_framework/include/image_packer_mdk.h", + "kitName": "ImageKit", + "subSystem": "OS媒体软件" + }, + { "filePath": "multimedia/media_foundation/native_avbuffer.h", "kitName": "AVCodecKit", "subSystem": "OS媒体软件" }, + { + "filePath": "multimedia/media_foundation/native_avbuffer_info.h", + "kitName": "AVCodecKit", + "subSystem": "OS媒体软件" + }, + { "filePath": "multimedia/media_foundation/native_averrors.h", "kitName": "AVCodecKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/media_foundation/native_avformat.h", "kitName": "AVCodecKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/media_foundation/native_avmemory.h", "kitName": "AVCodecKit", "subSystem": "OS媒体软件" }, + { + "filePath": "multimedia/media_foundation/native_audio_channel_layout.h", + "kitName": "AVCodecKit", + "subSystem": "OS媒体软件" + }, + { "filePath": "multimedia/player_framework/avplayer.h", "kitName": "MediaKit", "subSystem": "OS媒体软件" }, + { "filePath": "multimedia/player_framework/avplayer_base.h", "kitName": "MediaKit", "subSystem": "OS媒体软件" }, + { + "filePath": "multimedia/player_framework/native_avscreen_capture.h", + "kitName": "MediaKit", + "subSystem": "OS媒体软件" + }, + { + "filePath": "multimedia/player_framework/native_avscreen_capture_base.h", + "kitName": "MediaKit", + "subSystem": "OS媒体软件" + }, + { + "filePath": "multimedia/player_framework/native_avscreen_capture_errors.h", + "kitName": "MediaKit", + "subSystem": "OS媒体软件" + }, + { "filePath": "multimodalinput/kits/c/input/oh_input_manager.h", "kitName": "InputKit", "subSystem": "多模输入" }, + { "filePath": "multimodalinput/kits/c/input/oh_key_code.h", "kitName": "InputKit", "subSystem": "多模输入" }, + { "filePath": "network/netmanager/include/net_connection.h", "kitName": "NA", "subSystem": "网络管理" }, + { "filePath": "network/netmanager/include/net_connection_type.h", "kitName": "NA", "subSystem": "网络管理" }, + { "filePath": "network/netssl/include/net_ssl_c.h", "kitName": "NA", "subSystem": "基础通信" }, + { "filePath": "network/netssl/include/net_ssl_c_type.h", "kitName": "NA", "subSystem": "基础通信" }, + { + "filePath": "network/netstack/net_websocket/net_websocket.h", + "kitName": "FunctionFlowRuntimeKit", + "subSystem": "资源调度" + }, + { + "filePath": "network/netstack/net_websocket/net_websocket_type.h", + "kitName": "FunctionFlowRuntimeKit", + "subSystem": "资源调度" + }, + { + "filePath": "resourceschedule/ffrt/c/condition_variable.h", + "kitName": "FunctionFlowRuntimeKit", + "subSystem": "资源调度" + }, + { "filePath": "resourceschedule/ffrt/c/mutex.h", "kitName": "FunctionFlowRuntimeKit", "subSystem": "资源调度" }, + { "filePath": "resourceschedule/ffrt/c/queue.h", "kitName": "FunctionFlowRuntimeKit", "subSystem": "资源调度" }, + { "filePath": "resourceschedule/ffrt/c/sleep.h", "kitName": "FunctionFlowRuntimeKit", "subSystem": "资源调度" }, + { "filePath": "resourceschedule/ffrt/c/task.h", "kitName": "FunctionFlowRuntimeKit", "subSystem": "资源调度" }, + { "filePath": "resourceschedule/ffrt/c/type_def.h", "kitName": "FunctionFlowRuntimeKit", "subSystem": "资源调度" }, + { "filePath": "resourceschedule/qos_manager/c/qos.h", "kitName": "NA", "subSystem": "内核" }, + { "filePath": "security/asset/inc/asset_api.h", "kitName": "NA", "subSystem": "安全基础能力" }, + { "filePath": "security/asset/inc/asset_type.h", "kitName": "NA", "subSystem": "安全基础能力" }, + { + "filePath": "security/huks/include/native_huks_api.h", + "kitName": "UniversalKeystoreKit", + "subSystem": "安全基础能力" + }, + { + "filePath": "security/huks/include/native_huks_param.h", + "kitName": "UniversalKeystoreKit", + "subSystem": "安全基础能力" + }, + { + "filePath": "security/huks/include/native_huks_type.h", + "kitName": "UniversalKeystoreKit", + "subSystem": "安全基础能力" + }, + { "filePath": "sensors/miscdevice/vibrator/include/vibrator.h", "kitName": "NA", "subSystem": "泛sensor服务" }, + { "filePath": "sensors/miscdevice/vibrator/include/vibrator_type.h", "kitName": "NA", "subSystem": "泛sensor服务" }, + { "filePath": "sensors/sensor/oh_sensor.h", "kitName": "NA", "subSystem": "泛sensor服务" }, + { "filePath": "sensors/sensor/oh_sensor_type.h", "kitName": "NA", "subSystem": "泛sensor服务" }, + { "filePath": "startup/init/syscap/include/deviceinfo.h", "kitName": "NA", "subSystem": "启动恢复" }, + { "filePath": "startup/init/syscap/include/syscap_ndk.h", "kitName": "NA", "subSystem": "启动恢复" }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/parseerr.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/platform.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/ptypes.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/stringoptions.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/ubidi.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { "filePath": "third_party/icu4c/ndk_headers/unicode/ubrk.h", "kitName": "LocalizationKit", "subSystem": "全球化" }, + { "filePath": "third_party/icu4c/ndk_headers/unicode/ucal.h", "kitName": "LocalizationKit", "subSystem": "全球化" }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/uchar.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { "filePath": "third_party/icu4c/ndk_headers/unicode/ucnv.h", "kitName": "LocalizationKit", "subSystem": "全球化" }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/ucnv_err.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { "filePath": "third_party/icu4c/ndk_headers/unicode/ucol.h", "kitName": "LocalizationKit", "subSystem": "全球化" }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/uconfig.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { "filePath": "third_party/icu4c/ndk_headers/unicode/udat.h", "kitName": "LocalizationKit", "subSystem": "全球化" }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/udisplaycontext.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/uenum.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/ufieldpositer.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { "filePath": "third_party/icu4c/ndk_headers/unicode/uloc.h", "kitName": "LocalizationKit", "subSystem": "全球化" }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/umachine.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/umisc.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/unorm2.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { "filePath": "third_party/icu4c/ndk_headers/unicode/unum.h", "kitName": "LocalizationKit", "subSystem": "全球化" }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/unumberformatter.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/uscript.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { "filePath": "third_party/icu4c/ndk_headers/unicode/uset.h", "kitName": "LocalizationKit", "subSystem": "全球化" }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/utrans.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { + "filePath": "third_party/icu4c/ndk_headers/unicode/utypes.h", + "kitName": "LocalizationKit", + "subSystem": "全球化" + }, + { "filePath": "third_party/libuv/include/uv_ndk/uv.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/aix.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/bsd.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/darwin.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/errno.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/linux.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/os390.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/posix.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/stdint-msvc2008.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/sunos.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/threadpool.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/tree.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/unix.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/version.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/libuv/include/uv/win.h", "kitName": "NA", "subSystem": "研发工具链" }, + { "filePath": "third_party/mindspore/kits/context.h", "kitName": "MindSporeLiteKit", "subSystem": "AI业务" }, + { "filePath": "third_party/mindspore/kits/data_type.h", "kitName": "MindSporeLiteKit", "subSystem": "AI业务" }, + { "filePath": "third_party/mindspore/kits/format.h", "kitName": "MindSporeLiteKit", "subSystem": "AI业务" }, + { "filePath": "third_party/mindspore/kits/model.h", "kitName": "MindSporeLiteKit", "subSystem": "AI业务" }, + { "filePath": "third_party/mindspore/kits/status.h", "kitName": "MindSporeLiteKit", "subSystem": "AI业务" }, + { "filePath": "third_party/mindspore/kits/tensor.h", "kitName": "MindSporeLiteKit", "subSystem": "AI业务" }, + { "filePath": "third_party/mindspore/kits/types.h", "kitName": "MindSporeLiteKit", "subSystem": "AI业务" }, + { "filePath": "third_party/openSLES/api/1.0.1/OpenSLES.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { + "filePath": "third_party/openSLES/api/1.0.1/OpenSLES_OpenHarmony.h", + "kitName": "NA", + "subSystem": "ArkUI开发框架" + }, + { "filePath": "third_party/openSLES/api/1.0.1/OpenSLES_Platform.h", "kitName": "NA", "subSystem": "ArkUI开发框架" }, + { "filePath": "third_party/zlib/zconf.h", "kitName": "NA", "subSystem": "包管理" }, + { "filePath": "third_party/zlib/zlib.h", "kitName": "NA", "subSystem": "包管理" }, + { "filePath": "web/webview/interfaces/native/arkweb_error_code.h", "kitName": "NA", "subSystem": "web" }, + { "filePath": "web/webview/interfaces/native/arkweb_interface.h", "kitName": "NA", "subSystem": "web" }, + { "filePath": "web/webview/interfaces/native/arkweb_net_error_list.h", "kitName": "NA", "subSystem": "web" }, + { "filePath": "web/webview/interfaces/native/arkweb_scheme_handler.h", "kitName": "NA", "subSystem": "web" }, + { "filePath": "web/webview/interfaces/native/arkweb_type.h", "kitName": "NA", "subSystem": "web" }, + { "filePath": "web/webview/interfaces/native/native_interface_arkweb.h", "kitName": "NA", "subSystem": "web" } + ] +} diff --git a/build-tools/capi_parser/src/coreImpl/parser/parse_include.py b/build-tools/capi_parser/src/coreImpl/parser/parse_include.py index e35f939ac..9e080b7eb 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/parse_include.py +++ b/build-tools/capi_parser/src/coreImpl/parser/parse_include.py @@ -252,8 +252,7 @@ def define_comment(cursor, current_file, data): data['comment'] = matches.group() -def ast_to_dict(cursor, current_file, gn_path=None, comment=None, key=0): # 解析数据的整理 - # 通用 +def get_default_node_data(cursor, gn_path=None): data = { "name": cursor.spelling, "kind": '', @@ -262,8 +261,16 @@ def ast_to_dict(cursor, current_file, gn_path=None, comment=None, key=0): # 解 "node_content": {}, "comment": '', "syscap": '', - "since": '' + "since": '', + "kit_name": '', + "sub_system": '', } + return data + + +def ast_to_dict(cursor, current_file, gn_path=None, comment=None, key=0): # 解析数据的整理 + # 通用 + data = get_default_node_data(cursor, gn_path) get_comment(cursor, data) if key == 0: data["kind"] = CursorKind.TRANSLATION_UNIT.name @@ -280,6 +287,7 @@ def ast_to_dict(cursor, current_file, gn_path=None, comment=None, key=0): # 解 define_comment(cursor, current_file, data) get_syscap_value(data) get_since_value(data) + get_kit_value(data) processing_special_node(cursor, data, key, gn_path) # 节点处理 children = list(cursor.get_children()) # 判断是否有子节点,有就追加children,没有根据情况来 if len(children) > 0: @@ -325,6 +333,14 @@ def get_since_value(data: dict): data["since"] = matches.group(0).replace('@since', '') +def get_kit_value(data: dict): + if 'none_comment' != data["comment"]: + pattern = r'@(kit).*?(?=\n)' + matches = re.search(pattern, data['comment']) + if matches: + data["kit_name"] = matches.group(0).replace('@kit', '') + + def get_comment(cursor, data: dict): if cursor.raw_comment: # 是否有注释信息,有就取,没有过 data["comment"] = cursor.raw_comment diff --git a/build-tools/capi_parser/src/coreImpl/parser/parser.py b/build-tools/capi_parser/src/coreImpl/parser/parser.py index 56a18bbc9..a1e3930f9 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/parser.py +++ b/build-tools/capi_parser/src/coreImpl/parser/parser.py @@ -22,7 +22,7 @@ import re import shutil import stat from utils.constants import StringConstant, RegularExpressions -from typedef.parser.parser import ParserGetResultTable +from typedef.parser.parser import ParserGetResultTable, OneFileApiMessage, NodeKind from coreImpl.parser import parse_include, generating_tables # 引入解析文件 # 引入得到结果表格文件 @@ -323,3 +323,101 @@ def parser_include_ast(gn_file_path, include_path, flag=-1): # 对于单 delete_typedef_child(child) return data + + +def get_dir_file_path(dir_path): + file_path_list = [] + link_include_path = [] # 装链接头文件路径 + for dir_path, dir_names, filenames in os.walk(dir_path): + for dir_name in dir_names: + link_include_path.append(os.path.join(dir_path, dir_name)) + for file in filenames: + if file.endswith('.h'): + file_path_list.append(os.path.join(dir_path, file)) + + return file_path_list, link_include_path + + +def get_file_api_num(file_data, kind_list): + api_number = 0 + if 'children' in file_data: + for child in file_data['children']: + if 'kind' in child and child['kind'] in kind_list: + api_number += 1 + return api_number + + +def get_file_api_json(data_total): + api_obj_total_list = [] + kind_list = [ + NodeKind.MACRO_DEFINITION.value, + NodeKind.STRUCT_DECL.value, + NodeKind.UNION_DECL.value, + NodeKind.ENUM_DECL.value, + NodeKind.FUNCTION_DECL.value, + NodeKind.VAR_DECL.value + ] + for one_file_data in data_total: + file_api_num = get_file_api_num(one_file_data, kind_list) + if 'name' in one_file_data and 'kit_name' in one_file_data and 'sub_system' in one_file_data: + api_message_obj = OneFileApiMessage(one_file_data['name'], one_file_data['kit_name'], + one_file_data['sub_system'], file_api_num) + current_file = os.path.dirname(__file__) + kit_json_file_path = os.path.abspath(os.path.join(current_file, + r"kit_sub_system/c_file_kit_sub_system.json")) + complete_kit_or_system(api_message_obj, kit_json_file_path) + + api_obj_total_list.append(api_message_obj) + api_obj_total_json = json.dumps(api_obj_total_list, default=lambda obj: obj.__dict__, indent=4, + ensure_ascii=False) + return api_obj_total_json + + +def generate_file_api_json(json_data): + with open(StringConstant.FILE_LEVEL_API_DATA.value, 'w', encoding='utf-8') as fs: + fs.write(json_data) + fs.close() + + +def complete_kit_or_system(api_message: OneFileApiMessage, json_path): + if (not api_message.get_kit_name()) or (not api_message.get_sub_system()): + kit_name, sub_system_name = get_kit_system_data(json_path, + api_message.get_file_path()) + if not api_message.get_kit_name(): + api_message.set_kit_name(kit_name) + if not api_message.get_sub_system(): + api_message.set_sub_system(sub_system_name) + + +def get_kit_system_data(json_path, relative_path): + kit_name = '' + sub_system_name = '' + with open(json_path, 'r', encoding='utf-8') as fs: + kit_system_data = json.load(fs) + for data in kit_system_data['data']: + if 'filePath' in data and relative_path == data['filePath'].replace('/', '\\'): + kit_name = data['kitName'] + sub_system_name = data['subSystem'] + break + return kit_name, sub_system_name + + +def parser_direct(path): # 目录路径 + file_path_list = [] + link_include_path = [] # 装链接头文件路径 + dir_path = '' + if os.path.isdir(path): + file_path_total, link_include_total = get_dir_file_path(path) + file_path_list.extend(file_path_total) + link_include_path.extend(link_include_total) + dir_path = path + else: + if path.endswith('.h'): + file_path_list.append(path) + dir_path = os.path.dirname(path) + data_total = parse_include.get_include_file(file_path_list, link_include_path, dir_path) + file_api_json = get_file_api_json(data_total) + generate_file_api_json(file_api_json) + generating_tables.get_api_data(data_total, StringConstant.PARSER_DIRECT_EXCEL_NAME.value) + + return data_total diff --git a/build-tools/capi_parser/src/typedef/diff/diff.py b/build-tools/capi_parser/src/typedef/diff/diff.py index 363230efc..cc2285d85 100644 --- a/build-tools/capi_parser/src/typedef/diff/diff.py +++ b/build-tools/capi_parser/src/typedef/diff/diff.py @@ -153,6 +153,105 @@ compatible_list = [ DiffType.DOC_TAG_RIGHT_BRACE_HAVE_TO_NA, ] +api_new_list = [DiffType.ADD_API] + +api_delete_list = [DiffType.REDUCE_API] + +non_api_change_list = [ + DiffType.ADD_DOC, + DiffType.REDUCE_DOC, + DiffType.ADD_DOC_TAG, + DiffType.REDUCE_DOC_TAG +] + +api_prototype_change_list = [ + DiffType.DEFINE_NAME_CHANGE, + DiffType.DEFINE_TEXT_CHANGE, + DiffType.FUNCTION_PARAM_POS_CHANGE, + DiffType.FUNCTION_NAME_CHANGE, + DiffType.FUNCTION_RETURN_CHANGE, + DiffType.FUNCTION_PARAM_NAME_CHANGE, + DiffType.FUNCTION_PARAM_TYPE_CHANGE, + DiffType.FUNCTION_PARAM_REDUCE, + DiffType.FUNCTION_PARAM_ADD, + DiffType.STRUCT_NAME_CHANGE, + DiffType.STRUCT_MEMBER_TYPE_CHANGE, + DiffType.STRUCT_MEMBER_NAME_CHANGE, + DiffType.STRUCT_MEMBER_ADD, + DiffType.STRUCT_MEMBER_REDUCE, + DiffType.UNION_MEMBER_TYPE_CHANGE, + DiffType.UNION_MEMBER_NAME_CHANGE, + DiffType.UNION_NAME_CHANGE, + DiffType.UNION_MEMBER_ADD, + DiffType.UNION_MEMBER_REDUCE, + DiffType.ENUM_NAME_CHANGE, + DiffType.ENUM_MEMBER_NAME_CHANGE, + DiffType.ENUM_MEMBER_VALUE_CHANGE, + DiffType.ENUM_MEMBER_ADD, + DiffType.ENUM_MEMBER_REDUCE, + DiffType.VARIABLE_NAME_CHANGE, + DiffType.VARIABLE_TYPE_CHANGE, + DiffType.VARIABLE_VALUE_CHANGE, + DiffType.CONSTANT_NAME_CHANGE, + DiffType.CONSTANT_TYPE_CHANGE, + DiffType.CONSTANT_VALUE_CHANGE, + DiffType.TYPEDEF_NAME_TYPE_CHANGE +] + +api_constraint_change_list = [ + DiffType.DOC_TAG_ADDTOGROUP_NA_TO_HAVE, + DiffType.DOC_TAG_ADDTOGROUP_HAVE_TO_NA, + DiffType.DOC_TAG_ADDTOGROUP_A_TO_B, + DiffType.DOC_TAG_BRIEF_NA_TO_HAVE, + DiffType.DOC_TAG_BRIEF_HAVE_TO_NA, + DiffType.DOC_TAG_BRIEF_A_TO_B, + DiffType.DOC_TAG_DEPRECATED_NA_TO_HAVE, + DiffType.DOC_TAG_DEPRECATED_HAVE_TO_NA, + DiffType.DOC_TAG_DEPRECATED_A_TO_B, + DiffType.DOC_TAG_FILE_NA_TO_HAVE, + DiffType.DOC_TAG_FILE_HAVE_TO_NA, + DiffType.DOC_TAG_FILE_A_TO_B, + DiffType.DOC_TAG_LIBRARY_NA_TO_HAVE, + DiffType.DOC_TAG_LIBRARY_HAVE_TO_NA, + DiffType.DOC_TAG_LIBRARY_A_TO_B, + DiffType.DOC_TAG_PARAM_NA_TO_HAVE, + DiffType.DOC_TAG_PARAM_HAVE_TO_NA, + DiffType.DOC_TAG_PARAM_NAME_A_TO_B, + DiffType.DOC_TAG_PARAM_A_TO_B, + DiffType.DOC_TAG_PERMISSION_NA_TO_HAVE, + DiffType.DOC_TAG_PERMISSION_HAVE_TO_NA, + DiffType.DOC_TAG_PERMISSION_RANGE_BIGGER, + DiffType.DOC_TAG_PERMISSION_RANGE_SMALLER, + DiffType.DOC_TAG_PERMISSION_RANGE_CHANGE, + DiffType.DOC_TAG_SINCE_NA_TO_HAVE, + DiffType.DOC_TAG_SINCE_A_TO_B, + DiffType.DOC_TAG_SYSCAP_NA_TO_HAVE, + DiffType.DOC_TAG_SYSCAP_HAVE_TO_NA, + DiffType.DOC_TAG_SYSCAP_A_TO_B, + DiffType.DOC_TAG_LEFT_BRACE_NA_TO_HAVE, + DiffType.DOC_TAG_LEFT_BRACE_HAVE_TO_NA, + DiffType.DOC_TAG_RIGHT_BRACE_NA_TO_HAVE, + DiffType.DOC_TAG_RIGHT_BRACE_HAVE_TO_NA, +] + +api_modification_type_dict = { + 'api_new_list': 'API新增', + 'api_delete_list': 'API删除', + 'non_api_change_list': '非API变更', + 'api_prototype_change_list': 'API修改(原型修改)', + 'api_constraint_change_list': 'API修改(约束变化)' +} + + +class ApiInfo: + is_api_change = False + + def set_is_api_change(self, is_api_change): + self.is_api_change = is_api_change + + def get_is_api_change(self): + return self.is_api_change + class DiffInfo: api_name: str = '' @@ -165,11 +264,14 @@ class DiffInfo: api_column: int = 0 api_file_path: str = '' is_compatible = False + is_api_change = False + api_modification_type = '' def __init__(self, diff_type: DiffType): self.diff_type = diff_type self.diff_message = diff_type.value self.set_diff_type(diff_type) + self.set_api_modification_type(diff_type) def set_api_line(self, api_line): self.api_line = api_line @@ -233,6 +335,27 @@ class DiffInfo: def get_is_compatible(self): return self.is_compatible + def set_is_api_change(self, is_api_change): + self.is_api_change = is_api_change + + def get_is_api_change(self): + return self.is_api_change + + def set_api_modification_type(self, diff_type): + if diff_type in api_new_list: + self.api_modification_type = api_modification_type_dict['api_new_list'] + elif diff_type in api_delete_list: + self.api_modification_type = api_modification_type_dict['api_delete_list'] + elif diff_type in non_api_change_list: + self.api_modification_type = api_modification_type_dict['non_api_change_list'] + elif diff_type in api_prototype_change_list: + self.api_modification_type = api_modification_type_dict['api_prototype_change_list'] + elif diff_type in api_constraint_change_list: + self.api_modification_type = api_modification_type_dict['api_constraint_change_list'] + + def get_api_modification_type(self): + return self.api_modification_type + class OutputJson: api_name: str = '' @@ -245,6 +368,8 @@ class OutputJson: api_column: int = 0 api_file_path: str = '' is_compatible = False + is_api_change = False + api_modification_type = '' def __init__(self, diff_info): self.api_name = diff_info.api_name @@ -257,3 +382,5 @@ class OutputJson: self.api_column = diff_info.api_column self.api_file_path = diff_info.api_file_path self.is_compatible = diff_info.is_compatible + self.is_api_change = diff_info.is_api_change + self.api_modification_type = diff_info.api_modification_type diff --git a/build-tools/capi_parser/src/typedef/parser/parser.py b/build-tools/capi_parser/src/typedef/parser/parser.py index 8e1e7b482..3ad338cf4 100644 --- a/build-tools/capi_parser/src/typedef/parser/parser.py +++ b/build-tools/capi_parser/src/typedef/parser/parser.py @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +import enum + + class ParserGetResultTable: result_list = [] head_name = "" @@ -26,3 +29,49 @@ class ParserGetResultTable: self.only_file1 = only_file1_need self.only_file2 = only_file2_need self.data = data_need + + +class OneFileApiMessage: + filePath = '' + kitName = '' + subSystem = '' + apiNumber = 0 + + def __init__(self, file_path, kit_name, sub_system, api_number): + self.filePath = file_path + self.kitName = kit_name + self.subSystem = sub_system + self.apiNumber = api_number + + def set_file_path(self, file_path): + self.filePath = file_path + + def get_file_path(self): + return self.filePath + + def set_kit_name(self, kit_name): + self.kitName = kit_name + + def get_kit_name(self): + return self.kitName + + def set_sub_system(self, sub_system): + self.subSystem = sub_system + + def get_sub_system(self): + return self.subSystem + + def set_api_number(self, api_number): + self.apiNumber = api_number + + def get_api_number(self): + return self.apiNumber + + +class NodeKind(enum.Enum): + MACRO_DEFINITION = 'MACRO_DEFINITION' + STRUCT_DECL = 'STRUCT_DECL' + UNION_DECL = 'UNION_DECL' + ENUM_DECL = 'ENUM_DECL' + FUNCTION_DECL = 'FUNCTION_DECL' + VAR_DECL = 'VAR_DECL' diff --git a/build-tools/capi_parser/src/utils/constants.py b/build-tools/capi_parser/src/utils/constants.py index 9c606194f..4f26ca052 100644 --- a/build-tools/capi_parser/src/utils/constants.py +++ b/build-tools/capi_parser/src/utils/constants.py @@ -31,6 +31,8 @@ class StringConstant(enum.Enum): SELF_INCLUDE_NEW = r'.\sysroot\self_include_files_new' SYSROOT = r'.\sysroot' RESULT_HEAD_NAME = "result_total.xlsx" + PARSER_DIRECT_EXCEL_NAME = 'parser_direct_data.xlsx' + FILE_LEVEL_API_DATA = r'.\file_api_json.json' class RegularExpressions(enum.Enum): -- Gitee