Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
create_xcframework Namespace Reference

Functions

 main ()
 
 create_xcframework (location, name, frameworks)
 

Function Documentation

◆ create_xcframework()

create_xcframework.create_xcframework (   location,
  name,
  frameworks 
)

Definition at line 33 of file create_xcframework.py.

33def create_xcframework(location, name, frameworks):
34 output_dir = os.path.abspath(location)
35 output_xcframework = os.path.join(output_dir, '%s.xcframework' % name)
36
37 if not os.path.exists(output_dir):
38 os.makedirs(output_dir)
39
40 if os.path.exists(output_xcframework):
41 # Remove old xcframework.
42 shutil.rmtree(output_xcframework)
43
44 # xcrun xcodebuild -create-xcframework -framework foo/baz.framework \
45 # -framework bar/baz.framework -output output/
46 command = ['xcrun', 'xcodebuild', '-quiet', '-create-xcframework']
47
48 for framework in frameworks:
49 command.extend(['-framework', os.path.abspath(framework)])
50
51 command.extend(['-output', output_xcframework])
52
53 subprocess.check_call(command, stdout=open(os.devnull, 'w'))
54
55

◆ main()

create_xcframework.main ( )

Definition at line 14 of file create_xcframework.py.

14def main():
15 parser = argparse.ArgumentParser(
16 description='Creates an XCFramework consisting of the specified universal frameworks'
17 )
18
19 parser.add_argument(
20 '--frameworks',
21 nargs='+',
22 help='The framework paths used to create the XCFramework.',
23 required=True
24 )
25 parser.add_argument('--name', help='Name of the XCFramework', type=str, required=True)
26 parser.add_argument('--location', help='Output directory', type=str, required=True)
27
28 args = parser.parse_args()
29
30 create_xcframework(args.location, args.name, args.frameworks)
31
32
Definition main.py:1