OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/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 | 7 |
8 """ | 8 """ |
9 Frogpad is used to compile .dart files to javascript. | 9 Frogpad is used to compile .dart files to javascript. |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 DIRECTIVE_RE = re.compile(r"^#(import|source|native)\([\"']([^\"']*)[\"']") | 121 DIRECTIVE_RE = re.compile(r"^#(import|source|native)\([\"']([^\"']*)[\"']") |
122 | 122 |
123 # id of script tag that holds name of the top dart file to be compiled, | 123 # id of script tag that holds name of the top dart file to be compiled, |
124 # (This file name passed will be passed to the frog compiler by frogpad.dart.) | 124 # (This file name passed will be passed to the frog compiler by frogpad.dart.) |
125 MAIN_ID = "main_id" | 125 MAIN_ID = "main_id" |
126 | 126 |
127 DART_LIBRARIES = { | 127 DART_LIBRARIES = { |
128 "core": "lib/corelib.dart", | 128 "core": "lib/corelib.dart", |
129 "coreimpl": "lib/corelib_impl.dart", | 129 "coreimpl": "lib/corelib_impl.dart", |
130 "dom": "../client/dom/frog/dom_frog.dart", | 130 "dom": "../client/dom/frog/dom_frog.dart", |
131 "html": "../client/html/release/html.dart", | 131 "html": "../client/html/frog/html_frog.dart", |
132 "htmlimpl": "../client/html/release/htmlimpl.dart", | |
133 "json": "../lib/json/json_frog.dart" | 132 "json": "../lib/json/json_frog.dart" |
134 } | 133 } |
135 | 134 |
136 | 135 |
137 class Pad(object): | 136 class Pad(object): |
138 """ | 137 """ |
139 Accumulates all source files that are needed to compile a dart program, | 138 Accumulates all source files that are needed to compile a dart program, |
140 and places them in <script> tags on an html page. | 139 and places them in <script> tags on an html page. |
141 """ | 140 """ |
142 | 141 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 raise CommandFailedException(msg) | 391 raise CommandFailedException(msg) |
393 logging.debug("SUCCEEDED (%d bytes)" % len(stdout)) | 392 logging.debug("SUCCEEDED (%d bytes)" % len(stdout)) |
394 return stdout | 393 return stdout |
395 | 394 |
396 | 395 |
397 def main(argv): | 396 def main(argv): |
398 Pad(argv) | 397 Pad(argv) |
399 | 398 |
400 if __name__ == "__main__": | 399 if __name__ == "__main__": |
401 sys.exit(main(sys.argv)) | 400 sys.exit(main(sys.argv)) |
OLD | NEW |