Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1673)

Unified Diff: build/android/gyp/javac.py

Issue 1136573002: Use the Errorprone Compiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Full Sync and Update Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gyp/find_sun_tools_jar.py ('k') | build/android/setup.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/javac.py
diff --git a/build/android/gyp/javac.py b/build/android/gyp/javac.py
index e36fd43bc05d3544a537cda9e7c4b85974dbc9fc..c8f0dae9bd19e3535e037b2bf1beed3bfda17f8b 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.
+ '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,
+ use_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 use_errorprone_path:
+ javac_cmd = [use_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(
+ '--use-errorprone-path',
+ help='Use the Errorprone compiler at this path.')
+
+ 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.use_errorprone_path,
java_files)
if options.jar_path:
« no previous file with comments | « build/android/gyp/find_sun_tools_jar.py ('k') | build/android/setup.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698