Søren Gjesse | 3330db2 | 2017-09-13 13:53:11 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file |
| 3 | # for details. All rights reserved. Use of this source code is governed by a |
| 4 | # BSD-style license that can be found in the LICENSE file. |
| 5 | |
| 6 | |
| 7 | from os.path import join |
| 8 | from subprocess import check_call |
| 9 | |
| 10 | import os |
| 11 | |
| 12 | import utils |
| 13 | |
| 14 | AOSP_HELPER_SH = join(utils.REPO_ROOT, 'scripts', 'aosp_helper.sh') |
| 15 | |
| 16 | DEFAULT_LUNCH = 'aosp_x86-eng' |
| 17 | |
| 18 | DEFAULT_ROOT = join(utils.REPO_ROOT, 'build', 'aosp') |
| 19 | |
Søren Gjesse | 9bfed01 | 2017-09-15 08:15:44 +0200 | [diff] [blame] | 20 | def add_root_argument(parser): |
Søren Gjesse | 3330db2 | 2017-09-13 13:53:11 +0200 | [diff] [blame] | 21 | parser.add_argument('--aosp-root', |
| 22 | help='Root of the AOSP checkout. ' + |
| 23 | 'Defaults to ' + DEFAULT_ROOT +'.', |
| 24 | default=DEFAULT_ROOT) |
Søren Gjesse | 9bfed01 | 2017-09-15 08:15:44 +0200 | [diff] [blame] | 25 | |
| 26 | def add_common_arguments(parser): |
| 27 | add_root_argument(parser) |
Søren Gjesse | 3330db2 | 2017-09-13 13:53:11 +0200 | [diff] [blame] | 28 | parser.add_argument('--lunch', |
| 29 | help='Build menu. ' + |
| 30 | 'Defaults to ' + DEFAULT_LUNCH + '.', |
| 31 | default=DEFAULT_LUNCH) |
| 32 | |
| 33 | def run_through_aosp_helper(lunch, args, cwd): |
| 34 | args[0:0] = [AOSP_HELPER_SH, lunch] |
| 35 | check_call(args, cwd = cwd) |