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

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

Issue 11411176: - Remove unneeded library tags when concatenating libraries. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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/bin/bin.gypi ('k') | runtime/vm/vm.gypi » ('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) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, 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 import optparse 6 import optparse
7 import shutil 7 import shutil
8 import sys 8 import sys
9 9
10 def parse_options(argv): 10 def parse_options(argv):
(...skipping 13 matching lines...) Expand all
24 def main(): 24 def main():
25 # Print the command that is being run. This is helpful when 25 # Print the command that is being run. This is helpful when
26 # debugging build errors. 26 # debugging build errors.
27 sys.stderr.write('%s\n' % ' '.join(sys.argv)) 27 sys.stderr.write('%s\n' % ' '.join(sys.argv))
28 (options, arguments) = parse_options(sys.argv) 28 (options, arguments) = parse_options(sys.argv)
29 tmp_name = '%s.tmp' % options.output 29 tmp_name = '%s.tmp' % options.output
30 with open(tmp_name, 'w') as output: 30 with open(tmp_name, 'w') as output:
31 for source in arguments: 31 for source in arguments:
32 with open(source, 'r') as inpt: 32 with open(source, 'r') as inpt:
33 for line in inpt: 33 for line in inpt:
34 if line.startswith('#source'): 34 # Drop unneeded library tags as all the library's files
35 # are concatenated into one big file here:
36 # The 'part' and 'part of' library tags are removed.
37 if line.startswith('#source') or line.startswith('part '):
siva 2012/11/27 02:18:07 There is the danger of legal lines which start wit
Ivan Posva 2012/11/27 05:38:19 I understand all of these limitations (they went a
35 line = '// %s' % line 38 line = '// %s' % line
36 output.write(line) 39 output.write(line)
37 shutil.move(tmp_name, options.output) 40 shutil.move(tmp_name, options.output)
38 41
39 if __name__ == '__main__': 42 if __name__ == '__main__':
40 main() 43 main()
OLDNEW
« no previous file with comments | « runtime/bin/bin.gypi ('k') | runtime/vm/vm.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698