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

Side by Side Diff: editor/tools/write_class_path_file.py

Issue 12262040: Add support for building the new analyzer using gyp. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 | « editor/analyzer.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
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
4 # BSD-style license that can be found in the LICENSE file.
5 #
6 # Script to write the class path manifest for usage in a jar files
7 #
8 # Usage: write_to_file.py output_file directory_containing_jar_files prefix
9 #
10 # The output file will contain a string like:
11 # Class-Path: . prefix/guava-13.0.1.jar prefix/commons-lang3-3.1.jar prefix/ar gs4j-2.0.12.jar prefix/json.jar
12
13 import os
14 import sys
15
16 def main():
17 output = open(sys.argv[1], 'w')
ahe 2013/02/14 14:52:34 I'd use: with open(...) as output:
ricow1 2013/02/14 15:40:20 Done.
18 output.write('Class-Path:')
ahe 2013/02/14 14:52:34 Here I would use: print >> output, 'Class-Path:',
ricow1 2013/02/14 15:40:20 Done.
19 output.write(' .')
20 prefix = ''
21 if len(sys.argv) == 4:
22 prefix = sys.argv[3]
23 for r,d,f in os.walk(sys.argv[2]):
24 for file in f:
25 if file.endswith('.jar'):
26 output.write(' ')
27 output.write(prefix)
28 output.write('/')
29 output.write(file)
30 output.write('\n')
31 output.close()
32
33 if __name__=='__main__':
34 main()
OLDNEW
« no previous file with comments | « editor/analyzer.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698