From 014c00243b589d11a5f621f0cc0165ce6694af5f Mon Sep 17 00:00:00 2001 From: anjiaqi Date: Tue, 24 Jun 2025 17:30:14 +0800 Subject: [PATCH] Enhance description of inconsistent message Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICHHNL Reason: The current check-build-system-consistency script only checks the inconsistent dependency files and locates the paths of these files without providing corresponding position information for where to add these inconsistent files. Description: Based on providing only the inconsistent files and their path information, we have additionally included the corresponding location details where these file paths should be supplemented. Signed-off-by: anjiaqi --- ets2panda/public/CMakeLists.txt | 2 -- .../scripts/check_build_system_consistency.py | 29 +++++++++++++++---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/ets2panda/public/CMakeLists.txt b/ets2panda/public/CMakeLists.txt index 5579b1ef08..ef2a7b7b65 100644 --- a/ets2panda/public/CMakeLists.txt +++ b/ets2panda/public/CMakeLists.txt @@ -628,8 +628,6 @@ add_custom_command( DEPENDS ${HEADERS_TO_BE_PARSED} ${HEADERS_PARSER_SOURCES} ${GENERATED_STAMP} ) - - add_custom_target(gen_yamls DEPENDS es2panda_options_gen es2panda_keywords ${ES2PANDA_API_GENERATED} ${HEADERS_PARSER_SOURCES}) diff --git a/ets2panda/scripts/check_build_system_consistency.py b/ets2panda/scripts/check_build_system_consistency.py index fd36c912c0..ecae9d8327 100755 --- a/ets2panda/scripts/check_build_system_consistency.py +++ b/ets2panda/scripts/check_build_system_consistency.py @@ -125,7 +125,7 @@ def parse_gn(file_path): return sources, sources_dict, headers, headers_dict, yamls, yamls_dict -def compare_file_lists(cmake_files, cmake_files_dict, gn_files, gn_files_dict, file_type): +def compare_file_lists(cmake_files, cmake_files_dict, gn_files, gn_files_dict, file_type, location): cmake_set = set(cmake_files) gn_set = set(gn_files) @@ -136,12 +136,24 @@ def compare_file_lists(cmake_files, cmake_files_dict, gn_files, gn_files_dict, f only_in_cmake_path = [] for file in only_in_cmake: only_in_cmake_path.append(cmake_files_dict[file]) - print(f"{file_type} only exist in CMake file:", sorted(only_in_cmake_path)) + print(f"{file_type} files only exist in CMake file:", sorted(only_in_cmake_path)) + if file_type == "source file(.cpp)": + print( + f"please add the missing {file_type} files to libes2panda_sources in ets2panda/BUILD.gn!" + ) + else: + print(f"please add the missing {file_type} files to {location} in ets2panda/BUILD.gn!") if only_in_gn: only_in_gn_path = [] for file in only_in_gn: only_in_gn_path.append(gn_files_dict[file]) - print(f"{file_type} only exist in GN file:", sorted(only_in_gn_path)) + print(f"{file_type} files only exist in GN file:", sorted(only_in_gn_path)) + if file_type == "source file(.cpp)": + print(f"please add the missing {file_type} files to {location} in ets2panda/CMakeList.txt!") + else: + print( + f"please add the missing {file_type} files to {location} in ets2panda/public/CMakeList.txt!" + ) return len(only_in_cmake) == 0 and len(only_in_gn) == 0 @@ -161,13 +173,18 @@ def main(): ) src_consistent = compare_file_lists( - cmake_src, cmake_src_dict, gn_src, gn_src_dict, "source file(.cpp)" + cmake_src, cmake_src_dict, gn_src, gn_src_dict, "*.cpp", "ES2PANDA_LIB_SRC" ) hdr_consistent = compare_file_lists( - cmake_hdr, cmake_hdr_dict, gn_hdr, gn_hdr_dict, "header file(.h)" + cmake_hdr, cmake_hdr_dict, gn_hdr, gn_hdr_dict, "*.h", "HEADERS_TO-BE-PARSED" ) yaml_consistent = compare_file_lists( - cmake_yaml, cmake_yaml_dict, gn_yaml, gn_yaml_dict, "YAML file(.yaml)" + cmake_yaml, + cmake_yaml_dict, + gn_yaml, + gn_yaml_dict, + "*.yaml", + "ES2PANDA_API_GENERATED", ) if src_consistent and hdr_consistent and yaml_consistent: -- Gitee