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

Unified Diff: runtime/tools/concat_library.py

Issue 14752008: Final 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/secure_socket.h ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/tools/concat_library.py
===================================================================
--- runtime/tools/concat_library.py (revision 22513)
+++ runtime/tools/concat_library.py (working copy)
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-import optparse
-import shutil
-import sys
-
-def parse_options(argv):
- parser = optparse.OptionParser(usage="Usage: %prog [options] files")
- parser.add_option("--output",
- dest="output",
- help="Write output to FILE.",
- metavar="FILE")
- (options, arguments) = parser.parse_args(argv[1:])
- if not arguments:
- parser.error("At least one input file must be provided.")
- if not options.output:
- parser.error("No --output provided.")
- return (options, arguments)
-
-
-def main():
- # Print the command that is being run. This is helpful when
- # debugging build errors.
- sys.stderr.write('%s\n' % ' '.join(sys.argv))
- (options, arguments) = parse_options(sys.argv)
- tmp_name = '%s.tmp' % options.output
- with open(tmp_name, 'w') as output:
- for source in arguments:
- with open(source, 'r') as inpt:
- for line in inpt:
- # Drop unneeded library tags as all the library's files
- # are concatenated into one big file here:
- # The 'part' and 'part of' library tags are removed.
- if line.startswith('#source') or line.startswith('part '):
- line = '// %s' % line
- output.write(line)
- shutil.move(tmp_name, options.output)
-
-if __name__ == '__main__':
- main()
« no previous file with comments | « runtime/bin/secure_socket.h ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698