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

Side by Side Diff: build/android/pylib/sdk/aapt.py

Issue 2392643003: Removes files from //build that we don't need (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « build/android/pylib/sdk/__init__.py ('k') | build/android/pylib/sdk/dexdump.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 """This module wraps the Android Asset Packaging Tool."""
6
7 import os
8
9 from pylib import cmd_helper
10 from pylib import constants
11 from pylib.utils import timeout_retry
12
13 _AAPT_PATH = os.path.join(constants.ANDROID_SDK_TOOLS, 'aapt')
14
15 def _RunAaptCmd(args):
16 """Runs an aapt command.
17
18 Args:
19 args: A list of arguments for aapt.
20
21 Returns:
22 The output of the command.
23 """
24 cmd = [_AAPT_PATH] + args
25 status, output = cmd_helper.GetCmdStatusAndOutput(cmd)
26 if status != 0:
27 raise Exception('Failed running aapt command: "%s" with output "%s".' %
28 (' '.join(cmd), output))
29 return output
30
31 def Dump(what, apk, assets=None):
32 """Returns the output of the aapt dump command.
33
34 Args:
35 what: What you want to dump.
36 apk: Path to apk you want to dump information for.
37 assets: List of assets in apk you want to dump information for.
38 """
39 assets = assets or []
40 if isinstance(assets, basestring):
41 assets = [assets]
42 return _RunAaptCmd(['dump', what, apk] + assets).splitlines()
OLDNEW
« no previous file with comments | « build/android/pylib/sdk/__init__.py ('k') | build/android/pylib/sdk/dexdump.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698