OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 # Script to compile the analyzer. | 6 # Script to compile the analyzer. |
7 # | 7 # |
8 # Usage: compile_analyzer.py OPTIONS files | 8 # Usage: compile_analyzer.py OPTIONS files |
9 # | 9 # |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 class_path_file_name = options.output_dir + options.class_path_file | 62 class_path_file_name = options.output_dir + options.class_path_file |
63 with open(class_path_file_name, 'w') as output: | 63 with open(class_path_file_name, 'w') as output: |
64 print >> output, 'Class-Path:', '.', | 64 print >> output, 'Class-Path:', '.', |
65 for r,d,f in os.walk(options.output_dir): | 65 for r,d,f in os.walk(options.output_dir): |
66 for file in f: | 66 for file in f: |
67 if file.endswith('.jar'): | 67 if file.endswith('.jar'): |
68 print >> output, file, | 68 print >> output, file, |
69 # Add new line | 69 # Add new line |
70 print >> output | 70 print >> output |
71 | 71 |
72 def CopyBinaries(options): | |
73 bin_directory = options.output_dir + "/bin" | |
74 os.makedirs(bin_directory) | |
75 unix_bin = os.path.dirname(__file__) + "/analyzer" | |
kustermann
2013/03/11 10:15:33
You could use os.path.join.
ahe
2013/03/12 08:47:35
*should*, I think :-)
| |
76 windows_bin = os.path.dirname(__file__) + "/analyzer.bat" | |
77 shutil.copy(unix_bin, bin_directory) | |
78 shutil.copy(windows_bin, bin_directory) | |
79 | |
72 def main(): | 80 def main(): |
73 (options, args) = GetOptions() | 81 (options, args) = GetOptions() |
74 # Clean out everything whenever we do a build, guarantees that we don't have | 82 # Clean out everything whenever we do a build, guarantees that we don't have |
75 # any leftover jar files. | 83 # any leftover jar files. |
76 shutil.rmtree(options.output_dir, ignore_errors=True) | 84 shutil.rmtree(options.output_dir, ignore_errors=True) |
77 os.makedirs(options.output_dir) | 85 os.makedirs(options.output_dir) |
78 | 86 |
79 CopyFiles(options) | 87 CopyFiles(options) |
80 CreateClassPathFile(options) | 88 CreateClassPathFile(options) |
81 CompileAnalyzer(options, args) | 89 CompileAnalyzer(options, args) |
82 CreateJarFile(options) | 90 CreateJarFile(options) |
83 | 91 CopyBinaries(options) |
84 | 92 |
85 if __name__=='__main__': | 93 if __name__=='__main__': |
86 main() | 94 main() |
OLD | NEW |