Commit dbce02f6 authored by zpeng's avatar zpeng Committed by Commit bot

Update third_party/checkstyle to 7.6.1

This CL updates third_party/checkstyle to 7.6.1 so checkstyle would
work with Java 8 lambda features.

BUG=703238

Review-Url: https://codereview.chromium.org/2799303003
Cr-Commit-Position: refs/heads/master@{#462968}
parent 6cd116a5
...@@ -720,6 +720,16 @@ hooks = [ ...@@ -720,6 +720,16 @@ hooks = [
'-l', 'third_party/retrolambda' '-l', 'third_party/retrolambda'
], ],
}, },
{
'name': 'checkstyle',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-android-tools/checkstyle',
'-l', 'third_party/checkstyle'
],
},
{ {
'name': 'apk-patch-size-estimator', 'name': 'apk-patch-size-estimator',
'pattern': '.', 'pattern': '.',
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
/cardboard-java/src /cardboard-java/src
/catapult /catapult
/ced/src /ced/src
/checkstyle/*.jar
/chromeos_login_manager /chromeos_login_manager
/chromeos_text_input /chromeos_text_input
/chromite /chromite
......
aurimas@chromium.org agrieve@chromium.org
jbudorick@chromium.org
nyquist@chromium.org
zpeng@chromium.org
Name: Checkstyle is a development tool to help programmers write Java code that Name: Checkstyle is a development tool to help programmers write Java code that
adheres to a coding standard. adheres to a coding standard.
Short Name: checkstyle Short Name: checkstyle
URL: http://checkstyle.sourceforge.net/ URL: https://github.com/checkstyle/checkstyle
Version: 6.5 Version: 7.6.1
License: LGPL 2.1 License: LGPL 2.1
License File: NOT_SHIPPED License File: NOT_SHIPPED
Security Critical: no Security Critical: no
...@@ -11,5 +11,15 @@ Description: ...@@ -11,5 +11,15 @@ Description:
Checkstyle is used to validate Java code style on Chromium PRESUBMIT step. Checkstyle is used to validate Java code style on Chromium PRESUBMIT step.
Local Modifications: Local Modifications:
- Downloaded checkstyle-6.5-all.jar without source code development None
documentation.
Update instructions (requires @google.com account):
- Download fat jar from https://sourceforge.net/projects/checkstyle/files/checkstyle/
- Modify tools/android/checkstyle/checkstyle.py and verify the new fat jar works
- Remove existing SHA1 file
- If gcloud auth tokens are not set up, run
$ download_from_google_storage --config
- Upload new fat jar to gcloud. In third_party/checkstyle, run
$ upload_to_google_storage.py -b chromium-android-tools/checkstyle {new_far_jar}
- Check in new SHA1 file
c6889fa07ec9afb0ca8029be75de31dc29dc4f05
\ No newline at end of file
...@@ -13,7 +13,15 @@ CHROMIUM_SRC = os.path.normpath( ...@@ -13,7 +13,15 @@ CHROMIUM_SRC = os.path.normpath(
os.path.join(os.path.dirname(__file__), os.path.join(os.path.dirname(__file__),
os.pardir, os.pardir, os.pardir)) os.pardir, os.pardir, os.pardir))
CHECKSTYLE_ROOT = os.path.join(CHROMIUM_SRC, 'third_party', 'checkstyle', CHECKSTYLE_ROOT = os.path.join(CHROMIUM_SRC, 'third_party', 'checkstyle',
'checkstyle-6.5-all.jar') 'checkstyle-7.6.1-all.jar')
def FormatCheckstyleOutput(checkstyle_output):
lines = checkstyle_output.splitlines(True)
if 'Checkstyle ends with' in lines[-1]:
return ''.join(lines[:-1])
else:
return checkstyle_output
def RunCheckstyle(input_api, output_api, style_file, black_list=None): def RunCheckstyle(input_api, output_api, style_file, black_list=None):
...@@ -49,8 +57,10 @@ def RunCheckstyle(input_api, output_api, style_file, black_list=None): ...@@ -49,8 +57,10 @@ def RunCheckstyle(input_api, output_api, style_file, black_list=None):
result_errors = [] result_errors = []
result_warnings = [] result_warnings = []
formatted_checkstyle_output = FormatCheckstyleOutput(stdout)
local_path = input_api.PresubmitLocalPath() local_path = input_api.PresubmitLocalPath()
root = xml.dom.minidom.parseString(stdout) root = xml.dom.minidom.parseString(formatted_checkstyle_output)
for fileElement in root.getElementsByTagName('file'): for fileElement in root.getElementsByTagName('file'):
fileName = fileElement.attributes['name'].value fileName = fileElement.attributes['name'].value
fileName = os.path.relpath(fileName, local_path) fileName = os.path.relpath(fileName, local_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment