Skip to content

Commit 3434e1a

Browse files
committed
---
yaml --- r: 349443 b: refs/heads/master-next c: 29b9aec h: refs/heads/master i: 349441: 9aaf3ae 349439: 5ea090b
1 parent 9c3f63d commit 3434e1a

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: 2c083310479a43ffc4c5eefd54697ffc53967537
3+
refs/heads/master-next: 29b9aec1ad13365727a66e7e05a0866f310a02ba
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/utils/api_checker/sdk-module-lists/infer-imports.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,31 @@ def get_immediate_subdirectories(a_dir):
1515
if os.path.isdir(os.path.join(a_dir, name))]
1616

1717

18+
def collect_catalyst_frameworks(frameworks_path):
19+
names = []
20+
for frame in os.listdir(frameworks_path):
21+
if frame.endswith(".framework"):
22+
name = frame[:-len(".framework")]
23+
# using the existence of this interface file as a sign of catalyst
24+
# being supported
25+
macabi_interface_path = \
26+
os.path.join(frameworks_path, frame,
27+
'Modules', name + '.swiftmodule',
28+
'x86_64-apple-ios-macabi.swiftinterface')
29+
if os.path.exists(macabi_interface_path):
30+
if name not in blacklist:
31+
names.append(name)
32+
return names
33+
34+
35+
def get_catalyst_frameworks(sdk_path):
36+
frameworks_path = sdk_path + "/System/Library/Frameworks"
37+
ios_support_path = sdk_path + \
38+
'/System/iOSSupport/System/Library/Frameworks/'
39+
return collect_catalyst_frameworks(frameworks_path) + \
40+
collect_catalyst_frameworks(ios_support_path)
41+
42+
1843
def get_frameworks(sdk_path, swift_frameworks_only):
1944
frameworks_path = sdk_path + "/System/Library/Frameworks"
2045
names = []
@@ -113,6 +138,7 @@ def main():
113138
parser.add_option("--swift-frameworks-only", action="store_true")
114139
parser.add_option("--swift-overlay-only", action="store_true")
115140
parser.add_option("--v", action="store_true")
141+
parser.add_option("--catalyst", action="store_true")
116142
(opts, cmd) = parser.parse_args()
117143

118144
if not opts.sdk:
@@ -125,7 +151,14 @@ def main():
125151
if opts.swift_overlay_only:
126152
frames = get_overlays(opts.sdk)
127153
else:
128-
frames = get_frameworks(opts.sdk, opts.swift_frameworks_only)
154+
if opts.catalyst:
155+
if opts.swift_frameworks_only:
156+
frames = get_catalyst_frameworks(opts.sdk)
157+
else:
158+
parser.error("only support find catalyst frameworks "
159+
"with --swift-frameworks-only")
160+
else:
161+
frames = get_frameworks(opts.sdk, opts.swift_frameworks_only)
129162
if opts.v:
130163
for name in frames:
131164
print >>sys.stderr, 'Including: ', name

0 commit comments

Comments
 (0)