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

Unified Diff: dart/runtime/tools/concat_library.py

Issue 10383103: Split the URI library across multiple files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created helper.dart with SVN Created 8 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 | « dart/runtime/bin/uri_sources.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/runtime/tools/concat_library.py
diff --git a/dart/runtime/tools/concat_library.py b/dart/runtime/tools/concat_library.py
new file mode 100644
index 0000000000000000000000000000000000000000..838bd426a3f6eab1aa6c9e4d83de65517343a911
--- /dev/null
+++ b/dart/runtime/tools/concat_library.py
@@ -0,0 +1,40 @@
+#!/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:
+ if line.startswith('#source'):
+ line = '// %s' % line
+ output.write(line)
+ shutil.move(tmp_name, options.output)
+
+if __name__ == '__main__':
+ main()
« no previous file with comments | « dart/runtime/bin/uri_sources.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698