mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-30 17:50:46 +00:00
utils/android: Fix aapt discovery with unexpected structure
If there is an additional file or directory in the `build_tools` directory then WA can fail to find a working version of aapt(2), ensure that at least one of the binaries is a valid file path.
This commit is contained in:
parent
b32f15bbdb
commit
c0a5765da5
@ -734,11 +734,13 @@ def _discover_aapt(env):
|
||||
aapt2_path = ''
|
||||
versions = os.listdir(env.build_tools)
|
||||
for version in reversed(sorted(versions)):
|
||||
if not aapt2_path and not os.path.isfile(aapt2_path):
|
||||
if not os.path.isfile(aapt2_path):
|
||||
aapt2_path = os.path.join(env.build_tools, version, 'aapt2')
|
||||
if not aapt_path and not os.path.isfile(aapt_path):
|
||||
if not os.path.isfile(aapt_path):
|
||||
aapt_path = os.path.join(env.build_tools, version, 'aapt')
|
||||
aapt_version = 1
|
||||
# Use latest available version for aapt/appt2 but ensure at least one is valid.
|
||||
if os.path.isfile(aapt2_path) or os.path.isfile(aapt_path):
|
||||
break
|
||||
|
||||
# Use aapt2 only if present and we have a suitable version
|
||||
|
Loading…
x
Reference in New Issue
Block a user