@@ -97,7 +97,7 @@ def create_directory(path):
97
97
98
98
99
99
class DumpConfig :
100
- def __init__ (self , tool_path , platform , platform_alias , verbose ):
100
+ def __init__ (self , tool_path , platform , platform_alias , abi , verbose ):
101
101
target_map = {
102
102
'iphoneos' : 'arm64-apple-ios13.0' ,
103
103
'macosx' : 'x86_64-apple-macosx10.15' ,
@@ -111,6 +111,7 @@ def __init__(self, tool_path, platform, platform_alias, verbose):
111
111
self .sdk = get_sdk_path (platform )
112
112
self .inputs = []
113
113
self .platform_alias = platform_alias
114
+ self .abi = abi
114
115
if self .platform == 'macosx' :
115
116
# We need this input search path for CreateML
116
117
self .inputs .extend ([self .sdk + '/usr/lib/swift/' ])
@@ -126,6 +127,10 @@ def __init__(self, tool_path, platform, platform_alias, verbose):
126
127
127
128
def dumpZipperedContent (self , cmd , output , module ):
128
129
dir_path = os .path .realpath (output + '/' + module )
130
+ if self .abi :
131
+ dir_path = os .path .join (dir_path , 'ABI' )
132
+ else :
133
+ dir_path = os .path .join (dir_path , 'API' )
129
134
file_path = os .path .realpath (dir_path + '/' + self .platform_alias +
130
135
'.json' )
131
136
create_directory (dir_path )
@@ -145,6 +150,8 @@ def run(self, output, module, swift_ver, opts,
145
150
cmd .extend (['-iframework' , path ])
146
151
for path in self .inputs :
147
152
cmd .extend (['-I' , path ])
153
+ if self .abi :
154
+ cmd .extend (['-abi' ])
148
155
cmd .extend (['-' + o for o in opts ])
149
156
if self .verbose :
150
157
cmd .extend (['-v' ])
@@ -176,14 +183,17 @@ def run(self, output, module, swift_ver, opts,
176
183
177
184
178
185
class DiagnoseConfig :
179
- def __init__ (self , tool_path ):
186
+ def __init__ (self , tool_path , abi ):
180
187
self .tool_path = get_api_digester_path (tool_path )
188
+ self .abi = abi
181
189
182
190
def run (self , opts , before , after , output , verbose ):
183
191
cmd = [self .tool_path , '-diagnose-sdk' , '-input-paths' , before ,
184
192
'-input-paths' , after , '-print-module' ]
185
193
if output :
186
194
cmd .extend (['-o' , output ])
195
+ if self .abi :
196
+ cmd .extend (['-abi' ])
187
197
cmd .extend (['-' + o for o in opts ])
188
198
if verbose :
189
199
cmd .extend (['-v' ])
@@ -258,6 +268,10 @@ def main():
258
268
help = 'dump module content to a dir with files for'
259
269
'seprately targets' )
260
270
271
+ basic_group .add_argument ('--abi' ,
272
+ action = 'store_true' ,
273
+ help = 'Process verbosely' )
274
+
261
275
basic_group .add_argument ('--platform-alias' , default = '' , help = '''
262
276
Specify a file name to use if using a platform name in json file isn't
263
277
optimal
@@ -285,6 +299,7 @@ def main():
285
299
args .platform_alias = args .target
286
300
runner = DumpConfig (tool_path = args .tool_path , platform = args .target ,
287
301
platform_alias = args .platform_alias ,
302
+ abi = args .abi ,
288
303
verbose = args .v )
289
304
runner .run (output = args .output , module = args .module ,
290
305
swift_ver = args .swift_version , opts = args .opts ,
@@ -297,7 +312,7 @@ def main():
297
312
fatal_error ("Need to specify --dump-before" )
298
313
if not args .dump_after :
299
314
fatal_error ("Need to specify --dump-after" )
300
- runner = DiagnoseConfig (tool_path = args .tool_path )
315
+ runner = DiagnoseConfig (tool_path = args .tool_path , abi = args . abi )
301
316
runner .run (opts = args .opts , before = args .dump_before ,
302
317
after = args .dump_after , output = args .output , verbose = args .v )
303
318
else :
0 commit comments