Index: build/android/javac.py |
diff --git a/build/android/javac.py b/build/android/javac.py |
index 1ba5d064f8d18a5ee86c12aa1b5e996b41ddc52f..6117a5758caa73bfb173baecdecb7e29ef023fed 100755 |
--- a/build/android/javac.py |
+++ b/build/android/javac.py |
@@ -41,16 +41,23 @@ def DoJavac(options): |
build_utils.DeleteDirectory(output_dir) |
build_utils.MakeDirectory(output_dir) |
- subprocess.check_call([ |
+ cmd = [ |
'javac', |
'-g', |
- '-Xlint:unchecked', |
'-source', '1.5', |
'-target', '1.5', |
'-classpath', ':'.join(classpath), |
- '-d', output_dir] + |
- java_files) |
+ '-d', output_dir] |
+ # Only output Java warnings for chromium code |
+ if options.chromium_code: |
+ cmd += ['-Xlint:unchecked'] |
+ else: |
+ cmd += [# Suppress "Sun proprietary API" warnings. See: |
+ # http://stackoverflow.com/questions/1136659/how-can-i-suppress-java-compiler-warnings-about-sun-proprietary-api |
+ '-XDignore.symbol.file'] |
+ |
+ subprocess.check_call(cmd + java_files) |
def main(argv): |
parser = optparse.OptionParser() |
@@ -61,6 +68,9 @@ def main(argv): |
parser.add_option('--classpath', help='Classpath for javac.') |
parser.add_option('--output-dir', help='Directory for javac output.') |
parser.add_option('--stamp', help='Path to touch on success.') |
+ parser.add_option('--chromium-code', type='int', help='Whether code being' |
cjhopman
2013/04/01 20:33:13
Nit: space at end of string
|
+ 'compiled should be built with stricter warnings for ' |
+ 'chromium code.') |
# TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja. |
parser.add_option('--ignore', help='Ignored.') |