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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 build_utils.CheckOutput(javac_cmd, print_stdout=options.chromium_code) | 62 build_utils.CheckOutput(javac_cmd, print_stdout=options.chromium_code) |
63 | 63 |
64 record_path = '%s/javac.md5.stamp' % options.output_dir | 64 record_path = '%s/javac.md5.stamp' % options.output_dir |
65 md5_check.CallAndRecordIfStale( | 65 md5_check.CallAndRecordIfStale( |
66 Compile, | 66 Compile, |
67 record_path=record_path, | 67 record_path=record_path, |
68 input_paths=java_files + jar_inputs, | 68 input_paths=java_files + jar_inputs, |
69 input_strings=javac_cmd) | 69 input_strings=javac_cmd) |
70 | 70 |
71 | 71 |
72 def main(argv): | 72 def main(): |
73 parser = optparse.OptionParser() | 73 parser = optparse.OptionParser() |
74 parser.add_option('--src-dirs', help='Directories containing java files.') | 74 parser.add_option('--src-dirs', help='Directories containing java files.') |
75 parser.add_option('--javac-includes', | 75 parser.add_option('--javac-includes', |
76 help='A list of file patterns. If provided, only java files that match' + | 76 help='A list of file patterns. If provided, only java files that match' + |
77 'one of the patterns will be compiled.') | 77 'one of the patterns will be compiled.') |
78 parser.add_option('--classpath', help='Classpath for javac.') | 78 parser.add_option('--classpath', help='Classpath for javac.') |
79 parser.add_option('--output-dir', help='Directory for javac output.') | 79 parser.add_option('--output-dir', help='Directory for javac output.') |
80 parser.add_option('--stamp', help='Path to touch on success.') | 80 parser.add_option('--stamp', help='Path to touch on success.') |
81 parser.add_option('--chromium-code', type='int', help='Whether code being ' | 81 parser.add_option('--chromium-code', type='int', help='Whether code being ' |
82 'compiled should be built with stricter warnings for ' | 82 'compiled should be built with stricter warnings for ' |
83 'chromium code.') | 83 'chromium code.') |
84 | 84 |
85 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja. | 85 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja. |
86 parser.add_option('--ignore', help='Ignored.') | 86 parser.add_option('--ignore', help='Ignored.') |
87 | 87 |
88 options, _ = parser.parse_args() | 88 options, _ = parser.parse_args() |
89 | 89 |
90 DoJavac(options) | 90 DoJavac(options) |
91 | 91 |
92 if options.stamp: | 92 if options.stamp: |
93 build_utils.Touch(options.stamp) | 93 build_utils.Touch(options.stamp) |
94 | 94 |
95 | 95 |
96 if __name__ == '__main__': | 96 if __name__ == '__main__': |
97 sys.exit(main(sys.argv)) | 97 sys.exit(main()) |
98 | 98 |
99 | 99 |
OLD | NEW |