summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorjbudorick <jbudorick@chromium.org>2016-01-12 14:52:25 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-12 22:53:33 +0000
commitbe1dd78c6dd4698bd11859be45892280ef2f799b (patch)
treef0188bd9516a8f91171b370bdf57b56af999c330 /build
parentf216c5e582cabb13960b340539c3660231bb778d (diff)
downloadchromium_src-be1dd78c6dd4698bd11859be45892280ef2f799b.zip
chromium_src-be1dd78c6dd4698bd11859be45892280ef2f799b.tar.gz
chromium_src-be1dd78c6dd4698bd11859be45892280ef2f799b.tar.bz2
[Android] Make the adb path configurable in three scripts.
BUG=526305 Review URL: https://codereview.chromium.org/1577383002 Cr-Commit-Position: refs/heads/master@{#369018}
Diffstat (limited to 'build')
-rwxr-xr-xbuild/android/adb_install_apk.py16
-rwxr-xr-xbuild/android/buildbot/bb_device_status_check.py13
-rwxr-xr-xbuild/android/provision_devices.py13
3 files changed, 38 insertions, 4 deletions
diff --git a/build/android/adb_install_apk.py b/build/android/adb_install_apk.py
index dc5b6f1..c6bd7c2 100755
--- a/build/android/adb_install_apk.py
+++ b/build/android/adb_install_apk.py
@@ -13,7 +13,7 @@ import os
import sys
import devil_chromium
-
+from devil import devil_env
from devil.android import apk_helper
from devil.android import device_blacklist
from devil.android import device_errors
@@ -56,6 +56,8 @@ def main():
parser.add_argument('-d', '--device', dest='devices', action='append',
help='Target device for apk to install on. Enter multiple'
' times for multiple devices.')
+ parser.add_argument('--adb-path',
+ help='Absolute path to the adb binary to use.')
parser.add_argument('--blacklist-file', help='Device blacklist JSON file.')
parser.add_argument('-v', '--verbose', action='count',
help='Enable verbose logging.')
@@ -67,7 +69,17 @@ def main():
run_tests_helper.SetLogLevel(args.verbose)
constants.SetBuildType(args.build_type)
- devil_chromium.Initialize(output_directory=constants.GetOutDirectory())
+ devil_custom_deps = None
+ if args.adb_path:
+ devil_custom_deps = {
+ 'adb': {
+ devil_env.GetPlatform(): [args.adb_path],
+ },
+ }
+
+ devil_chromium.Initialize(
+ output_directory=constants.GetOutDirectory(),
+ custom_deps=devil_custom_deps)
apk = args.apk_path or args.apk_name
if not apk.endswith('.apk'):
diff --git a/build/android/buildbot/bb_device_status_check.py b/build/android/buildbot/bb_device_status_check.py
index 8eba829..cafe627 100755
--- a/build/android/buildbot/bb_device_status_check.py
+++ b/build/android/buildbot/bb_device_status_check.py
@@ -17,6 +17,7 @@ import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import devil_chromium
+from devil import devil_env
from devil.android import battery_utils
from devil.android import device_blacklist
from devil.android import device_errors
@@ -304,6 +305,8 @@ def main():
'This script now always tries to reset USB.')
parser.add_argument('--json-output',
help='Output JSON information into a specified file.')
+ parser.add_argument('--adb-path',
+ help='Absolute path to the adb binary to use.')
parser.add_argument('--blacklist-file', help='Device blacklist JSON file.')
parser.add_argument('-v', '--verbose', action='count', default=1,
help='Log more information.')
@@ -312,7 +315,15 @@ def main():
run_tests_helper.SetLogLevel(args.verbose)
- devil_chromium.Initialize()
+ devil_custom_deps = None
+ if args.adb_path:
+ devil_custom_deps = {
+ 'adb': {
+ devil_env.GetPlatform(): [args.adb_path],
+ },
+ }
+
+ devil_chromium.Initialize(custom_deps=devil_custom_deps)
blacklist = (device_blacklist.Blacklist(args.blacklist_file)
if args.blacklist_file
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index 5f8fce2..a9c6cd8 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -22,6 +22,7 @@ import sys
import time
import devil_chromium
+from devil import devil_env
from devil.android import battery_utils
from devil.android import device_blacklist
from devil.android import device_errors
@@ -470,6 +471,8 @@ def main():
parser.add_argument('-d', '--device', metavar='SERIAL',
help='the serial number of the device to be provisioned'
' (the default is to provision all devices attached)')
+ parser.add_argument('--adb-path',
+ help='Absolute path to the adb binary to use.')
parser.add_argument('--blacklist-file', help='Device blacklist JSON file.')
parser.add_argument('--phase', action='append', choices=_PHASES.ALL,
dest='phases',
@@ -519,7 +522,15 @@ def main():
run_tests_helper.SetLogLevel(args.verbose)
- devil_chromium.Initialize()
+ devil_custom_deps = None
+ if args.adb_path:
+ devil_custom_deps = {
+ 'adb': {
+ devil_env.GetPlatform(): [args.adb_path],
+ },
+ }
+
+ devil_chromium.Initialize(custom_deps=devil_custom_deps)
return ProvisionDevices(args)