OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 import re | 6 import re |
7 import tempfile | 7 import tempfile |
8 | 8 |
| 9 from devil.utils import cmd_helper |
9 from pylib import constants | 10 from pylib import constants |
10 from pylib import cmd_helper | |
11 | 11 |
12 | 12 |
13 _PROGUARD_CLASS_RE = re.compile(r'\s*?- Program class:\s*([\S]+)$') | 13 _PROGUARD_CLASS_RE = re.compile(r'\s*?- Program class:\s*([\S]+)$') |
14 _PROGUARD_SUPERCLASS_RE = re.compile(r'\s*? Superclass:\s*([\S]+)$') | 14 _PROGUARD_SUPERCLASS_RE = re.compile(r'\s*? Superclass:\s*([\S]+)$') |
15 _PROGUARD_SECTION_RE = re.compile( | 15 _PROGUARD_SECTION_RE = re.compile( |
16 r'^(?:Interfaces|Constant Pool|Fields|Methods|Class file attributes) ' | 16 r'^(?:Interfaces|Constant Pool|Fields|Methods|Class file attributes) ' |
17 r'\(count = \d+\):$') | 17 r'\(count = \d+\):$') |
18 _PROGUARD_METHOD_RE = re.compile(r'\s*?- Method:\s*(\S*)[(].*$') | 18 _PROGUARD_METHOD_RE = re.compile(r'\s*?- Method:\s*(\S*)[(].*$') |
19 _PROGUARD_ANNOTATION_RE = re.compile(r'\s*?- Annotation \[L(\S*);\]:$') | 19 _PROGUARD_ANNOTATION_RE = re.compile(r'\s*?- Annotation \[L(\S*);\]:$') |
20 _PROGUARD_ANNOTATION_CONST_RE = ( | 20 _PROGUARD_ANNOTATION_CONST_RE = ( |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 m = _PROGUARD_ANNOTATION_VALUE_RE.match(line) | 139 m = _PROGUARD_ANNOTATION_VALUE_RE.match(line) |
140 if m: | 140 if m: |
141 if method_result: | 141 if method_result: |
142 method_result['annotations'][annotation] = m.group(1) | 142 method_result['annotations'][annotation] = m.group(1) |
143 else: | 143 else: |
144 class_result['annotations'][annotation] = m.group(1) | 144 class_result['annotations'][annotation] = m.group(1) |
145 annotation_has_value = None | 145 annotation_has_value = None |
146 | 146 |
147 return results | 147 return results |
148 | 148 |
OLD | NEW |