14 parser = argparse.ArgumentParser(description=
'Package a Flutter application')
16 parser.add_argument(
'--flutter-root', type=str, required=
True, help=
'The root of the Flutter SDK')
18 '--flutter-tools', type=str, required=
True, help=
'The executable for the Flutter tool'
21 '--asset-dir', type=str, required=
True, help=
'The directory where to put intermediate files'
23 parser.add_argument(
'--app-dir', type=str, required=
True, help=
'The root of the app')
24 parser.add_argument(
'--packages', type=str, required=
True, help=
'The package map to use')
25 parser.add_argument(
'--manifest', type=str, help=
'The application manifest')
26 parser.add_argument(
'--component-name', type=str, help=
'The name of the component')
28 '--asset-manifest-out',
30 help=
'Output path for the asset manifest used by the fuchsia packaging tool'
33 args = parser.parse_args()
35 env = os.environ.copy()
36 env[
'FLUTTER_ROOT'] = args.flutter_root
40 '--asset-dir=%s' % args.asset_dir,
41 '--packages=%s' % args.packages,
43 if 'manifest' in args:
44 call_args.append(
'--manifest=%s' % args.manifest)
46 if args.asset_manifest_out:
47 call_args.append(
'--asset-manifest-out=%s' % args.asset_manifest_out)
49 if args.component_name:
50 call_args.append(
'--component-name=%s' % args.component_name)
52 result = subprocess.call(call_args, env=env, cwd=args.app_dir)
57if __name__ ==
'__main__':