Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: runtime/tools/gen_library_src_paths.py

Issue 14784010: Third step towards loading core library scripts directly from the sources (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/date_patch.dart ('k') | runtime/vm/bootstrap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2013, 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 # 5 #
6 # This python script creates a source path mapping in a C++ source file from 6 # This python script creates a source path mapping in a C++ source file from
7 # a C++ source template and list of dart library files. 7 # a C++ source template and list of dart library files.
8 8
9 import os 9 import os
10 import sys 10 import sys
(...skipping 20 matching lines...) Expand all
31 "{{LIBRARY_SOURCE_MAP}}", 31 "{{LIBRARY_SOURCE_MAP}}",
32 ' "' + lib_name + '", "' + 32 ' "' + lib_name + '", "' +
33 os.path.abspath(string_file).replace('\\', '\\\\') + '", \n') 33 os.path.abspath(string_file).replace('\\', '\\\\') + '", \n')
34 inpt.close() 34 inpt.close()
35 if (main_file_found): 35 if (main_file_found):
36 continue 36 continue
37 part_index.append(' "' + 37 part_index.append(' "' +
38 os.path.basename(string_file).replace('\\', '\\\\') + '", ') 38 os.path.basename(string_file).replace('\\', '\\\\') + '", ')
39 part_index.append('"' + 39 part_index.append('"' +
40 os.path.abspath(string_file).replace('\\', '\\\\') + '", \n') 40 os.path.abspath(string_file).replace('\\', '\\\\') + '", \n')
41 bootstrap_cc_text = bootstrap_cc_text.replace("{{LIBRARY_SOURCE_MAP}}", '')
41 bootstrap_cc_text = bootstrap_cc_text.replace("{{PART_SOURCE_MAP}}", 42 bootstrap_cc_text = bootstrap_cc_text.replace("{{PART_SOURCE_MAP}}",
42 ''.join(part_index)) 43 ''.join(part_index))
43 open(output_file, 'w').write(bootstrap_cc_text) 44 open(output_file, 'w').write(bootstrap_cc_text)
44 return True 45 return True
45 46
46 47
47 def main(args): 48 def main(args):
48 try: 49 try:
49 # Parse input. 50 # Parse input.
50 parser = OptionParser() 51 parser = OptionParser()
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 99
99 return 0 100 return 0
100 except Exception, inst: 101 except Exception, inst:
101 sys.stderr.write('gen_library_src_paths.py exception\n') 102 sys.stderr.write('gen_library_src_paths.py exception\n')
102 sys.stderr.write(str(inst)) 103 sys.stderr.write(str(inst))
103 sys.stderr.write('\n') 104 sys.stderr.write('\n')
104 return -1 105 return -1
105 106
106 if __name__ == '__main__': 107 if __name__ == '__main__':
107 sys.exit(main(sys.argv)) 108 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « runtime/lib/date_patch.dart ('k') | runtime/vm/bootstrap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698