OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
5 """Used to merge and copy dart source files for deployment to AppEngine""" | 5 """Used to merge and copy dart source files for deployment to AppEngine""" |
6 | 6 |
7 import fileinput | 7 import fileinput |
8 import sys | 8 import sys |
9 import shutil | 9 import shutil |
10 import os | 10 import os |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 if library.name: | 116 if library.name: |
117 f.write("library %s;\n\n" % library.name) | 117 f.write("library %s;\n\n" % library.name) |
118 else: | 118 else: |
119 f.write("library %s;\n\n" % basename(lib)) | 119 f.write("library %s;\n\n" % basename(lib)) |
120 for importfile in library.imports: | 120 for importfile in library.imports: |
121 f.write("import %s;\n" % (importfile)) | 121 f.write("import %s;\n" % (importfile)) |
122 f.write('%s' % (''.join(library.code))) | 122 f.write('%s' % (''.join(library.code))) |
123 mergefiles([normjoin(dirname(lib), s) for s in library.sources], f) | 123 mergefiles([normjoin(dirname(lib), s) for s in library.sources], f) |
124 | 124 |
125 for suffix in library.imports: | 125 for suffix in library.imports: |
126 m = re.match(r'[\'"]([^\'"]+)[\'"](\s+as\s+\w+)?$', suffix) | 126 m = re.match(r'[\'"]([^\'"]+)[\'"](\s+as\s+\w+)?.*$', suffix) |
127 uri = m.group(1) | 127 uri = m.group(1) |
128 if not uri.startswith('dart:'): | 128 if not uri.startswith('dart:'): |
129 worklist.append(normjoin(dirname(lib), uri)); | 129 worklist.append(normjoin(dirname(lib), uri)); |
130 | 130 |
131 return 0 | 131 return 0 |
132 | 132 |
133 if __name__ == '__main__': | 133 if __name__ == '__main__': |
134 sys.exit(main(*sys.argv[1:])) | 134 sys.exit(main(*sys.argv[1:])) |
OLD | NEW |