| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 import fnmatch | 7 import fnmatch |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 '-Xlint:deprecation', | 52 '-Xlint:deprecation', |
| 53 ] + java_files | 53 ] + java_files |
| 54 | 54 |
| 55 def Compile(): | 55 def Compile(): |
| 56 # Delete the classes directory. This ensures that all .class files in the | 56 # Delete the classes directory. This ensures that all .class files in the |
| 57 # output are actually from the input .java files. For example, if a .java | 57 # output are actually from the input .java files. For example, if a .java |
| 58 # file is deleted or an inner class is removed, the classes directory should | 58 # file is deleted or an inner class is removed, the classes directory should |
| 59 # not contain the corresponding old .class file after running this action. | 59 # not contain the corresponding old .class file after running this action. |
| 60 build_utils.DeleteDirectory(output_dir) | 60 build_utils.DeleteDirectory(output_dir) |
| 61 build_utils.MakeDirectory(output_dir) | 61 build_utils.MakeDirectory(output_dir) |
| 62 suppress_output = not options.chromium_code | 62 build_utils.CheckOutput(javac_cmd, print_stdout=options.chromium_code) |
| 63 build_utils.CheckCallDie(javac_cmd, suppress_output=suppress_output) | |
| 64 | 63 |
| 65 record_path = '%s/javac.md5.stamp' % options.output_dir | 64 record_path = '%s/javac.md5.stamp' % options.output_dir |
| 66 md5_check.CallAndRecordIfStale( | 65 md5_check.CallAndRecordIfStale( |
| 67 Compile, | 66 Compile, |
| 68 record_path=record_path, | 67 record_path=record_path, |
| 69 input_paths=java_files + jar_inputs, | 68 input_paths=java_files + jar_inputs, |
| 70 input_strings=javac_cmd) | 69 input_strings=javac_cmd) |
| 71 | 70 |
| 72 | 71 |
| 73 def main(argv): | 72 def main(argv): |
| (...skipping 17 matching lines...) Expand all Loading... |
| 91 DoJavac(options) | 90 DoJavac(options) |
| 92 | 91 |
| 93 if options.stamp: | 92 if options.stamp: |
| 94 build_utils.Touch(options.stamp) | 93 build_utils.Touch(options.stamp) |
| 95 | 94 |
| 96 | 95 |
| 97 if __name__ == '__main__': | 96 if __name__ == '__main__': |
| 98 sys.exit(main(sys.argv)) | 97 sys.exit(main(sys.argv)) |
| 99 | 98 |
| 100 | 99 |
| OLD | NEW |