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

Side by Side Diff: build/android/devil/android/sdk/dexdump.py

Issue 1316413003: [Android] Add a configurable environment for devil/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 6
7 from devil import env
7 from devil.utils import cmd_helper 8 from devil.utils import cmd_helper
8 from pylib import constants
9 9
10 _DEXDUMP_PATH = os.path.join(constants.ANDROID_SDK_TOOLS, 'dexdump') 10 _DEXDUMP_PATH = os.path.join(env.android_sdk.build_tools_path, 'dexdump')
11 11
12 def DexDump(dexfiles, file_summary=False): 12 def DexDump(dexfiles, file_summary=False):
13 """A wrapper around the Android SDK's dexdump tool. 13 """A wrapper around the Android SDK's dexdump tool.
14 14
15 Args: 15 Args:
16 dexfiles: The dexfile or list of dex files to dump. 16 dexfiles: The dexfile or list of dex files to dump.
17 file_summary: Display summary information from the file header. (-f) 17 file_summary: Display summary information from the file header. (-f)
18 18
19 Returns: 19 Returns:
20 An iterable over the output lines. 20 An iterable over the output lines.
21 """ 21 """
22 # TODO(jbudorick): Add support for more options as necessary. 22 # TODO(jbudorick): Add support for more options as necessary.
23 if isinstance(dexfiles, basestring): 23 if isinstance(dexfiles, basestring):
24 dexfiles = [dexfiles] 24 dexfiles = [dexfiles]
25 args = [_DEXDUMP_PATH] + dexfiles 25 args = [_DEXDUMP_PATH] + dexfiles
26 if file_summary: 26 if file_summary:
27 args.append('-f') 27 args.append('-f')
28 28
29 return cmd_helper.IterCmdOutputLines(args) 29 return cmd_helper.IterCmdOutputLines(args)
30 30
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698