OLD | NEW |
(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 with open(sys.argv[1], 'w') as output: |
| 18 print >> output, 'Class-Path:', '.', |
| 19 prefix = '' |
| 20 if len(sys.argv) == 4: |
| 21 prefix = sys.argv[3] |
| 22 for r,d,f in os.walk(sys.argv[2]): |
| 23 for file in f: |
| 24 if file.endswith('.jar'): |
| 25 print >> output, prefix + '/' + file, |
| 26 # Add new line |
| 27 print >> output |
| 28 |
| 29 if __name__=='__main__': |
| 30 main() |
OLD | NEW |