[utils/api_checker] Adjust the script for inferring imports from an SDK and add a couple of utility scripts

This commit is contained in:
Argyrios Kyrtzidis
2020-08-17 17:17:38 -07:00
parent f911be8e42
commit 0701eb7d4c
7 changed files with 92 additions and 5 deletions

View File

@@ -8,7 +8,8 @@ import sys
denylist = [
"Kernel", "Ruby", "Tk",
"DriverKit", "HIDDriverKit", "SkywalkDriverKit", # has C++ code
"NetworkingDriverKit", "USBSerialDriverKit", # has C++ code
"NetworkingDriverKit", "USBSerialDriverKit", "PCIDriverKit", # has C++ code
"USBDriverKit", # has C++ code
]
@@ -46,6 +47,8 @@ def get_frameworks(sdk_path, swift_frameworks_only):
frameworks_path = sdk_path + "/System/Library/Frameworks"
names = []
for frame in os.listdir(frameworks_path):
if frame[0] == '_':
continue
if frame.endswith(".framework"):
name = frame[:-len(".framework")]
header_dir_path = frameworks_path + '/' + frame + '/Headers'
@@ -106,8 +109,6 @@ def should_exclude_framework(frame_path):
contents = open(module_map_path).read()
if "requires !swift" in contents:
return True
if "requires unavailable" in contents:
return True
return False