Skip to content

[api_checker/infer-imports.py] Look for Swift-only frameworks as well #25396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions utils/api_checker/sdk-module-lists/infer-imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import os
import sys

blacklist = ["Kernel", "Ruby", "Tk"]
blacklist = [
"Kernel", "Ruby", "Tk",
"DriverKit", "HIDDriverKit", "SkywalkDriverKit", # has C++ code
"NetworkingDriverKit", "USBSerialDriverKit", # has C++ code
]


def get_immediate_subdirectories(a_dir):
Expand All @@ -16,11 +20,19 @@ def get_frameworks(sdk_path):
names = []
for frame in os.listdir(frameworks_path):
if frame.endswith(".framework"):
name = frame[:-len(".framework")]
header_dir_path = frameworks_path + '/' + frame + '/Headers'
module_dir_path = frameworks_path + '/' + frame + '/Modules'
swiftmodule_path = module_dir_path + '/' + name + '.swiftmodule'
old_modulemap_path = frameworks_path + '/' + frame + '/module.map'
old_modulemap_private_path = frameworks_path + '/' + frame + \
'/module_private.map'

if os.path.exists(swiftmodule_path):
if name not in blacklist:
names.append(name)
continue

if not os.path.exists(header_dir_path):
if os.path.exists(module_dir_path):
print >>sys.stderr, header_dir_path, \
Expand All @@ -36,7 +48,6 @@ def get_frameworks(sdk_path):
if should_exclude_framework(frameworks_path + '/' + frame):
continue

name = frame[:-len(".framework")]
if name in blacklist:
continue
names.append(name)
Expand Down