@@ -64,7 +64,8 @@ def main():
64
64
65
65
# Create XCFramework from the arm64 and x64 fat framework.
66
66
xcframeworks = [fat_framework ]
67
- create_xcframework (location = dst , name = 'FlutterMacOS' , frameworks = xcframeworks )
67
+ dsyms = [fat_framework + '.dSYM' ] if args .dsym else None
68
+ create_xcframework (location = dst , name = 'FlutterMacOS' , frameworks = xcframeworks , dsyms = dsyms )
68
69
69
70
if args .zip :
70
71
zip_framework (dst )
@@ -104,28 +105,43 @@ def zip_framework(dst):
104
105
105
106
zip_xcframework_archive (dst )
106
107
107
- dsym_dst = os .path .join (dst , 'FlutterMacOS.dSYM' )
108
- if os .path .exists (dsym_dst ):
108
+ # Generate Flutter.dSYM.zip for manual symbolification.
109
+ #
110
+ # Historically, the framework dSYM was named Flutter.dSYM, so in order to
111
+ # remain backward-compatible with existing instructions in docs/Crashes.md
112
+ # and existing tooling such as dart-lang/dart_ci, we rename back to that name
113
+ #
114
+ # TODO(cbracken): remove these archives and the upload steps once we bundle
115
+ # dSYMs in app archives. https://github.com/flutter/flutter/issues/116493
116
+ framework_dsym = framework_dst + '.dSYM'
117
+ if os .path .exists (framework_dsym ):
118
+ renamed_dsym = framework_dsym .replace ('FlutterMacOS.framework.dSYM' , 'FlutterMacOS.dSYM' )
119
+ os .rename (framework_dsym , renamed_dsym )
120
+
109
121
# Create a zip of just the contents of the dSYM, then create a zip of that zip.
110
122
# TODO(cbracken): remove this once https://github.com/flutter/flutter/issues/125067 is resolved
111
- sky_utils .create_zip (dsym_dst , 'FlutterMacOS.dSYM.zip' , ['.' ])
112
- sky_utils .create_zip (dsym_dst , 'FlutterMacOS.dSYM_.zip' , ['FlutterMacOS.dSYM.zip' ])
123
+ sky_utils .create_zip (renamed_dsym , 'FlutterMacOS.dSYM.zip' , ['.' ])
124
+ sky_utils .create_zip (renamed_dsym , 'FlutterMacOS.dSYM_.zip' , ['FlutterMacOS.dSYM.zip' ])
113
125
114
126
# Move the double-zipped FlutterMacOS.dSYM.zip to dst.
115
- dsym_final_src_path = os .path .join (dsym_dst , 'FlutterMacOS.dSYM_.zip' )
127
+ dsym_final_src_path = os .path .join (renamed_dsym , 'FlutterMacOS.dSYM_.zip' )
116
128
dsym_final_dst_path = os .path .join (dst , 'FlutterMacOS.dSYM.zip' )
117
129
shutil .move (dsym_final_src_path , dsym_final_dst_path )
118
130
119
131
120
132
def zip_xcframework_archive (dst ):
121
- sky_utils .write_codesign_config (os .path .join (dst , 'entitlements.txt' ), [])
122
-
123
- sky_utils .write_codesign_config (
124
- os .path .join (dst , 'without_entitlements.txt' ), [
125
- 'FlutterMacOS.xcframework/macos-arm64_x86_64/'
126
- 'FlutterMacOS.framework/Versions/A/FlutterMacOS'
127
- ]
128
- )
133
+ # pylint: disable=line-too-long
134
+ with_entitlements = []
135
+ with_entitlements_file = os .path .join (dst , 'entitlements.txt' )
136
+ sky_utils .write_codesign_config (with_entitlements_file , with_entitlements )
137
+
138
+ without_entitlements = [
139
+ 'FlutterMacOS.xcframework/macos-arm64_x86_64/FlutterMacOS.framework/Versions/A/FlutterMacOS' ,
140
+ 'FlutterMacOS.xcframework/macos-arm64_x86_64/dSYMs/FlutterMacOS.framework.dSYM/Contents/Resources/DWARF/FlutterMacOS' ,
141
+ ]
142
+ without_entitlements_file = os .path .join (dst , 'without_entitlements.txt' )
143
+ sky_utils .write_codesign_config (without_entitlements_file , without_entitlements )
144
+ # pylint: enable=line-too-long
129
145
130
146
sky_utils .create_zip (
131
147
dst ,
0 commit comments