OLD | NEW |
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 '''Prepares the Google Play services split client libraries before usage by | 7 '''Prepares the Google Play services split client libraries before usage by |
8 Chrome's build system. | 8 Chrome's build system. |
9 | 9 |
10 We need to preprocess Google Play services before using it in Chrome builds | 10 We need to preprocess Google Play services before using it in Chrome builds |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 # This file generated by {script} | 213 # This file generated by {script} |
214 gms_proguard_configs = [ | 214 gms_proguard_configs = [ |
215 {body} | 215 {body} |
216 ] | 216 ] |
217 ''') | 217 ''') |
218 | 218 |
219 gni_lines = [] | 219 gni_lines = [] |
220 for client_dir in os.listdir(out_dir): | 220 for client_dir in os.listdir(out_dir): |
221 proguard_path = os.path.join( | 221 proguard_path = os.path.join( |
222 out_dir, client_dir, 'proguard.txt') | 222 out_dir, client_dir, 'proguard.txt') |
223 if os.path.exists(os.path.dirname(proguard_path)): | 223 if os.path.exists(proguard_path): |
224 rooted_path = os.path.relpath(proguard_path, root_dir) | 224 rooted_path = os.path.relpath(proguard_path, root_dir) |
225 gni_lines.append(' "//{}",'.format(rooted_path)) | 225 gni_lines.append(' "//{}",'.format(rooted_path)) |
226 gni_lines.sort() | 226 gni_lines.sort() |
227 | 227 |
228 gni_text = gni_template.format( | 228 gni_text = gni_template.format( |
229 script=os.path.relpath(sys.argv[0], gni_dir), | 229 script=os.path.relpath(sys.argv[0], gni_dir), |
230 body='\n'.join(gni_lines)) | 230 body='\n'.join(gni_lines)) |
231 | 231 |
232 with open(gni_path, 'w') as gni_file: | 232 with open(gni_path, 'w') as gni_file: |
233 gni_file.write(gni_text) | 233 gni_file.write(gni_text) |
234 | 234 |
235 | 235 |
236 def _UpdateVersionInConfig(config, tmp_paths): | 236 def _UpdateVersionInConfig(config, tmp_paths): |
237 version_xml_path = os.path.join(tmp_paths['imported_clients'], | 237 version_xml_path = os.path.join(tmp_paths['imported_clients'], |
238 config.version_xml_path) | 238 config.version_xml_path) |
239 play_services_full_version = utils.GetVersionNumberFromLibraryResources( | 239 play_services_full_version = utils.GetVersionNumberFromLibraryResources( |
240 version_xml_path) | 240 version_xml_path) |
241 config.UpdateVersionNumber(play_services_full_version) | 241 config.UpdateVersionNumber(play_services_full_version) |
242 | 242 |
243 | 243 |
244 def _ExtractAll(zip_path, out_path): | 244 def _ExtractAll(zip_path, out_path): |
245 with zipfile.ZipFile(zip_path, 'r') as zip_file: | 245 with zipfile.ZipFile(zip_path, 'r') as zip_file: |
246 zip_file.extractall(out_path) | 246 zip_file.extractall(out_path) |
247 | 247 |
248 if __name__ == '__main__': | 248 if __name__ == '__main__': |
249 sys.exit(main()) | 249 sys.exit(main()) |
OLD | NEW |