| 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 26 matching lines...) Expand all Loading... |
| 37 # We rely on all jar files being copied to the output dir. | 37 # We rely on all jar files being copied to the output dir. |
| 38 if sys.platform == 'win32': | 38 if sys.platform == 'win32': |
| 39 class_path = options.output_dir + '*;' | 39 class_path = options.output_dir + '*;' |
| 40 else: | 40 else: |
| 41 class_path = options.output_dir + '*' | 41 class_path = options.output_dir + '*' |
| 42 cmd = [GetJavacPath(), | 42 cmd = [GetJavacPath(), |
| 43 '-sourcepath', 'foobar', | 43 '-sourcepath', 'foobar', |
| 44 '-source', '6', | 44 '-source', '6', |
| 45 '-target', '6', | 45 '-target', '6', |
| 46 '-implicit:none', | 46 '-implicit:none', |
| 47 '-encoding', 'UTF-8', |
| 47 '-d', options.output_dir, | 48 '-d', options.output_dir, |
| 48 '-cp', class_path, | 49 '-cp', class_path, |
| 49 ] | 50 ] |
| 50 cmd.extend(args) | 51 cmd.extend(args) |
| 51 exit_code = subprocess.call(cmd) | 52 exit_code = subprocess.call(cmd) |
| 52 if exit_code: | 53 if exit_code: |
| 53 raise Exception("Executing command [%s] failed" % cmd) | 54 raise Exception("Executing command [%s] failed" % cmd) |
| 54 | 55 |
| 55 def CreateJarFile(options): | 56 def CreateJarFile(options): |
| 56 class_path_file_name = options.output_dir + options.class_path_file | 57 class_path_file_name = options.output_dir + options.class_path_file |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 os.makedirs(options.output_dir) | 107 os.makedirs(options.output_dir) |
| 107 | 108 |
| 108 CopyFiles(options) | 109 CopyFiles(options) |
| 109 CreateClassPathFile(options) | 110 CreateClassPathFile(options) |
| 110 CompileAnalyzer(options, args) | 111 CompileAnalyzer(options, args) |
| 111 CreateJarFile(options) | 112 CreateJarFile(options) |
| 112 | 113 |
| 113 | 114 |
| 114 if __name__=='__main__': | 115 if __name__=='__main__': |
| 115 main() | 116 main() |
| OLD | NEW |