15 parser = argparse.ArgumentParser(
16 description=
'Creates an XCFramework consisting of the specified universal frameworks'
22 help=
'The framework paths used to create the XCFramework.',
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)
28 args = parser.parse_args()
34 output_dir = os.path.abspath(location)
35 output_xcframework = os.path.join(output_dir,
'%s.xcframework' % name)
37 if not os.path.exists(output_dir):
38 os.makedirs(output_dir)
40 if os.path.exists(output_xcframework):
42 shutil.rmtree(output_xcframework)
46 command = [
'xcrun',
'xcodebuild',
'-quiet',
'-create-xcframework']
48 for framework
in frameworks:
49 command.extend([
'-framework', os.path.abspath(framework)])
51 command.extend([
'-output', output_xcframework])
53 subprocess.check_call(command, stdout=open(os.devnull,
'w'))
56if __name__ ==
'__main__':
def create_xcframework(location, name, frameworks)