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

Unified Diff: build/android/devil_chromium.py

Issue 1416703003: [Android] Add a configurable environment for devil/. (RELAND 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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/devil_chromium.json ('k') | build/android/gyp/apk_install.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/devil_chromium.py
diff --git a/build/android/devil_chromium.py b/build/android/devil_chromium.py
new file mode 100644
index 0000000000000000000000000000000000000000..990b3794692eb7ca47828617205d5dc1899dd0a5
--- /dev/null
+++ b/build/android/devil_chromium.py
@@ -0,0 +1,88 @@
+# 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.
+
+"""Configures devil for use in chromium."""
+
+import os
+
+from devil import devil_env
+
+
+_DEVIL_CONFIG = os.path.abspath(
+ os.path.join(os.path.dirname(__file__), 'devil_chromium.json'))
+
+_DEVIL_BUILD_PRODUCT_DEPS = {
+ 'forwarder_device': {
+ 'armeabi-v7a': 'forwarder_dist',
+ 'arm64-v8a': 'forwarder_dist',
+ },
+ 'forwarder_host': {
+ 'any': 'host_forwarder',
+ },
+ 'md5sum_device': {
+ 'armeabi-v7a': 'md5sum_dist',
+ 'arm64-v8a': 'md5sum_dist',
+ },
+ 'md5sum_host': {
+ 'any': 'md5sum_bin_host',
+ },
+}
+
+
+def Initialize(output_directory=None, custom_deps=None):
+ """Initializes devil with chromium's binaries and third-party libraries.
+
+ This includes:
+ - Libraries:
+ - the android SDK ("android_sdk")
+ - pymock ("pymock")
+ - Build products:
+ - host & device forwarder binaries
+ ("forwarder_device" and "forwarder_host")
+ - host & device md5sum binaries ("md5sum_device" and "md5sum_host")
+
+ Args:
+ output_directory: An optional path to the output directory. If not set,
+ no built dependencies are configured.
+ custom_deps: An optional dictionary specifying custom dependencies.
+ This should be of the form:
+
+ {
+ 'dependency_name': {
+ 'platform': 'path',
+ ...
+ },
+ ...
+ }
+ """
+
+ devil_dynamic_deps = {}
+
+ if output_directory:
+ for dep_name, arch_dict in _DEVIL_BUILD_PRODUCT_DEPS.iteritems():
+ devil_dynamic_deps[dep_name] = {}
+ for arch, name in arch_dict.iteritems():
+ devil_dynamic_deps[dep_name][arch] = os.path.join(
+ output_directory, name)
+
+ devil_dynamic_config = {
+ 'config_type': 'BaseConfig',
+ 'dependencies': {
+ dep_name: {
+ 'file_info': {
+ 'android_%s' % arch: {
+ 'local_paths': [path]
+ }
+ for arch, path in arch_dict.iteritems()
+ }
+ }
+ for dep_name, arch_dict in devil_dynamic_deps.iteritems()
+ }
+ }
+ if custom_deps:
+ devil_dynamic_config['dependencies'].update(custom_deps)
+
+ devil_env.config.Initialize(
+ configs=[devil_dynamic_config], config_files=[_DEVIL_CONFIG])
+
« no previous file with comments | « build/android/devil_chromium.json ('k') | build/android/gyp/apk_install.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698