OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 """Script to create snapshot bin file.""" | 7 """Script to create snapshot bin file.""" |
8 | 8 |
9 import getopt | 9 import getopt |
10 import optparse | 10 import optparse |
(...skipping 18 matching lines...) Expand all Loading... |
29 help="output file name into which snapshot in binary form is generated") | 29 help="output file name into which snapshot in binary form is generated") |
30 result.add_option("--script", | 30 result.add_option("--script", |
31 action="store", type="string", | 31 action="store", type="string", |
32 help="Dart script for which snapshot is to be generated") | 32 help="Dart script for which snapshot is to be generated") |
33 result.add_option("--package_root", | 33 result.add_option("--package_root", |
34 action="store", type="string", | 34 action="store", type="string", |
35 help="path used to resolve package: imports.") | 35 help="path used to resolve package: imports.") |
36 result.add_option("--url_mapping", | 36 result.add_option("--url_mapping", |
37 default=[], | 37 default=[], |
38 action="append", | 38 action="append", |
39 help="mapping from url to file name, used when generating snapshots") | 39 help=("mapping from url to file name, used when generating snapshots " + |
| 40 "E.g.: --url_mapping=fileUri,/path/to/file.dart")) |
40 result.add_option("-v", "--verbose", | 41 result.add_option("-v", "--verbose", |
41 help='Verbose output.', | 42 help='Verbose output.', |
42 default=False, action="store_true") | 43 default=False, action="store_true") |
43 result.add_option("--target_os", | 44 result.add_option("--target_os", |
44 action="store", type="string", | 45 action="store", type="string", |
45 help="Which os to run the executable on. Current choice is android") | 46 help="Which os to run the executable on. Current choice is android") |
46 result.add_option("--abi", | 47 result.add_option("--abi", |
47 action="store", type="string", | 48 action="store", type="string", |
48 help="Desired ABI for android target OS. armeabi-v7a or x86") | 49 help="Desired ABI for android target OS. armeabi-v7a or x86") |
49 return result | 50 return result |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 utils.RunCommand(command, outStream=sys.stderr, errStream=sys.stderr, | 101 utils.RunCommand(command, outStream=sys.stderr, errStream=sys.stderr, |
101 verbose=options.verbose, printErrorInfo=True) | 102 verbose=options.verbose, printErrorInfo=True) |
102 except Exception as e: | 103 except Exception as e: |
103 return -1 | 104 return -1 |
104 | 105 |
105 return 0 | 106 return 0 |
106 | 107 |
107 | 108 |
108 if __name__ == '__main__': | 109 if __name__ == '__main__': |
109 sys.exit(Main()) | 110 sys.exit(Main()) |
OLD | NEW |