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 optparse | 7 import optparse |
8 import os | 8 import os |
9 import shutil | 9 import shutil |
10 import re | 10 import re |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 javac_cmd = ['javac'] | 315 javac_cmd = ['javac'] |
316 if options.use_errorprone_path: | 316 if options.use_errorprone_path: |
317 javac_cmd = [options.use_errorprone_path] + ERRORPRONE_OPTIONS | 317 javac_cmd = [options.use_errorprone_path] + ERRORPRONE_OPTIONS |
318 | 318 |
319 javac_cmd.extend(( | 319 javac_cmd.extend(( |
320 '-g', | 320 '-g', |
321 # Chromium only allows UTF8 source files. Being explicit avoids | 321 # Chromium only allows UTF8 source files. Being explicit avoids |
322 # javac pulling a default encoding from the user's environment. | 322 # javac pulling a default encoding from the user's environment. |
323 '-encoding', 'UTF-8', | 323 '-encoding', 'UTF-8', |
324 '-classpath', ':'.join(compile_classpath), | 324 '-classpath', ':'.join(compile_classpath), |
| 325 # Prevent compiler from compiling .java files not listed as inputs. |
| 326 # See: http://blog.ltgt.net/most-build-tools-misuse-javac/ |
| 327 '-sourcepath', '' |
325 )) | 328 )) |
326 | 329 |
327 if options.bootclasspath: | 330 if options.bootclasspath: |
328 javac_cmd.extend([ | 331 javac_cmd.extend([ |
329 '-bootclasspath', ':'.join(options.bootclasspath), | 332 '-bootclasspath', ':'.join(options.bootclasspath), |
330 '-source', '1.7', | 333 '-source', '1.7', |
331 '-target', '1.7', | 334 '-target', '1.7', |
332 ]) | 335 ]) |
333 | 336 |
334 if options.chromium_code: | 337 if options.chromium_code: |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 options, | 374 options, |
372 input_paths=input_paths, | 375 input_paths=input_paths, |
373 input_strings=javac_cmd, | 376 input_strings=javac_cmd, |
374 output_paths=output_paths, | 377 output_paths=output_paths, |
375 force=force, | 378 force=force, |
376 pass_changes=True) | 379 pass_changes=True) |
377 | 380 |
378 | 381 |
379 if __name__ == '__main__': | 382 if __name__ == '__main__': |
380 sys.exit(main(sys.argv[1:])) | 383 sys.exit(main(sys.argv[1:])) |
OLD | NEW |