Commit bed35e9b authored by thakis@chromium.org's avatar thakis@chromium.org

android: Don't require aapt to be on the path during builds and tests.

BUG=330631
R=frankf@chromium.org

Review URL: https://codereview.chromium.org/167643002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251452 0039d316-1c4b-4281-b951-d872f2087c98
parent 7c6c09e8
......@@ -128,6 +128,8 @@ SCREENSHOTS_DIR = os.path.join(DIR_SOURCE_ROOT, 'out_screenshots')
ANDROID_SDK_VERSION = 19
ANDROID_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT,
'third_party/android_tools/sdk')
ANDROID_SDK_TOOLS = os.path.join(ANDROID_SDK_ROOT,
'build-tools/%d.0.0' % ANDROID_SDK_VERSION)
ANDROID_NDK_ROOT = os.path.join(DIR_SOURCE_ROOT,
'third_party/android_tools/ndk')
......
......@@ -4,15 +4,18 @@
"""Module containing utilities for apk packages."""
import os.path
import re
from pylib import cmd_helper
from pylib import constants
def GetPackageName(apk_path):
"""Returns the package name of the apk."""
aapt = os.path.join(constants.ANDROID_SDK_TOOLS, 'aapt')
aapt_output = cmd_helper.GetCmdOutput(
['aapt', 'dump', 'badging', apk_path]).split('\n')
[aapt, 'dump', 'badging', apk_path]).split('\n')
package_name_re = re.compile(r'package: .*name=\'(\S*)\'')
for line in aapt_output:
m = package_name_re.match(line)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment