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

Unified Diff: build/android/devil/android/sdk/split_select.py

Issue 1770943003: [Android] Remove chromium version of devil. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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
Index: build/android/devil/android/sdk/split_select.py
diff --git a/build/android/devil/android/sdk/split_select.py b/build/android/devil/android/sdk/split_select.py
deleted file mode 100644
index b47a21f9fe00b59b10b0ead9297d330691b900c2..0000000000000000000000000000000000000000
--- a/build/android/devil/android/sdk/split_select.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This module wraps Android's split-select tool."""
-
-from devil.android.sdk import build_tools
-from devil.utils import cmd_helper
-from devil.utils import lazy
-
-
-_split_select_path = lazy.WeakConstant(
- lambda: build_tools.GetPath('split-select'))
-
-
-def _RunSplitSelectCmd(args):
- """Runs a split-select command.
-
- Args:
- args: A list of arguments for split-select.
-
- Returns:
- The output of the command.
- """
- cmd = [_split_select_path.read()] + args
- status, output = cmd_helper.GetCmdStatusAndOutput(cmd)
- if status != 0:
- raise Exception('Failed running command "%s" with output "%s".' %
- (' '.join(cmd), output))
- return output
-
-def _SplitConfig(device, allow_cached_props=False):
- """Returns a config specifying which APK splits are required by the device.
-
- Args:
- device: A DeviceUtils object.
- allow_cached_props: Whether to use cached values for device properties.
- """
- return ('%s-r%s-%s:%s' %
- (device.GetLanguage(cache=allow_cached_props),
- device.GetCountry(cache=allow_cached_props),
- device.screen_density,
- device.product_cpu_abi))
-
-def SelectSplits(device, base_apk, split_apks, allow_cached_props=False):
- """Determines which APK splits the device requires.
-
- Args:
- device: A DeviceUtils object.
- base_apk: The path of the base APK.
- split_apks: A list of paths of APK splits.
- allow_cached_props: Whether to use cached values for device properties.
-
- Returns:
- The list of APK splits that the device requires.
- """
- config = _SplitConfig(device, allow_cached_props=allow_cached_props)
- args = ['--target', config, '--base', base_apk]
- for split in split_apks:
- args.extend(['--split', split])
- return _RunSplitSelectCmd(args).splitlines()
« no previous file with comments | « build/android/devil/android/sdk/shared_prefs_test.py ('k') | build/android/devil/android/sdk/version_codes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698