| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import argparse | 6 import argparse |
| 7 import imp | 7 import imp |
| 8 import os | 8 import os |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 description="Upload service mojoms and binaries to Google storage") | 96 description="Upload service mojoms and binaries to Google storage") |
| 97 parser.add_argument("-n", "--dry-run", action="store_true", help="Dry run") | 97 parser.add_argument("-n", "--dry-run", action="store_true", help="Dry run") |
| 98 parser.add_argument( | 98 parser.add_argument( |
| 99 "--linux-x64-binary-dir", | 99 "--linux-x64-binary-dir", |
| 100 help="Path to the dir containing the linux-x64 service binary relative " | 100 help="Path to the dir containing the linux-x64 service binary relative " |
| 101 "to the repo root, e.g. out/Release") | 101 "to the repo root, e.g. out/Release") |
| 102 parser.add_argument( | 102 parser.add_argument( |
| 103 "--android-arm-binary-dir", | 103 "--android-arm-binary-dir", |
| 104 help="Path to the dir containing the android-arm service binary relative " | 104 help="Path to the dir containing the android-arm service binary relative " |
| 105 "to the repo root, e.g. out/android_Release") | 105 "to the repo root, e.g. out/android_Release") |
| 106 parser.add_argument( |
| 107 "--android-x86-binary-dir", |
| 108 help="Path to the dir containing the android-x86 service binary relative " |
| 109 "to the repo root, e.g. out/android_Release") |
| 110 parser.add_argument( |
| 111 "--android-x64-binary-dir", |
| 112 help="Path to the dir containing the android-x64 service binary relative " |
| 113 "to the repo root, e.g. out/android_Release") |
| 106 parser.add_argument("service", | 114 parser.add_argument("service", |
| 107 help="The service to be uploaded (one of %s)" % SERVICES) | 115 help="The service to be uploaded (one of %s)" % SERVICES) |
| 108 | 116 |
| 109 args = parser.parse_args() | 117 args = parser.parse_args() |
| 110 | 118 |
| 111 if args.service not in SERVICES: | 119 if args.service not in SERVICES: |
| 112 print args.service + " is not one of the recognized services:" | 120 print args.service + " is not one of the recognized services:" |
| 113 print SERVICES | 121 print SERVICES |
| 114 return 1 | 122 return 1 |
| 115 | 123 |
| 116 if args.service in MOJOMS_IN_DIR: | 124 if args.service in MOJOMS_IN_DIR: |
| 117 script_dir = os.path.dirname(os.path.realpath(__file__)) | 125 script_dir = os.path.dirname(os.path.realpath(__file__)) |
| 118 absolute_mojom_directory_path = os.path.join(script_dir, | 126 absolute_mojom_directory_path = os.path.join(script_dir, |
| 119 MOJOMS_IN_DIR[args.service]) | 127 MOJOMS_IN_DIR[args.service]) |
| 120 upload_mojoms(args.service, absolute_mojom_directory_path, args.dry_run) | 128 upload_mojoms(args.service, absolute_mojom_directory_path, args.dry_run) |
| 121 | 129 |
| 122 if args.linux_x64_binary_dir: | 130 if args.linux_x64_binary_dir: |
| 123 upload_binary(args.service, args.linux_x64_binary_dir, | 131 upload_binary(args.service, args.linux_x64_binary_dir, |
| 124 "linux-x64", args.dry_run) | 132 "linux-x64", args.dry_run) |
| 125 | 133 |
| 126 if args.android_arm_binary_dir: | 134 if args.android_arm_binary_dir: |
| 127 upload_binary(args.service, args.android_arm_binary_dir, | 135 upload_binary(args.service, args.android_arm_binary_dir, |
| 128 "android-arm", args.dry_run) | 136 "android-arm", args.dry_run) |
| 129 | 137 |
| 138 if args.android_x86_binary_dir: |
| 139 upload_binary(args.service, args.android_arm_binary_dir, |
| 140 "android-x86", args.dry_run) |
| 141 |
| 142 if args.android_x64_binary_dir: |
| 143 upload_binary(args.service, args.android_arm_binary_dir, |
| 144 "android-x64", args.dry_run) |
| 145 |
| 130 if not args.dry_run: | 146 if not args.dry_run: |
| 131 print "Uploaded artifacts for version %s" % (version, ) | 147 print "Uploaded artifacts for version %s" % (version, ) |
| 132 else: | 148 else: |
| 133 print "No artifacts uploaded (dry run)" | 149 print "No artifacts uploaded (dry run)" |
| 134 return 0 | 150 return 0 |
| 135 | 151 |
| 136 if __name__ == '__main__': | 152 if __name__ == '__main__': |
| 137 sys.exit(main()) | 153 sys.exit(main()) |
| OLD | NEW |