Skip to content

Commit 8082d39

Browse files
committed
[swift-api-dump] Support arbitrary version strings, e.g., "4.2"
Fixes rdar://problem/41141987.
1 parent b41e98e commit 8082d39

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

utils/swift-api-dump.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
# (Objective-)C APIs, any API notes added on top of those APIs, and the
66
# Clang importer itself. One can execute it to dump the API of a given
77
# module within a particular SDK, e.g., UIKit from the iOS SDK as seen in
8-
# Swift 3 compatibility mode:
8+
# Swift 4 compatibility mode:
99
#
10-
# /path/to/bin/dir/swift-api-dump.py -swift-version 3 -o output-dir \
10+
# /path/to/bin/dir/swift-api-dump.py -swift-version 4 -o output-dir \
1111
# -m UIKit -s iphoneos
1212
#
1313
# The "-m" argument can be omitted, in which case the script will collect
1414
# all of the frameworks in the named SDK(s) and dump their APIs.
1515
#
1616
# One can supply multiple SDKs, written as a list. For example, to
1717
# dump the API for all frameworks across macOS, iOS, watchOS, and tvOS,
18-
# in Swift 4, use:
18+
# in Swift 4.2, use:
1919
#
20-
# /path/to/bin/dir/swift-api-dump.py -swift-version 4 -o output-dir \
20+
# /path/to/bin/dir/swift-api-dump.py -swift-version 4.2 -o output-dir \
2121
# -s macosx iphoneos watchos appletvos
2222
#
2323

@@ -102,7 +102,7 @@ def create_parser():
102102
parser.add_argument('--enable-infer-import-as-member', action='store_true',
103103
help='Infer when a global could be imported as a ' +
104104
'member.')
105-
parser.add_argument('-swift-version', type=int, metavar='N',
105+
parser.add_argument('-swift-version', metavar='N',
106106
help='the Swift version to use')
107107
parser.add_argument('-show-overlay', action='store_true',
108108
help='Show overlay API in addition to Objective-C ' +
@@ -326,7 +326,7 @@ def main():
326326
if args.enable_infer_import_as_member:
327327
extra_args = extra_args + ['-enable-infer-import-as-member']
328328
if args.swift_version:
329-
extra_args = extra_args + ['-swift-version', '%d' % args.swift_version]
329+
extra_args = extra_args + ['-swift-version', '%s' % args.swift_version]
330330

331331
# Create a .swift file we can feed into swift-ide-test
332332
subprocess.call(['touch', source_filename])

0 commit comments

Comments
 (0)