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 | 10 We need to preprocess Google Play services before using it in Chrome |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 import os | 54 import os |
55 import shutil | 55 import shutil |
56 import stat | 56 import stat |
57 import sys | 57 import sys |
58 import tempfile | 58 import tempfile |
59 import zipfile | 59 import zipfile |
60 | 60 |
61 from datetime import datetime | 61 from datetime import datetime |
62 | 62 |
63 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) | 63 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) |
| 64 import devil_chromium |
64 from devil.utils import cmd_helper | 65 from devil.utils import cmd_helper |
65 from play_services import utils | 66 from play_services import utils |
66 from pylib.utils import argparse_utils | 67 from pylib.utils import argparse_utils |
67 | 68 |
68 | 69 |
69 M2_PKG_PATH = os.path.join('com', 'google', 'android', 'gms') | 70 M2_PKG_PATH = os.path.join('com', 'google', 'android', 'gms') |
70 | 71 |
71 | 72 |
72 def main(): | 73 def main(): |
73 parser = argparse.ArgumentParser(description=( | 74 parser = argparse.ArgumentParser(description=( |
(...skipping 22 matching lines...) Expand all Loading... |
96 '--is-extracted-repo', | 97 '--is-extracted-repo', |
97 action='store_true', | 98 action='store_true', |
98 help='the provided repository is not made of AAR files') | 99 help='the provided repository is not made of AAR files') |
99 parser.add_argument('--config-help', | 100 parser.add_argument('--config-help', |
100 action='custom_help', | 101 action='custom_help', |
101 custom_help_text=utils.ConfigParser.__doc__, | 102 custom_help_text=utils.ConfigParser.__doc__, |
102 help='show the configuration file format help') | 103 help='show the configuration file format help') |
103 | 104 |
104 args = parser.parse_args() | 105 args = parser.parse_args() |
105 | 106 |
| 107 devil_chromium.Initialize() |
| 108 |
106 return ProcessGooglePlayServices(args.repository, | 109 return ProcessGooglePlayServices(args.repository, |
107 args.out_dir, | 110 args.out_dir, |
108 args.config_file, | 111 args.config_file, |
109 args.is_extracted_repo) | 112 args.is_extracted_repo) |
110 | 113 |
111 | 114 |
112 def ProcessGooglePlayServices(repo, out_dir, config_path, is_extracted_repo): | 115 def ProcessGooglePlayServices(repo, out_dir, config_path, is_extracted_repo): |
113 config = utils.ConfigParser(config_path) | 116 config = utils.ConfigParser(config_path) |
114 | 117 |
115 tmp_root = tempfile.mkdtemp() | 118 tmp_root = tempfile.mkdtemp() |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 254 |
252 config.UpdateVersionNumber(play_services_full_version) | 255 config.UpdateVersionNumber(play_services_full_version) |
253 | 256 |
254 | 257 |
255 def _ExtractAll(zip_path, out_path): | 258 def _ExtractAll(zip_path, out_path): |
256 with zipfile.ZipFile(zip_path, 'r') as zip_file: | 259 with zipfile.ZipFile(zip_path, 'r') as zip_file: |
257 zip_file.extractall(out_path) | 260 zip_file.extractall(out_path) |
258 | 261 |
259 if __name__ == '__main__': | 262 if __name__ == '__main__': |
260 sys.exit(main()) | 263 sys.exit(main()) |
OLD | NEW |