| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 import shutil | 71 import shutil |
| 72 import stat | 72 import stat |
| 73 import sys | 73 import sys |
| 74 | 74 |
| 75 from datetime import datetime | 75 from datetime import datetime |
| 76 from devil.utils import cmd_helper | 76 from devil.utils import cmd_helper |
| 77 from pylib import constants | 77 from pylib import constants |
| 78 | 78 |
| 79 sys.path.append( | 79 sys.path.append( |
| 80 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'android', 'gyp')) | 80 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'android', 'gyp')) |
| 81 from util import build_utils | 81 from util import build_utils # pylint: disable=import-error |
| 82 | 82 |
| 83 | 83 |
| 84 M2_PKG_PATH = os.path.join('com', 'google', 'android', 'gms') | 84 M2_PKG_PATH = os.path.join('com', 'google', 'android', 'gms') |
| 85 OUTPUT_FORMAT_VERSION = 1 | 85 OUTPUT_FORMAT_VERSION = 1 |
| 86 VERSION_FILE_NAME = 'version_info.json' | 86 VERSION_FILE_NAME = 'version_info.json' |
| 87 VERSION_NUMBER_PATTERN = re.compile( | 87 VERSION_NUMBER_PATTERN = re.compile( |
| 88 '<integer name="google_play_services_version">(\d+)<\/integer>') | 88 r'<integer name="google_play_services_version">(\d+)<\/integer>') |
| 89 | 89 |
| 90 def main(): | 90 def main(): |
| 91 parser = argparse.ArgumentParser(description=("Prepares the Google Play " | 91 parser = argparse.ArgumentParser(description=("Prepares the Google Play " |
| 92 "services split client libraries before usage by Chrome's build system. " | 92 "services split client libraries before usage by Chrome's build system. " |
| 93 "See the script's documentation for more a detailed help.")) | 93 "See the script's documentation for more a detailed help.")) |
| 94 parser.add_argument('-r', | 94 parser.add_argument('-r', |
| 95 '--repository', | 95 '--repository', |
| 96 help='The Google Play services repository location', | 96 help='The Google Play services repository location', |
| 97 required=True, | 97 required=True, |
| 98 metavar='FILE') | 98 metavar='FILE') |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 with open(os.path.join(stub_res_location, '.res-stamp'), 'w') as stamp: | 290 with open(os.path.join(stub_res_location, '.res-stamp'), 'w') as stamp: |
| 291 content_str = 'google_play_services_version: %s\nutc_date: %s\n' | 291 content_str = 'google_play_services_version: %s\nutc_date: %s\n' |
| 292 stamp.write(content_str % (play_services_full_version, generation_date)) | 292 stamp.write(content_str % (play_services_full_version, generation_date)) |
| 293 | 293 |
| 294 shutil.copyfile(tmp_version_file_path, | 294 shutil.copyfile(tmp_version_file_path, |
| 295 os.path.join(out_paths['root'], VERSION_FILE_NAME)) | 295 os.path.join(out_paths['root'], VERSION_FILE_NAME)) |
| 296 | 296 |
| 297 | 297 |
| 298 if __name__ == '__main__': | 298 if __name__ == '__main__': |
| 299 sys.exit(main()) | 299 sys.exit(main()) |
| OLD | NEW |