28 parser = argparse.ArgumentParser(
29 description=(
30 'Creates Flutter.framework, Flutter.xcframework and '
31 'copies architecture-dependent gen_snapshot binaries to output dir'
32 )
33 )
34
35 parser.add_argument('--dst', type=str, required=True)
36 parser.add_argument('--clang-dir', type=str, default='clang_x64')
37 parser.add_argument('--x64-out-dir', type=str)
38 parser.add_argument('--arm64-out-dir', type=str, required=True)
39 parser.add_argument('--simulator-x64-out-dir', type=str, required=True)
40 parser.add_argument('--simulator-arm64-out-dir', type=str, required=False)
41 parser.add_argument('--strip', action='store_true', default=False)
42 parser.add_argument('--dsym', action='store_true', default=False)
43
44 args = parser.parse_args()
45
46 dst = (args.dst if os.path.isabs(args.dst) else os.path.join(buildroot_dir, args.dst))
47
48 arm64_out_dir = (
49 args.arm64_out_dir
50 if os.path.isabs(args.arm64_out_dir) else os.path.join(buildroot_dir, args.arm64_out_dir)
51 )
52
53 x64_out_dir = None
54 if args.x64_out_dir:
55 x64_out_dir = (
56 args.x64_out_dir
57 if os.path.isabs(args.x64_out_dir) else os.path.join(buildroot_dir, args.x64_out_dir)
58 )
59
60 simulator_x64_out_dir = None
61 if args.simulator_x64_out_dir:
62 simulator_x64_out_dir = (
63 args.simulator_x64_out_dir if os.path.isabs(args.simulator_x64_out_dir) else
64 os.path.join(buildroot_dir, args.simulator_x64_out_dir)
65 )
66
67 framework = os.path.join(dst, 'Flutter.framework')
68 simulator_framework = os.path.join(dst, 'sim', 'Flutter.framework')
69 arm64_framework = os.path.join(arm64_out_dir, 'Flutter.framework')
70 simulator_x64_framework = os.path.join(simulator_x64_out_dir, 'Flutter.framework')
71
72 simulator_arm64_out_dir = None
73 if args.simulator_arm64_out_dir:
74 simulator_arm64_out_dir = (
75 args.simulator_arm64_out_dir if os.path.isabs(args.simulator_arm64_out_dir) else
76 os.path.join(buildroot_dir, args.simulator_arm64_out_dir)
77 )
78
79 if args.simulator_arm64_out_dir is not None:
80 simulator_arm64_framework = os.path.join(simulator_arm64_out_dir, 'Flutter.framework')
81
82 if not os.path.isdir(arm64_framework):
83 print(
'Cannot find iOS arm64 Framework at %s' % arm64_framework)
84 return 1
85
86 if not os.path.isdir(simulator_x64_framework):
87 print(
'Cannot find iOS x64 simulator Framework at %s' % simulator_framework)
88 return 1
89
90 if not os.path.isfile(DSYMUTIL):
91 print(
'Cannot find dsymutil at %s' % DSYMUTIL)
92 return 1
93
95 args, dst, framework, arm64_framework, simulator_framework, simulator_x64_framework,
96 simulator_arm64_framework
97 )
98
99 extension_safe_dst = os.path.join(dst, 'extension_safe')
101 args, extension_safe_dst, '%s_extension_safe' % arm64_out_dir,
102 '%s_extension_safe' % simulator_x64_out_dir, '%s_extension_safe' % simulator_arm64_out_dir
103 )
104
107 return 0
108
def create_extension_safe_framework(args, dst, arm64_out_dir, simulator_x64_out_dir, simulator_arm64_out_dir)