Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1264)

Unified Diff: build/android/gyp/create_device_library_links.py

Issue 16831013: [Android] Add an action to check/record attached devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Blah Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gyp/apk_install.py ('k') | build/android/gyp/get_device_configuration.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/create_device_library_links.py
diff --git a/build/android/gyp/create_device_library_links.py b/build/android/gyp/create_device_library_links.py
index 5dd5f39988c22003858b2d548e373f7a00308448..1df177d6dd13660d1648dfe62df4e56827130b1f 100755
--- a/build/android/gyp/create_device_library_links.py
+++ b/build/android/gyp/create_device_library_links.py
@@ -16,17 +16,17 @@ import optparse
import os
import sys
+from util import build_device
from util import build_utils
from util import md5_check
BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..')
sys.path.append(BUILD_ANDROID_DIR)
-from pylib import android_commands
from pylib.utils import apk_helper
-def RunShellCommand(adb, cmd):
- output = adb.RunShellCommand(cmd)
+def RunShellCommand(device, cmd):
+ output = device.RunShellCommand(cmd)
if output:
raise Exception(
@@ -53,15 +53,19 @@ def CreateSymlinkScript(options):
def TriggerSymlinkScript(options):
+ device = build_device.GetBuildDeviceFromPath(
+ options.build_device_configuration)
+ if not device:
+ return
+
apk_package = apk_helper.GetPackageName(options.apk)
apk_libraries_dir = '/data/data/%s/lib' % apk_package
- adb = android_commands.AndroidCommands()
device_dir = os.path.dirname(options.script_device_path)
mkdir_cmd = ('if [ ! -e %(dir)s ]; then mkdir -p %(dir)s; fi ' %
{ 'dir': device_dir })
- RunShellCommand(adb, mkdir_cmd)
- adb.PushIfNeeded(options.script_host_path, options.script_device_path)
+ RunShellCommand(device, mkdir_cmd)
+ device.PushIfNeeded(options.script_host_path, options.script_device_path)
trigger_cmd = (
'APK_LIBRARIES_DIR=%(apk_libraries_dir)s; '
@@ -72,15 +76,10 @@ def TriggerSymlinkScript(options):
'target_dir': options.target_dir,
'script_device_path': options.script_device_path
}
- RunShellCommand(adb, trigger_cmd)
+ RunShellCommand(device, trigger_cmd)
def main(argv):
- if not build_utils.IsDeviceReady():
- build_utils.PrintBigWarning(
- 'Zero (or multiple) devices attached. Skipping creating symlinks.')
- return
-
parser = optparse.OptionParser()
parser.add_option('--apk', help='Path to the apk.')
parser.add_option('--script-host-path',
@@ -92,6 +91,8 @@ def main(argv):
parser.add_option('--target-dir',
help='Device directory that contains the target libraries for symlinks.')
parser.add_option('--stamp', help='Path to touch on success.')
+ parser.add_option('--build-device-configuration',
+ help='Path to build device configuration.')
options, _ = parser.parse_args()
required_options = ['apk', 'libraries_json', 'script_host_path',
« no previous file with comments | « build/android/gyp/apk_install.py ('k') | build/android/gyp/get_device_configuration.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698