Index: tools/android/checkstyle/checkstyle.py |
diff --git a/tools/android/checkstyle/checkstyle.py b/tools/android/checkstyle/checkstyle.py |
index c47fbee45c156703dbad8d41c4fff65fc16a5813..33cd33df27ac0f6ab3acc15e9b297135b689734f 100644 |
--- a/tools/android/checkstyle/checkstyle.py |
+++ b/tools/android/checkstyle/checkstyle.py |
@@ -24,7 +24,10 @@ def RunCheckstyle(input_api, output_api, style_file): |
checkstyle_env = os.environ.copy() |
checkstyle_env['JAVA_CMD'] = 'java' |
try: |
- check = subprocess.Popen(['checkstyle', '-c', style_file] + java_files, |
+ check = subprocess.Popen(['java', '-cp', |
+ 'third_party/checkstyle/checkstyle-5.7-all.jar', |
+ 'com.puppycrawl.tools.checkstyle.Main', '-c', |
+ style_file] + java_files, |
stdout=subprocess.PIPE, env=checkstyle_env) |
stdout, _ = check.communicate() |
if check.returncode == 0: |
@@ -56,4 +59,4 @@ def RunCheckstyle(input_api, output_api, style_file): |
full_path, end = error.split(':', 1) |
rel_path = os.path.relpath(full_path, local_path) |
output.append(' %s:%s' % (rel_path, end)) |
- return [output_api.PresubmitPromptWarning('\n'.join(output))] |
+ return [output_api.PresubmitPromptWarning('\n'.join(output))] |