Filter extra output introduced by updating proguard

This CL filters encoded binary protobuf signaled by "***BINARY RUN
STATS***" and program class information signaled by "ProgramClass:".
This extra output is introduced by updating proguard.

BUG=674152

Review-Url: https://codereview.chromium.org/2801443002
Cr-Original-Commit-Position: refs/heads/master@{#462620}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 749473a927734754dfcb323b16bdf747b7248d5a
This commit is contained in:
zpeng 2017-04-06 14:11:33 -07:00 коммит произвёл Commit bot
Родитель 8313f506a0
Коммит 893613514d
1 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -15,15 +15,24 @@ class _ProguardOutputFilter(object):
"""
IGNORE_RE = re.compile(
r'(?:Pro.*version|Note:|Reading|Preparing|.*:.*(?:MANIFEST\.MF|\.empty))')
r'(?:Pro.*version|Note:|Reading|Preparing|ProgramClass:|'
'.*:.*(?:MANIFEST\.MF|\.empty))')
def __init__(self):
self._last_line_ignored = False
self._ignore_next_line = False
def __call__(self, output):
ret = []
for line in output.splitlines(True):
if not line.startswith(' '):
if self._ignore_next_line:
self._ignore_next_line = False
continue
if '***BINARY RUN STATS***' in line:
self._last_line_ignored = True
self._ignore_next_line = True
elif not line.startswith(' '):
self._last_line_ignored = bool(self.IGNORE_RE.match(line))
elif 'You should check if you need to specify' in line:
self._last_line_ignored = True
@ -199,4 +208,3 @@ class ProguardCmdBuilder(object):
}
build_utils.WriteJson(this_info, self._outjar + '.info')