Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit c6dc1b3

Browse files
authored
Ignore armv7 in ios framework script (#32638)
1 parent c4cdeb0 commit c6dc1b3

File tree

1 file changed

+21
-43
lines changed

1 file changed

+21
-43
lines changed

sky/tools/create_ios_framework.py

Lines changed: 21 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,21 @@ def main():
3030

3131
args = parser.parse_args()
3232

33-
fat_framework = os.path.join(args.dst, 'Flutter.framework')
34-
fat_simulator_framework = os.path.join(args.dst, 'sim', 'Flutter.framework')
33+
framework = os.path.join(args.dst, 'Flutter.framework')
34+
simulator_framework = os.path.join(args.dst, 'sim', 'Flutter.framework')
3535
arm64_framework = os.path.join(args.arm64_out_dir, 'Flutter.framework')
36-
armv7_framework = os.path.join(args.armv7_out_dir, 'Flutter.framework')
3736
simulator_x64_framework = os.path.join(args.simulator_x64_out_dir, 'Flutter.framework')
3837
if args.simulator_arm64_out_dir is not None:
3938
simulator_arm64_framework = os.path.join(args.simulator_arm64_out_dir, 'Flutter.framework')
4039
simulator_arm64_dylib = os.path.join(simulator_arm64_framework, 'Flutter')
4140

4241
arm64_dylib = os.path.join(arm64_framework, 'Flutter')
43-
armv7_dylib = os.path.join(armv7_framework, 'Flutter')
4442
simulator_x64_dylib = os.path.join(simulator_x64_framework, 'Flutter')
4543

4644
if not os.path.isdir(arm64_framework):
4745
print('Cannot find iOS arm64 Framework at %s' % arm64_framework)
4846
return 1
4947

50-
if not os.path.isdir(armv7_framework):
51-
print('Cannot find iOS armv7 Framework at %s' % armv7_framework)
52-
return 1
53-
5448
if not os.path.isdir(simulator_x64_framework):
5549
print('Cannot find iOS x64 simulator Framework at %s' % simulator_framework)
5650
return 1
@@ -59,10 +53,6 @@ def main():
5953
print('Cannot find iOS arm64 dylib at %s' % arm64_dylib)
6054
return 1
6155

62-
if not os.path.isfile(armv7_dylib):
63-
print('Cannot find iOS armv7 dylib at %s' % armv7_dylib)
64-
return 1
65-
6656
if not os.path.isfile(simulator_x64_dylib):
6757
print('Cannot find iOS simulator dylib at %s' % simulator_dylib)
6858
return 1
@@ -71,27 +61,16 @@ def main():
7161
print('Cannot find dsymutil at %s' % DSYMUTIL)
7262
return 1
7363

74-
shutil.rmtree(fat_framework, True)
75-
shutil.copytree(arm64_framework, fat_framework)
76-
77-
fat_framework_binary = os.path.join(fat_framework, 'Flutter')
78-
79-
# Create the arm-only fat framework.
80-
subprocess.check_call([
81-
'lipo',
82-
arm64_dylib,
83-
armv7_dylib,
84-
'-create',
85-
'-output',
86-
fat_framework_binary
87-
])
88-
process_framework(args, fat_framework, fat_framework_binary)
64+
shutil.rmtree(framework, True)
65+
shutil.copytree(arm64_framework, framework)
66+
framework_binary = os.path.join(framework, 'Flutter')
67+
process_framework(args, framework, framework_binary)
8968

9069
if args.simulator_arm64_out_dir is not None:
91-
shutil.rmtree(fat_simulator_framework, True)
92-
shutil.copytree(simulator_arm64_framework, fat_simulator_framework)
70+
shutil.rmtree(simulator_framework, True)
71+
shutil.copytree(simulator_arm64_framework, simulator_framework)
9372

94-
fat_simulator_framework_binary = os.path.join(fat_simulator_framework, 'Flutter')
73+
simulator_framework_binary = os.path.join(simulator_framework, 'Flutter')
9574

9675
# Create the arm64/x64 simulator fat framework.
9776
subprocess.check_call([
@@ -100,46 +79,45 @@ def main():
10079
simulator_arm64_dylib,
10180
'-create',
10281
'-output',
103-
fat_simulator_framework_binary
82+
simulator_framework_binary
10483
])
105-
process_framework(args, fat_simulator_framework, fat_simulator_framework_binary)
106-
simulator_framework = fat_simulator_framework
84+
process_framework(args, simulator_framework, simulator_framework_binary)
85+
simulator_framework = simulator_framework
10786
else:
10887
simulator_framework = simulator_x64_framework
10988

11089
# Create XCFramework from the arm-only fat framework and the arm64/x64 simulator frameworks, or just the
11190
# x64 simulator framework if only that one exists.
112-
xcframeworks = [simulator_framework, fat_framework]
91+
xcframeworks = [simulator_framework, framework]
11392
create_xcframework(location=args.dst, name='Flutter', frameworks=xcframeworks)
11493

11594
# Add the x64 simulator into the fat framework
11695
subprocess.check_call([
11796
'lipo',
11897
arm64_dylib,
119-
armv7_dylib,
12098
simulator_x64_dylib,
12199
'-create',
122100
'-output',
123-
fat_framework_binary
101+
framework_binary
124102
])
125103

126-
process_framework(args, fat_framework, fat_framework_binary)
104+
process_framework(args, framework, framework_binary)
127105

128106

129-
def process_framework(args, fat_framework, fat_framework_binary):
107+
def process_framework(args, framework, framework_binary):
130108
if args.strip_bitcode:
131-
subprocess.check_call(['xcrun', 'bitcode_strip', '-r', fat_framework_binary, '-o', fat_framework_binary])
109+
subprocess.check_call(['xcrun', 'bitcode_strip', '-r', framework_binary, '-o', framework_binary])
132110

133111
if args.dsym:
134-
dsym_out = os.path.splitext(fat_framework)[0] + '.dSYM'
135-
subprocess.check_call([DSYMUTIL, '-o', dsym_out, fat_framework_binary])
112+
dsym_out = os.path.splitext(framework)[0] + '.dSYM'
113+
subprocess.check_call([DSYMUTIL, '-o', dsym_out, framework_binary])
136114

137115
if args.strip:
138116
# copy unstripped
139117
unstripped_out = os.path.join(args.dst, 'Flutter.unstripped')
140-
shutil.copyfile(fat_framework_binary, unstripped_out)
118+
shutil.copyfile(framework_binary, unstripped_out)
141119

142-
subprocess.check_call(["strip", "-x", "-S", fat_framework_binary])
120+
subprocess.check_call(["strip", "-x", "-S", framework_binary])
143121

144122

145123
if __name__ == '__main__':

0 commit comments

Comments
 (0)