Chromium Code Reviews| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 action='append', | 250 action='append', |
| 251 default=[], | 251 default=[], |
| 252 help='List of srcjars to include in compilation.') | 252 help='List of srcjars to include in compilation.') |
| 253 parser.add_option( | 253 parser.add_option( |
| 254 '--bootclasspath', | 254 '--bootclasspath', |
| 255 action='append', | 255 action='append', |
| 256 default=[], | 256 default=[], |
| 257 help='Boot classpath for javac. If this is specified multiple times, ' | 257 help='Boot classpath for javac. If this is specified multiple times, ' |
| 258 'they will all be appended to construct the classpath.') | 258 'they will all be appended to construct the classpath.') |
| 259 parser.add_option( | 259 parser.add_option( |
| 260 '--use-host-bootclasspath', | |
| 261 action='store_true', | |
| 262 help='Do not use custom bootclasspath even if bootclasspath is ' | |
|
agrieve
2016/08/23 03:52:16
This is pretty weird. Why not just don't pass --bo
aluo
2016/08/24 01:23:38
Acknowledged.
| |
| 263 'specified.') | |
| 264 parser.add_option( | |
| 260 '--classpath', | 265 '--classpath', |
| 261 action='append', | 266 action='append', |
| 262 help='Classpath for javac. If this is specified multiple times, they ' | 267 help='Classpath for javac. If this is specified multiple times, they ' |
| 263 'will all be appended to construct the classpath.') | 268 'will all be appended to construct the classpath.') |
| 264 parser.add_option( | 269 parser.add_option( |
| 265 '--incremental', | 270 '--incremental', |
| 266 action='store_true', | 271 action='store_true', |
| 267 help='Whether to re-use .class files rather than recompiling them ' | 272 help='Whether to re-use .class files rather than recompiling them ' |
| 268 '(when possible).') | 273 '(when possible).') |
| 269 parser.add_option( | 274 parser.add_option( |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 371 # Chromium only allows UTF8 source files. Being explicit avoids | 376 # Chromium only allows UTF8 source files. Being explicit avoids |
| 372 # javac pulling a default encoding from the user's environment. | 377 # javac pulling a default encoding from the user's environment. |
| 373 '-encoding', 'UTF-8', | 378 '-encoding', 'UTF-8', |
| 374 '-classpath', ':'.join(options.classpath), | 379 '-classpath', ':'.join(options.classpath), |
| 375 # Prevent compiler from compiling .java files not listed as inputs. | 380 # Prevent compiler from compiling .java files not listed as inputs. |
| 376 # See: http://blog.ltgt.net/most-build-tools-misuse-javac/ | 381 # See: http://blog.ltgt.net/most-build-tools-misuse-javac/ |
| 377 '-sourcepath', '' | 382 '-sourcepath', '' |
| 378 )) | 383 )) |
| 379 | 384 |
| 380 if options.bootclasspath: | 385 if options.bootclasspath: |
| 386 if not options.use_host_bootclasspath: | |
| 387 javac_cmd.extend([ | |
| 388 '-bootclasspath', ':'.join(options.bootclasspath) | |
| 389 ]) | |
| 381 javac_cmd.extend([ | 390 javac_cmd.extend([ |
| 382 '-bootclasspath', ':'.join(options.bootclasspath), | |
| 383 '-source', '1.7', | 391 '-source', '1.7', |
| 384 '-target', '1.7', | 392 '-target', '1.7', |
| 385 ]) | 393 ]) |
| 386 | 394 |
| 387 if options.chromium_code: | 395 if options.chromium_code: |
| 388 javac_cmd.extend(['-Xlint:unchecked', '-Xlint:deprecation']) | 396 javac_cmd.extend(['-Xlint:unchecked', '-Xlint:deprecation']) |
| 389 else: | 397 else: |
| 390 # XDignore.symbol.file makes javac compile against rt.jar instead of | 398 # XDignore.symbol.file makes javac compile against rt.jar instead of |
| 391 # ct.sym. This means that using a java internal package/class will not | 399 # ct.sym. This means that using a java internal package/class will not |
| 392 # trigger a compile warning or error. | 400 # trigger a compile warning or error. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 432 options, | 440 options, |
| 433 input_paths=input_paths, | 441 input_paths=input_paths, |
| 434 input_strings=javac_cmd, | 442 input_strings=javac_cmd, |
| 435 output_paths=output_paths, | 443 output_paths=output_paths, |
| 436 force=force, | 444 force=force, |
| 437 pass_changes=True) | 445 pass_changes=True) |
| 438 | 446 |
| 439 | 447 |
| 440 if __name__ == '__main__': | 448 if __name__ == '__main__': |
| 441 sys.exit(main(sys.argv[1:])) | 449 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |