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

Side by Side Diff: build/android/incremental_install/create_install_script.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 unified diff | Download patch
« no previous file with comments | « build/android/host_heartbeat.py ('k') | build/android/install_emulator_deps.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright 2015 The Chromium Authors. All rights reserved. 3 # Copyright 2015 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Creates a script to run an "_incremental" .apk.""" 7 """Creates a script to run an "_incremental" .apk."""
8 8
9 import argparse 9 import argparse
10 import os 10 import os
11 import pprint 11 import pprint
12 import sys 12 import sys
13 13
14 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) 14 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
15 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'gyp')) 15 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'gyp'))
16 16
17 from pylib import constants 17 from pylib.constants import host_paths
18 from util import build_utils 18 from util import build_utils
19 19
20 20
21 SCRIPT_TEMPLATE = """\ 21 SCRIPT_TEMPLATE = """\
22 #!/usr/bin/env python 22 #!/usr/bin/env python
23 # 23 #
24 # This file was generated by: 24 # This file was generated by:
25 # //build/android/incremental_install/create_install_script.py 25 # //build/android/incremental_install/create_install_script.py
26 26
27 import os 27 import os
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return options 118 return options
119 119
120 120
121 def main(args): 121 def main(args):
122 options = _ParseArgs(args) 122 options = _ParseArgs(args)
123 123
124 def relativize(path): 124 def relativize(path):
125 script_dir = os.path.dirname(options.script_output_path) 125 script_dir = os.path.dirname(options.script_output_path)
126 return path and os.path.relpath(path, script_dir) 126 return path and os.path.relpath(path, script_dir)
127 127
128 installer_path = os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'android', 128 installer_path = os.path.join(host_paths.DIR_SOURCE_ROOT, 'build', 'android',
129 'incremental_install', 'installer.py') 129 'incremental_install', 'installer.py')
130 pformat = pprint.pformat 130 pformat = pprint.pformat
131 template_args = { 131 template_args = {
132 'cmd_path': pformat(relativize(installer_path)), 132 'cmd_path': pformat(relativize(installer_path)),
133 'apk_path': pformat(relativize(options.apk_path)), 133 'apk_path': pformat(relativize(options.apk_path)),
134 'output_directory': pformat(relativize(options.output_directory)), 134 'output_directory': pformat(relativize(options.output_directory)),
135 'native_libs': pformat([relativize(p) for p in options.native_libs]), 135 'native_libs': pformat([relativize(p) for p in options.native_libs]),
136 'dex_files': pformat([relativize(p) for p in options.dex_files]), 136 'dex_files': pformat([relativize(p) for p in options.dex_files]),
137 'show_proguard_warning': pformat(options.show_proguard_warning), 137 'show_proguard_warning': pformat(options.show_proguard_warning),
138 'splits': pformat([relativize(p) for p in options.splits]), 138 'splits': pformat([relativize(p) for p in options.splits]),
139 } 139 }
140 140
141 with open(options.script_output_path, 'w') as script: 141 with open(options.script_output_path, 'w') as script:
142 script.write(SCRIPT_TEMPLATE.format(**template_args)) 142 script.write(SCRIPT_TEMPLATE.format(**template_args))
143 143
144 os.chmod(options.script_output_path, 0750) 144 os.chmod(options.script_output_path, 0750)
145 145
146 if options.depfile: 146 if options.depfile:
147 build_utils.WriteDepfile( 147 build_utils.WriteDepfile(
148 options.depfile, 148 options.depfile,
149 build_utils.GetPythonDependencies()) 149 build_utils.GetPythonDependencies())
150 150
151 151
152 if __name__ == '__main__': 152 if __name__ == '__main__':
153 sys.exit(main(sys.argv[1:])) 153 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « build/android/host_heartbeat.py ('k') | build/android/install_emulator_deps.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698