diff --git a/build-tools/clean_ndk_ani.py b/build-tools/clean_ndk_ani.py index 94735f25f4c4b338567c2e1804bef3a6425b3d94..5457bfc29b55142b64f29654e20965e698f285fd 100755 --- a/build-tools/clean_ndk_ani.py +++ b/build-tools/clean_ndk_ani.py @@ -83,20 +83,21 @@ def clean_ndk_ani_headers(ndk_header_path): process_header_file(file_path) -def clean_json__systemCapability_headers(capability_header_path): +# Clear the ani header file in the systemCapability configuration json file +def clean_json_systemCapability_headers(capability_header_path): try: with open(capability_header_path, 'r') as f: systemCapabilitys = json.load(f) except Exception as e: print(f"Error reading JSON file: {str(e)}") return - + # Traverse all levels of items for _systemCapability in systemCapabilitys: # filtering ani header file - systemCapabilitys[_systemCapability] = [item for item in systemCapabilitys[_systemCapability] - if os.path.basename(item) not in _ANI_HEADER_LISTS] - + systemCapabilitys[_systemCapability] = [item for item in systemCapabilitys[_systemCapability] + if os.path.basename(item) not in _ANI_HEADER_LISTS] + # Saving the modified JSON try: with open(capability_header_path, 'w') as f: @@ -117,9 +118,9 @@ def main(): return clean_ndk_ani_headers(args.ndk_header_path) - clean_json__systemCapability_headers(args.system_capability_header_config) + clean_json_systemCapability_headers(args.system_capability_header_config) print("Ani Header file cleanup complete!") if __name__ == '__main__': - main() + main() \ No newline at end of file