blob: 3e2a715c67a84d721b8505f83d36e853532ece62 [file] [log] [blame]
Søren Gjesse3330db22017-09-13 13:53:11 +02001#!/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
7from os.path import join
8from subprocess import check_call
9
10import os
11
12import utils
13
14AOSP_HELPER_SH = join(utils.REPO_ROOT, 'scripts', 'aosp_helper.sh')
15
16DEFAULT_LUNCH = 'aosp_x86-eng'
17
18DEFAULT_ROOT = join(utils.REPO_ROOT, 'build', 'aosp')
19
Søren Gjesse9bfed012017-09-15 08:15:44 +020020def add_root_argument(parser):
Søren Gjesse3330db22017-09-13 13:53:11 +020021 parser.add_argument('--aosp-root',
22 help='Root of the AOSP checkout. ' +
23 'Defaults to ' + DEFAULT_ROOT +'.',
24 default=DEFAULT_ROOT)
Søren Gjesse9bfed012017-09-15 08:15:44 +020025
26def add_common_arguments(parser):
27 add_root_argument(parser)
Søren Gjesse3330db22017-09-13 13:53:11 +020028 parser.add_argument('--lunch',
29 help='Build menu. ' +
30 'Defaults to ' + DEFAULT_LUNCH + '.',
31 default=DEFAULT_LUNCH)
32
33def run_through_aosp_helper(lunch, args, cwd):
34 args[0:0] = [AOSP_HELPER_SH, lunch]
35 check_call(args, cwd = cwd)