1313import subprocess
1414import sys
1515
16- from create_xcframework import create_xcframework
16+ from create_xcframework import create_xcframework # pylint: disable=import-error
1717
1818DSYMUTIL = os .path .join (
1919 os .path .dirname (__file__ ), '..' , '..' , '..' , 'buildtools' , 'mac-x64' ,
@@ -39,8 +39,8 @@ def main():
3939 parser .add_argument ('--arm64-out-dir' , type = str , required = True )
4040 parser .add_argument ('--simulator-x64-out-dir' , type = str , required = True )
4141 parser .add_argument ('--simulator-arm64-out-dir' , type = str , required = False )
42- parser .add_argument ('--strip' , action = " store_true" , default = False )
43- parser .add_argument ('--dsym' , action = " store_true" , default = False )
42+ parser .add_argument ('--strip' , action = ' store_true' , default = False )
43+ parser .add_argument ('--dsym' , action = ' store_true' , default = False )
4444
4545 args = parser .parse_args ()
4646
@@ -108,9 +108,10 @@ def main():
108108 process_framework (args , dst , framework , framework_binary )
109109 generate_gen_snapshot (args , dst , x64_out_dir , arm64_out_dir )
110110 zip_archive (dst )
111+ return 0
111112
112113
113- def create_framework (
114+ def create_framework ( # pylint: disable=too-many-arguments
114115 args , dst , framework , arm64_framework , simulator_framework ,
115116 simulator_x64_framework , simulator_arm64_framework
116117):
@@ -122,7 +123,7 @@ def create_framework(
122123 return 1
123124
124125 if not os .path .isfile (simulator_x64_dylib ):
125- print ('Cannot find iOS simulator dylib at %s' % simulator_dylib )
126+ print ('Cannot find iOS simulator dylib at %s' % simulator_x64_dylib )
126127 return 1
127128
128129 shutil .rmtree (framework , True )
@@ -143,12 +144,12 @@ def create_framework(
143144 process_framework (
144145 args , dst , simulator_framework , simulator_framework_binary
145146 )
146- simulator_framework = simulator_framework
147147 else :
148148 simulator_framework = simulator_x64_framework
149149
150- # Create XCFramework from the arm-only fat framework and the arm64/x64 simulator frameworks, or just the
151- # x64 simulator framework if only that one exists.
150+ # Create XCFramework from the arm-only fat framework and the arm64/x64
151+ # simulator frameworks, or just the x64 simulator framework if only that one
152+ # exists.
152153 xcframeworks = [simulator_framework , framework ]
153154 create_xcframework (location = dst , name = 'Flutter' , frameworks = xcframeworks )
154155
@@ -158,10 +159,12 @@ def create_framework(
158159 framework_binary
159160 ])
160161
162+ return 0
163+
161164
162165def embed_codesign_configuration (config_path , contents ):
163- with open (config_path , 'w' ) as f :
164- f .write ('\n ' .join (contents ) + '\n ' )
166+ with open (config_path , 'w' ) as file :
167+ file .write ('\n ' .join (contents ) + '\n ' )
165168
166169
167170def zip_archive (dst ):
@@ -189,7 +192,7 @@ def zip_archive(dst):
189192 'without_entitlements.txt' ,
190193 ],
191194 cwd = dst )
192- if ( os .path .exists (os .path .join (dst , 'Flutter.dSYM' ) )):
195+ if os .path .exists (os .path .join (dst , 'Flutter.dSYM' )):
193196 subprocess .check_call (['zip' , '-r' , 'Flutter.dSYM.zip' , 'Flutter.dSYM' ],
194197 cwd = dst )
195198
@@ -204,7 +207,7 @@ def process_framework(args, dst, framework, framework_binary):
204207 unstripped_out = os .path .join (dst , 'Flutter.unstripped' )
205208 shutil .copyfile (framework_binary , unstripped_out )
206209
207- subprocess .check_call ([" strip" , "-x" , "-S" , framework_binary ])
210+ subprocess .check_call ([' strip' , '-x' , '-S' , framework_binary ])
208211
209212
210213def generate_gen_snapshot (args , dst , x64_out_dir , arm64_out_dir ):
0 commit comments