Commit cbdb33b7 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Silence ProGuard output about duplicate input files

We already were silencing most of this via stdout filtering, but there
are still some third-party libraries that were showing warnings. E.g.:

Warning: can't write resource [META-INF/maven/com.google.guava/guava/pom.xml] (Duplicate zip entry [espresso-core-release-no-dep.jar:META-INF/maven/com.google.guava/guava/pom.xml])

This change tells ProGuard to ignore these files, rather than filtering
the resulting errors

Change-Id: I288507de1f2c5576fbb0fea8bfebb189b2603c92
Reviewed-on: https://chromium-review.googlesource.com/963699Reviewed-by: default avatarEric Stevenson <estevenson@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543527}
parent 0c5f2838
...@@ -16,7 +16,7 @@ class _ProguardOutputFilter(object): ...@@ -16,7 +16,7 @@ class _ProguardOutputFilter(object):
IGNORE_RE = re.compile( IGNORE_RE = re.compile(
r'Pro.*version|Note:|Reading|Preparing|Printing|ProgramClass:|Searching|' r'Pro.*version|Note:|Reading|Preparing|Printing|ProgramClass:|Searching|'
r'jar \[|\d+ class path entries checked|.*:.*(?:MANIFEST\.MF|\.empty)') r'jar \[|\d+ class path entries checked')
def __init__(self): def __init__(self):
self._last_line_ignored = False self._last_line_ignored = False
...@@ -128,8 +128,11 @@ class ProguardCmdBuilder(object): ...@@ -128,8 +128,11 @@ class ProguardCmdBuilder(object):
for optimization in self._disabled_optimizations: for optimization in self._disabled_optimizations:
cmd += [ '-optimizations', '!' + optimization ] cmd += [ '-optimizations', '!' + optimization ]
# Filter out META-INF files to avoid warnings about multiple inputs having
# the same files.
cmd += [ cmd += [
'-injars', ':'.join(self._injars) '-injars',
':'.join('{}(!META-INF/**,!.empty)'.format(x) for x in self._injars)
] ]
for config_file in self._configs: for config_file in self._configs:
......
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