blob: e8b0ffb0e67f57baf87e68486726477c16961b9d [file] [log] [blame]
Ian Zernydcb172e2022-02-22 15:36:45 +01001#!/usr/bin/env python3
Søren Gjesse3330db22017-09-13 13:53:11 +02002# 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
Søren Gjesse3330db22017-09-13 13:53:11 +02006from os.path import join
7from subprocess import check_call
8
9import os
10
11import utils
12
13AOSP_HELPER_SH = join(utils.REPO_ROOT, 'scripts', 'aosp_helper.sh')
14
15DEFAULT_LUNCH = 'aosp_x86-eng'
16
17DEFAULT_ROOT = join(utils.REPO_ROOT, 'build', 'aosp')
18
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020019
Søren Gjesse9bfed012017-09-15 08:15:44 +020020def add_root_argument(parser):
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020021 parser.add_argument('--aosp-root',
22 help='Root of the AOSP checkout. ' + 'Defaults to ' +
23 DEFAULT_ROOT + '.',
24 default=DEFAULT_ROOT)
25
Søren Gjesse9bfed012017-09-15 08:15:44 +020026
27def add_common_arguments(parser):
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020028 add_root_argument(parser)
29 parser.add_argument('--lunch',
30 help='Build menu. ' + 'Defaults to ' + DEFAULT_LUNCH +
31 '.',
32 default=DEFAULT_LUNCH)
33
Søren Gjesse3330db22017-09-13 13:53:11 +020034
35def run_through_aosp_helper(lunch, args, cwd):
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020036 args[0:0] = [AOSP_HELPER_SH, lunch]
37 check_call(args, cwd=cwd)