Skip to content

Commit ea978d9

Browse files
committed
[api_checker/infer-imports.py] Look for Swift-only frameworks as well
1 parent 69c05c0 commit ea978d9

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

utils/api_checker/sdk-module-lists/infer-imports.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
import os
44
import sys
55

6-
blacklist = ["Kernel", "Ruby", "Tk"]
6+
blacklist = [
7+
"Kernel", "Ruby", "Tk",
8+
"DriverKit", "HIDDriverKit", "SkywalkDriverKit", # has C++ code
9+
"NetworkingDriverKit", "USBSerialDriverKit", # has C++ code
10+
]
711

812

913
def get_immediate_subdirectories(a_dir):
@@ -16,11 +20,19 @@ def get_frameworks(sdk_path):
1620
names = []
1721
for frame in os.listdir(frameworks_path):
1822
if frame.endswith(".framework"):
23+
name = frame[:-len(".framework")]
1924
header_dir_path = frameworks_path + '/' + frame + '/Headers'
2025
module_dir_path = frameworks_path + '/' + frame + '/Modules'
26+
swiftmodule_path = module_dir_path + '/' + name + '.swiftmodule'
2127
old_modulemap_path = frameworks_path + '/' + frame + '/module.map'
2228
old_modulemap_private_path = frameworks_path + '/' + frame + \
2329
'/module_private.map'
30+
31+
if os.path.exists(swiftmodule_path):
32+
if name not in blacklist:
33+
names.append(name)
34+
continue
35+
2436
if not os.path.exists(header_dir_path):
2537
if os.path.exists(module_dir_path):
2638
print >>sys.stderr, header_dir_path, \
@@ -36,7 +48,6 @@ def get_frameworks(sdk_path):
3648
if should_exclude_framework(frameworks_path + '/' + frame):
3749
continue
3850

39-
name = frame[:-len(".framework")]
4051
if name in blacklist:
4152
continue
4253
names.append(name)

0 commit comments

Comments
 (0)