Skip to content

Commit 417081d

Browse files
committed
---
yaml --- r: 349527 b: refs/heads/master-next c: c0de4e1 h: refs/heads/master i: 349525: e3bcfb7 349523: 18f998d 349519: da8a0a5
1 parent 064bc62 commit 417081d

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
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: 6f32b4e5d02f5c1e471c1e5a257a3244cf13e8f7
3+
refs/heads/master-next: c0de4e1126dc1527d409f9741009bd9487bfc107
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/swift-api-checker.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def create_directory(path):
9797

9898

9999
class DumpConfig:
100-
def __init__(self, tool_path, platform):
100+
def __init__(self, tool_path, platform, platform_alias):
101101
target_map = {
102102
'iphoneos': 'arm64-apple-ios13.0',
103103
'macosx': 'x86_64-apple-macosx10.15',
@@ -110,12 +110,11 @@ def __init__(self, tool_path, platform):
110110
self.target = target_map[platform]
111111
self.sdk = get_sdk_path(platform)
112112
self.inputs = []
113+
self.platform_alias = platform_alias
113114
if self.platform == 'macosx':
114115
# We need this input search path for CreateML
115116
self.inputs.extend([self.sdk + '/usr/lib/swift/'])
116-
self.frameworks = [
117-
self.sdk + '/System/Library/Frameworks/',
118-
os.path.realpath(self.sdk + '/../../Library/Frameworks/')]
117+
self.frameworks = []
119118
if self.platform.startswith('iosmac'):
120119
# Catalyst modules need this extra framework dir
121120
iOSSupport = self.sdk + \
@@ -156,7 +155,8 @@ def run(self, output, module, swift_ver, opts, verbose,
156155
continue
157156
dir_path = os.path.realpath(output + '/' + module)
158157
file_path = os.path.realpath(dir_path + '/' +
159-
self.platform + '.json')
158+
self.platform_alias +
159+
'.json')
160160
create_directory(dir_path)
161161
current_cmd = list(cmd)
162162
current_cmd.extend(['-module', module])
@@ -245,6 +245,12 @@ def main():
245245
action='store_true',
246246
help='When importing entire SDK, dump content '
247247
'seprately by module names')
248+
249+
basic_group.add_argument('--platform-alias', default='', help='''
250+
Specify a file name to use if using a platform name in json file isn't
251+
optimal
252+
''')
253+
248254
args = parser.parse_args(sys.argv[1:])
249255

250256
if args.action == 'dump':
@@ -263,7 +269,10 @@ def main():
263269
include_fixed_clang_modules = False
264270
else:
265271
fatal_error("cannot recognize --module-filter")
266-
runner = DumpConfig(tool_path=args.tool_path, platform=args.target)
272+
if args.platform_alias == '':
273+
args.platform_alias = args.target
274+
runner = DumpConfig(tool_path=args.tool_path, platform=args.target,
275+
platform_alias=args.platform_alias)
267276
runner.run(output=args.output, module=args.module,
268277
swift_ver=args.swift_version, opts=args.opts,
269278
verbose=args.v,

0 commit comments

Comments
 (0)