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

Unified Diff: build/android/resource_sizes.py

Issue 1571803002: [Android] Prepare build/android/ for catapult+devil. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@create-device-library-links
Patch Set: rebase Created 4 years, 11 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/pylib/utils/logging_utils.py ('k') | build/android/screenshot.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/resource_sizes.py
diff --git a/build/android/resource_sizes.py b/build/android/resource_sizes.py
index db008bb8e9ff6c4d281d115a70b9014cec8ea576..00df8efc3de696b8db0ba0bcf14c01d48dca2f0b 100755
--- a/build/android/resource_sizes.py
+++ b/build/android/resource_sizes.py
@@ -20,14 +20,17 @@ import tempfile
import zipfile
import zlib
+import devil_chromium
from devil.utils import cmd_helper
-from pylib import constants
+from pylib.constants import host_paths
-sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'tools', 'grit'))
-from grit.format import data_pack # pylint: disable=import-error
-sys.path.append(os.path.join(
- constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common'))
-import perf_tests_results_helper # pylint: disable=import-error
+_GRIT_PATH = os.path.join(host_paths.DIR_SOURCE_ROOT, 'tools', 'grit')
+
+with host_paths.SysPath(_GRIT_PATH):
+ from grit.format import data_pack # pylint: disable=import-error
+
+with host_paths.SysPath(host_paths.BUILD_COMMON_PATH):
+ import perf_tests_results_helper # pylint: disable=import-error
# Static initializers expected in official builds. Note that this list is built
@@ -271,7 +274,7 @@ def PrintPakAnalysis(apk_filename, min_pak_resource_size, build_type):
def _GetResourceIdNameMap(build_type):
"""Returns a map of {resource_id: resource_name}."""
- out_dir = os.path.join(constants.DIR_SOURCE_ROOT, 'out', build_type)
+ out_dir = os.path.join(host_paths.DIR_SOURCE_ROOT, 'out', build_type)
assert os.path.isdir(out_dir), 'Failed to locate out dir at %s' % out_dir
print 'Looking at resources in: %s' % out_dir
@@ -367,6 +370,8 @@ Pass any number of files to graph their sizes. Any files with the extension
if not files:
option_parser.error('Must specify a file')
+ devil_chromium.Initialize()
+
if options.so_with_symbols_path:
PrintStaticInitializersCount(
options.so_with_symbols_path, chartjson=chartjson)
« no previous file with comments | « build/android/pylib/utils/logging_utils.py ('k') | build/android/screenshot.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698