diff options
-rw-r--r-- | tools/rro/resource_utils.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/rro/resource_utils.py b/tools/rro/resource_utils.py index aae73a1..8628abf 100644 --- a/tools/rro/resource_utils.py +++ b/tools/rro/resource_utils.py @@ -93,7 +93,17 @@ def get_resources_from_single_file(filename, ignore_strings=False): root = doc.getroot() result = set() for resource in root: - if resource.tag == 'declare-styleable' or resource.tag is etree.Comment: + if resource.tag is etree.Comment: + continue + if resource.tag == 'declare-styleable': + for attr in resource: + resName = attr.get('name') + # Skip resources beginning with 'android:' as they are part of the framework + # resources. This script finds only the app's resources. + if resName is None or resName.startswith('android:'): + continue + resType = "attr" + add_resource_to_set(result, Resource(resName, resType, ResourceLocation(filename, attr.sourceline))) continue resName = resource.get('name') resType = resource.tag |