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 14 matching lines...) Expand all Loading... |
25 action="store", type="string", | 25 action="store", type="string", |
26 help="path to snapshot generator executable") | 26 help="path to snapshot generator executable") |
27 result.add_option("--vm_output_bin", | 27 result.add_option("--vm_output_bin", |
28 action="store", type="string", | 28 action="store", type="string", |
29 help="output file name into which vm isolate snapshot in binary form " + | 29 help="output file name into which vm isolate snapshot in binary form " + |
30 "is generated") | 30 "is generated") |
31 result.add_option("--output_bin", | 31 result.add_option("--output_bin", |
32 action="store", type="string", | 32 action="store", type="string", |
33 help="output file name into which isolate snapshot in binary form " + | 33 help="output file name into which isolate snapshot in binary form " + |
34 "is generated") | 34 "is generated") |
35 result.add_option("--instructions_bin", | |
36 action="store", type="string", | |
37 help="output file name into which instructions snapshot in assembly " + | |
38 "form is generated") | |
39 result.add_option("--embedder_entry_points_manifest", | 35 result.add_option("--embedder_entry_points_manifest", |
40 action="store", type="string", | 36 action="store", type="string", |
41 help="input manifest with the vm entry points in a precompiled snapshot") | 37 help="input manifest with the vm entry points in a precompiled snapshot") |
42 result.add_option("--script", | 38 result.add_option("--script", |
43 action="store", type="string", | 39 action="store", type="string", |
44 help="Dart script for which snapshot is to be generated") | 40 help="Dart script for which snapshot is to be generated") |
45 result.add_option("--package_root", | 41 result.add_option("--package_root", |
46 action="store", type="string", | 42 action="store", type="string", |
47 help="path used to resolve package: imports.") | 43 help="path used to resolve package: imports.") |
48 result.add_option("--packages", | 44 result.add_option("--packages", |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 109 |
114 # Pass along the package_root if there is one. | 110 # Pass along the package_root if there is one. |
115 if options.package_root: | 111 if options.package_root: |
116 script_args.append(''.join([ "--package_root=", options.package_root])) | 112 script_args.append(''.join([ "--package_root=", options.package_root])) |
117 | 113 |
118 # Pass along the packages if there is one. | 114 # Pass along the packages if there is one. |
119 if options.packages: | 115 if options.packages: |
120 script_args.append(''.join([ "--packages=", options.packages])) | 116 script_args.append(''.join([ "--packages=", options.packages])) |
121 | 117 |
122 # First setup the vm isolate and regular isolate snapshot output filename. | 118 # First setup the vm isolate and regular isolate snapshot output filename. |
123 script_args.append(''.join([ "--vm_isolate_snapshot=", | 119 script_args.append(''.join([ "--vm_snapshot_data=", options.vm_output_bin ])) |
124 options.vm_output_bin ])) | 120 script_args.append(''.join([ "--isolate_snapshot_data=", options.output_bin ])
) |
125 script_args.append(''.join([ "--isolate_snapshot=", options.output_bin ])) | |
126 | |
127 # Setup the instuctions snapshot output filename | |
128 if options.instructions_bin: | |
129 script_args.append(''.join([ "--instructions_snapshot=", | |
130 options.instructions_bin ])) | |
131 | 121 |
132 # Specify the embedder entry points snapshot | 122 # Specify the embedder entry points snapshot |
133 if options.embedder_entry_points_manifest: | 123 if options.embedder_entry_points_manifest: |
134 script_args.append(''.join([ "--embedder_entry_points_manifest=", | 124 script_args.append(''.join([ "--embedder_entry_points_manifest=", |
135 options.embedder_entry_points_manifest ])) | 125 options.embedder_entry_points_manifest ])) |
136 | 126 |
137 # Next setup all url mapping options specified. | 127 # Next setup all url mapping options specified. |
138 for url_arg in options.url_mapping: | 128 for url_arg in options.url_mapping: |
139 url_mapping_argument = ''.join(["--url_mapping=", url_arg ]) | 129 url_mapping_argument = ''.join(["--url_mapping=", url_arg ]) |
140 script_args.append(url_mapping_argument) | 130 script_args.append(url_mapping_argument) |
(...skipping 11 matching lines...) Expand all Loading... |
152 return -1 | 142 return -1 |
153 | 143 |
154 # Success, update timestamp file. | 144 # Success, update timestamp file. |
155 CreateTimestampFile(options) | 145 CreateTimestampFile(options) |
156 | 146 |
157 return 0 | 147 return 0 |
158 | 148 |
159 | 149 |
160 if __name__ == '__main__': | 150 if __name__ == '__main__': |
161 sys.exit(Main()) | 151 sys.exit(Main()) |
OLD | NEW |