forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fed16f
commit 1084a83
Showing
22 changed files
with
626 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env python | ||
# Copyright 2016 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import argparse | ||
import subprocess | ||
import os | ||
import sys | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='Snapshot a Flutter application') | ||
|
||
parser.add_argument('--snapshotter-path', type=str, required=True, | ||
help='The Flutter snapshotter') | ||
|
||
parser.add_argument('--main-dart', type=str, required=True, | ||
help='The main.dart file to use') | ||
|
||
parser.add_argument('--url-mapping', type=str, action='append', | ||
help='The main.dart file to use') | ||
parser.add_argument('--entry-points-manifest', type=str, action='append', | ||
help='The main.dart file to use') | ||
|
||
parser.add_argument('--packages', type=str, required=True, | ||
help='The package map to use') | ||
parser.add_argument('--assembly', type=str, required=True, | ||
help='Where to output application assembly') | ||
parser.add_argument('--depfile', type=str, required=True, | ||
help='Where to output dependency information') | ||
parser.add_argument('--root-build-dir', type=str, required=True, | ||
help='The root build dir for --depfile and --snapshot') | ||
|
||
args = parser.parse_args() | ||
|
||
cmd = [ | ||
args.snapshotter_path, | ||
"--enable_mirrors=false", | ||
"--await_is_keyword", | ||
"--assert_initializer", | ||
'--snapshot_kind=app-aot-assembly', | ||
'--packages=%s' % args.packages, | ||
'--assembly=%s' % args.assembly, | ||
'--dependencies=%s' % args.depfile, | ||
] | ||
for url_mapping in args.url_mapping: | ||
cmd.append("--url_mapping=" + url_mapping) | ||
for entry_points_manifest in args.entry_points_manifest: | ||
cmd.append("--embedder_entry_points_manifest=" + entry_points_manifest) | ||
cmd.append(args.main_dart) | ||
|
||
result = subprocess.call(cmd, cwd=args.root_build_dir) | ||
|
||
return result | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.