aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulia Kawano <juliakawano@google.com>2021-06-02 11:57:03 -1000
committerJulia Kawano <juliakawano@google.com>2021-06-08 03:30:20 +0000
commit27751ea8c6470df82e2085ddd30987072445172f (patch)
tree826f2aa550592865145d3c185ab7b67f97f8f107
parentf6869200855fe287ce0748a006a543812a9cdbe6 (diff)
downloadtests-27751ea8c6470df82e2085ddd30987072445172f.tar.gz
Fix generate-overlayable script to include attrs
Test: manual Change-Id: Ibb147dafa3f974af1fd8d6afdf40142e4e30beca Bug: 190069278
-rw-r--r--tools/rro/resource_utils.py12
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