diff options
author | 2016-10-04 22:43:26 +0000 | |
---|---|---|
committer | 2016-10-05 12:26:53 +0000 | |
commit | 567aaf409eeca45310f65f948444ddb08c5c1e16 (patch) | |
tree | df6246026dfc951c2952e14aad471f95a28866ad | |
parent | 9c25afe750a937b2152c21a93effc8b9ba82c27b (diff) |
Allow adaptresourcefilecontents for proguard configuration, and -s in the directive value.
--
MOS_MIGRATED_REVID=135162267
-rw-r--r-- | tools/jdk/proguard_whitelister.py | 7 | ||||
-rw-r--r-- | tools/jdk/proguard_whitelister_test_input.cfg | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/tools/jdk/proguard_whitelister.py b/tools/jdk/proguard_whitelister.py index 6c95360df7..393807a5af 100644 --- a/tools/jdk/proguard_whitelister.py +++ b/tools/jdk/proguard_whitelister.py @@ -37,7 +37,7 @@ class ProguardConfigValidator(object): """Validates a proguard config.""" # Must be a tuple for str.startswith() - _VALID_ARGS = ('keep', 'assumenosideeffects') + _VALID_ARGS = ('keep', 'assumenosideeffects', 'adaptresourcefilecontents') def __init__(self, config_path, outconfig_path): self._config_path = config_path @@ -58,7 +58,10 @@ class ProguardConfigValidator(object): def _Validate(self, config): """Checks the config for illegal arguments.""" config = re.sub(PROGUARD_COMMENTS_PATTERN, '', config) - args = config.split('-') + args = re.compile('(?:^-|\n-)').split(config) + + print args + invalid_configs = [] for arg in args: arg = arg.strip() diff --git a/tools/jdk/proguard_whitelister_test_input.cfg b/tools/jdk/proguard_whitelister_test_input.cfg index ceb3709dd8..04aa16d282 100644 --- a/tools/jdk/proguard_whitelister_test_input.cfg +++ b/tools/jdk/proguard_whitelister_test_input.cfg @@ -46,3 +46,5 @@ # This is a comment, so this should not cause problems -dontobfuscate # This is a comment, so # this should not cause problems -dontnote + +-adaptresourcefilecontents META-INF/services/some.service |