Index: build/android/gyp/javac.py |
diff --git a/build/android/gyp/javac.py b/build/android/gyp/javac.py |
index e36fd43bc05d3544a537cda9e7c4b85974dbc9fc..c1f81a11b7a0dffe7bdf47c2a59d32f7701ffa3d 100755 |
--- a/build/android/gyp/javac.py |
+++ b/build/android/gyp/javac.py |
@@ -54,8 +54,20 @@ def ColorJavacOutput(output): |
return '\n'.join(map(ApplyColor, output.split('\n'))) |
+ERRORPRONE_OPTIONS = [ |
+ '-Xepdisable:' |
+ # Something in chrome_private_java makes this check crash. |
cjhopman
2015/05/20 02:21:29
We should file a chromium bug about these. And may
raywilliams_chromium
2015/05/20 21:31:55
Yeah, maybe this can go away if we ever switch to
|
+ 'com.google.errorprone.bugpatterns.ClassCanBeStatic,' |
+ # These crash on lots of targets. |
+ 'com.google.errorprone.bugpatterns.WrongParameterPackage,' |
+ 'com.google.errorprone.bugpatterns.GuiceOverridesGuiceInjectableMethod,' |
+ 'com.google.errorprone.bugpatterns.GuiceOverridesJavaxInjectableMethod,' |
+ 'com.google.errorprone.bugpatterns.ElementsCountedInLoop' |
+] |
+ |
def DoJavac( |
- classpath, classes_dir, chromium_code, java_files): |
+ classpath, classes_dir, chromium_code, |
+ errorprone_path, java_files): |
"""Runs javac. |
Builds |java_files| with the provided |classpath| and puts the generated |
@@ -88,7 +100,12 @@ def DoJavac( |
# trigger a compile warning or error. |
javac_args.extend(['-XDignore.symbol.file']) |
- javac_cmd = ['javac'] + javac_args + java_files |
+ if errorprone_path: |
+ javac_cmd = [errorprone_path] + ERRORPRONE_OPTIONS |
+ else: |
+ javac_cmd = ['javac'] |
+ |
+ javac_cmd = javac_cmd + javac_args + java_files |
def Compile(): |
build_utils.CheckOutput( |
@@ -184,6 +201,10 @@ def main(argv): |
'warnings for chromium code.') |
parser.add_option( |
+ '--errorprone-path', |
+ help='Path to the errorprone compiler executable.') |
cjhopman
2015/05/20 02:21:29
If this is going to make us use errorprone instead
raywilliams_chromium
2015/05/20 21:31:55
Interesting observation!
I actually like use-erro
|
+ |
+ parser.add_option( |
'--classes-dir', |
help='Directory for compiled .class files.') |
parser.add_option('--jar-path', help='Jar output path.') |
@@ -241,6 +262,7 @@ def main(argv): |
classpath, |
classes_dir, |
options.chromium_code, |
+ options.errorprone_path, |
java_files) |
if options.jar_path: |