@@ -143,11 +143,20 @@ def create_framework( # pylint: disable=too-many-arguments
143
143
print ('Cannot find iOS simulator dylib at %s' % simulator_x64_dylib )
144
144
return 1
145
145
146
+ # Compute dsym output paths, if enabled.
147
+ framework_dsym = None
148
+ simulator_dsym = None
149
+ if args .dsym :
150
+ framework_dsym = os .path .splitext (framework )[0 ] + '.dSYM'
151
+ simulator_dsym = os .path .splitext (simulator_framework )[0 ] + '.dSYM'
152
+
153
+ # Emit the framework for physical devices.
146
154
shutil .rmtree (framework , True )
147
155
shutil .copytree (arm64_framework , framework )
148
156
framework_binary = os .path .join (framework , 'Flutter' )
149
- process_framework (args , dst , framework , framework_binary )
157
+ process_framework (args , dst , framework_binary , framework_dsym )
150
158
159
+ # Emit the framework for simulators.
151
160
if args .simulator_arm64_out_dir is not None :
152
161
shutil .rmtree (simulator_framework , True )
153
162
shutil .copytree (simulator_arm64_framework , simulator_framework )
@@ -159,22 +168,23 @@ def create_framework( # pylint: disable=too-many-arguments
159
168
'lipo' , simulator_x64_dylib , simulator_arm64_dylib , '-create' , '-output' ,
160
169
simulator_framework_binary
161
170
])
162
- process_framework (args , dst , simulator_framework , simulator_framework_binary )
171
+ process_framework (args , dst , simulator_framework_binary , simulator_dsym )
163
172
else :
164
173
simulator_framework = simulator_x64_framework
165
174
166
175
# Create XCFramework from the arm-only fat framework and the arm64/x64
167
176
# simulator frameworks, or just the x64 simulator framework if only that one
168
177
# exists.
169
178
xcframeworks = [simulator_framework , framework ]
170
- create_xcframework (location = dst , name = 'Flutter' , frameworks = xcframeworks )
179
+ dsyms = [simulator_dsym , framework_dsym ] if args .dsym else None
180
+ create_xcframework (location = dst , name = 'Flutter' , frameworks = xcframeworks , dsyms = dsyms )
171
181
172
- # Add the x64 simulator into the fat framework
182
+ # Add the x64 simulator into the fat framework.
173
183
subprocess .check_call ([
174
184
'lipo' , arm64_dylib , simulator_x64_dylib , '-create' , '-output' , framework_binary
175
185
])
176
186
177
- process_framework (args , dst , framework , framework_binary )
187
+ process_framework (args , dst , framework_binary , framework_dsym )
178
188
return 0
179
189
180
190
@@ -215,16 +225,14 @@ def zip_archive(dst):
215
225
subprocess .check_call (['zip' , '-r' , 'extension_safe_Flutter.dSYM.zip' , 'Flutter.dSYM' ], cwd = dst )
216
226
217
227
218
- def process_framework (args , dst , framework , framework_binary ):
219
- if args .dsym :
220
- dsym_out = os .path .splitext (framework )[0 ] + '.dSYM'
221
- subprocess .check_call ([DSYMUTIL , '-o' , dsym_out , framework_binary ])
228
+ def process_framework (args , dst , framework_binary , dsym ):
229
+ if dsym :
230
+ subprocess .check_call ([DSYMUTIL , '-o' , dsym , framework_binary ])
222
231
223
232
if args .strip :
224
233
# copy unstripped
225
234
unstripped_out = os .path .join (dst , 'Flutter.unstripped' )
226
235
shutil .copyfile (framework_binary , unstripped_out )
227
-
228
236
subprocess .check_call (['strip' , '-x' , '-S' , framework_binary ])
229
237
230
238
0 commit comments