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

Commit d2b69fe

Browse files
authored
Require armv7 in create_ios_framework.py (#4944)
This enforces that iOS Flutter.framework builds include arm64, armv7, and x86_64 (simulator) architectures. This change also eliminates the previous --device-out-dir option, which has been replaced by --arm64-out-dir.
1 parent b6f466b commit d2b69fe

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

sky/tools/create_ios_framework.py

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,26 @@ def main():
1414
parser = argparse.ArgumentParser(description='Creates Flutter.framework')
1515

1616
parser.add_argument('--dst', type=str, required=True)
17-
# TODO(cbracken) eliminate --device-out-dir and make armv7-out-dir and
18-
# arm64-out-dir required once bot recipe is updated.
19-
parser.add_argument('--device-out-dir', type=str, required=False)
20-
parser.add_argument('--arm64-out-dir', type=str, required=False)
21-
parser.add_argument('--armv7-out-dir', type=str, required=False)
17+
parser.add_argument('--arm64-out-dir', type=str, required=True)
18+
parser.add_argument('--armv7-out-dir', type=str, required=True)
2219
parser.add_argument('--simulator-out-dir', type=str, required=True)
2320

2421
args = parser.parse_args()
25-
if not (args.arm64_out_dir or args.device_out_dir):
26-
print 'One of --device-out-dir or --arm64-out-dir must be specified'
2722

2823
fat_framework = os.path.join(args.dst, 'Flutter.framework')
29-
arm64_framework = os.path.join(args.arm64_out_dir if args.arm64_out_dir else args.device_out_dir, 'Flutter.framework')
30-
armv7_framework = os.path.join(args.armv7_out_dir, 'Flutter.framework') if args.armv7_out_dir else None
24+
arm64_framework = os.path.join(args.arm64_out_dir, 'Flutter.framework')
25+
armv7_framework = os.path.join(args.armv7_out_dir, 'Flutter.framework')
3126
simulator_framework = os.path.join(args.simulator_out_dir, 'Flutter.framework')
3227

3328
arm64_dylib = os.path.join(arm64_framework, 'Flutter')
34-
armv7_dylib = os.path.join(armv7_framework, 'Flutter') if args.armv7_out_dir else None
29+
armv7_dylib = os.path.join(armv7_framework, 'Flutter')
3530
simulator_dylib = os.path.join(simulator_framework, 'Flutter')
3631

3732
if not os.path.isdir(arm64_framework):
3833
print 'Cannot find iOS arm64 Framework at', arm64_framework
3934
return 1
4035

41-
# TODO(cbracken): require armv7 once bot recipe is updated.
42-
if armv7_framework and not os.path.isdir(armv7_framework):
36+
if not os.path.isdir(armv7_framework):
4337
print 'Cannot find iOS armv7 Framework at', armv7_framework
4438
return 1
4539

@@ -51,8 +45,7 @@ def main():
5145
print 'Cannot find iOS arm64 dylib at', arm64_dylib
5246
return 1
5347

54-
# TODO(cbracken): require armv7 once bot recipe is updated.
55-
if armv7_dylib and not os.path.isfile(armv7_dylib):
48+
if not os.path.isfile(armv7_dylib):
5649
print 'Cannot find iOS armv7 dylib at', armv7_dylib
5750
return 1
5851

@@ -63,12 +56,11 @@ def main():
6356
shutil.rmtree(fat_framework, True)
6457
shutil.copytree(arm64_framework, fat_framework)
6558

66-
# TODO(cbracken): require armv7 once bot recipe is updated.
67-
dylibs = [arm64_dylib, simulator_dylib]
68-
if armv7_dylib:
69-
dylibs += [armv7_dylib]
70-
71-
subprocess.call(['lipo'] + dylibs + [
59+
subprocess.call([
60+
'lipo',
61+
arm64_dylib,
62+
armv7_dylib,
63+
simulator_dylib,
7264
'-create',
7365
'-output',
7466
os.path.join(fat_framework, 'Flutter')

0 commit comments

Comments
 (0)