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

Side by Side Diff: build/android/devil_chromium.py

Issue 1812383003: [Devil] Replace generated Devil config with jinja template. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed devil_chromium.json 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 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 """Configures devil for use in chromium.""" 5 """Configures devil for use in chromium."""
6 6
7 import os 7 import os
8 import sys 8 import sys
9 9
10 from pylib.constants import host_paths 10 from pylib.constants import host_paths
11 11
12 if host_paths.DEVIL_PATH not in sys.path: 12 if host_paths.DEVIL_PATH not in sys.path:
13 sys.path.append(host_paths.DEVIL_PATH) 13 sys.path.append(host_paths.DEVIL_PATH)
14 14
15 from devil import devil_env 15 from devil import devil_env
16 16
17 _DEVIL_CONFIG = os.path.abspath(
18 os.path.join(os.path.dirname(__file__), 'devil_chromium.json'))
19
20 _DEVIL_BUILD_PRODUCT_DEPS = {
21 'forwarder_device': [
22 {
23 'platform': 'android',
24 'arch': 'armeabi-v7a',
25 'name': 'forwarder_dist',
26 },
27 {
28 'platform': 'android',
29 'arch': 'arm64-v8a',
30 'name': 'forwarder_dist',
31 },
32 {
33 'platform': 'android',
34 'arch': 'mips',
35 'name': 'forwarder_dist',
36 },
37 {
38 'platform': 'android',
39 'arch': 'mips64',
40 'name': 'forwarder_dist',
41 },
42 {
43 'platform': 'android',
44 'arch': 'x86',
45 'name': 'forwarder_dist',
46 },
47 {
48 'platform': 'android',
49 'arch': 'x86_64',
50 'name': 'forwarder_dist',
51 },
52 ],
53 'forwarder_host': [
54 {
55 'platform': 'linux2',
56 'arch': 'x86_64',
57 'name': 'host_forwarder',
58 },
59 ],
60 'md5sum_device': [
61 {
62 'platform': 'android',
63 'arch': 'armeabi-v7a',
64 'name': 'md5sum_dist',
65 },
66 {
67 'platform': 'android',
68 'arch': 'arm64-v8a',
69 'name': 'md5sum_dist',
70 },
71 {
72 'platform': 'android',
73 'arch': 'mips',
74 'name': 'md5sum_dist',
75 },
76 {
77 'platform': 'android',
78 'arch': 'mips64',
79 'name': 'md5sum_dist',
80 },
81 {
82 'platform': 'android',
83 'arch': 'x86',
84 'name': 'md5sum_dist',
85 },
86 {
87 'platform': 'android',
88 'arch': 'x86_64',
89 'name': 'md5sum_dist',
90 },
91 ],
92 'md5sum_host': [
93 {
94 'platform': 'linux2',
95 'arch': 'x86_64',
96 'name': 'md5sum_bin_host',
97 },
98 ],
99 }
100
101 17
102 def Initialize(output_directory=None, custom_deps=None): 18 def Initialize(output_directory=None, custom_deps=None):
103 """Initializes devil with chromium's binaries and third-party libraries. 19 """Initializes devil with chromium's binaries and third-party libraries.
104 20
105 This includes: 21 This includes:
106 - Libraries: 22 - Libraries:
107 - the android SDK ("android_sdk") 23 - the android SDK ("android_sdk")
108 - pymock ("pymock") 24 - pymock ("pymock")
109 - Build products: 25 - Build products:
110 - host & device forwarder binaries 26 - host & device forwarder binaries
111 ("forwarder_device" and "forwarder_host") 27 ("forwarder_device" and "forwarder_host")
112 - host & device md5sum binaries ("md5sum_device" and "md5sum_host") 28 - host & device md5sum binaries ("md5sum_device" and "md5sum_host")
113 29
114 Args: 30 Args:
115 output_directory: An optional path to the output directory. If not set, 31 output_directory: An optional path to the output directory. If not set,
116 no built dependencies are configured. 32 no built dependencies are configured.
117 custom_deps: An optional dictionary specifying custom dependencies. 33 custom_deps: An optional dictionary specifying custom dependencies.
118 This should be of the form: 34 This should be of the form:
119 35
120 { 36 {
121 'dependency_name': { 37 'dependency_name': {
122 'platform': 'path', 38 'platform': 'path',
123 ... 39 ...
124 }, 40 },
125 ... 41 ...
126 } 42 }
127 """ 43 """
44 config_files = None
45 if output_directory:
46 generated_config_file = os.path.abspath(os.path.join(
47 output_directory, 'gen', 'devil_chromium.json'))
48 if os.path.exists(generated_config_file):
49 config_files = [generated_config_file]
jbudorick 2016/03/24 18:26:26 This should log a warning if generated_config_file
mikecase (-- gone --) 2016/03/28 20:47:01 Added logging
128 50
129 devil_dynamic_config = { 51 custom_config = {
130 'config_type': 'BaseConfig', 52 'config_type': 'BaseConfig',
131 'dependencies': {}, 53 'dependencies': {},
132 } 54 }
133 if output_directory:
134 output_directory = os.path.abspath(output_directory)
135 devil_dynamic_config['dependencies'] = {
136 dep_name: {
137 'file_info': {
138 '%s_%s' % (dep_config['platform'], dep_config['arch']): {
139 'local_paths': [
140 os.path.join(output_directory, dep_config['name']),
141 ],
142 }
143 for dep_config in dep_configs
144 }
145 }
146 for dep_name, dep_configs in _DEVIL_BUILD_PRODUCT_DEPS.iteritems()
147 }
148 if custom_deps: 55 if custom_deps:
149 devil_dynamic_config['dependencies'].update(custom_deps) 56 custom_config['dependencies'].update(custom_deps)
150 57
151 devil_env.config.Initialize( 58 devil_env.config.Initialize(
152 configs=[devil_dynamic_config], config_files=[_DEVIL_CONFIG]) 59 configs=[custom_config], config_files=config_files)
153 60
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698