Søren Gjesse | 6d9e155 | 2017-09-13 12:41:45 +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 | |
Søren Gjesse | 6d9e155 | 2017-09-13 12:41:45 +0200 | [diff] [blame] | 6 | import argparse |
Søren Gjesse | 6d9e155 | 2017-09-13 12:41:45 +0200 | [diff] [blame] | 7 | import sys |
| 8 | |
| 9 | import utils |
Søren Gjesse | 3330db2 | 2017-09-13 13:53:11 +0200 | [diff] [blame] | 10 | import utils_aosp |
Søren Gjesse | 6d9e155 | 2017-09-13 12:41:45 +0200 | [diff] [blame] | 11 | |
| 12 | def parse_arguments(): |
| 13 | parser = argparse.ArgumentParser( |
| 14 | description = 'Checkout the AOSP source tree.') |
Søren Gjesse | 3330db2 | 2017-09-13 13:53:11 +0200 | [diff] [blame] | 15 | utils_aosp.add_common_arguments(parser) |
Søren Gjesse | 6d9e155 | 2017-09-13 12:41:45 +0200 | [diff] [blame] | 16 | return parser.parse_args() |
| 17 | |
| 18 | def emulator_aosp(aosp_root, lunch): |
Søren Gjesse | 3330db2 | 2017-09-13 13:53:11 +0200 | [diff] [blame] | 19 | print "Running AOSP emulator in " + aosp_root |
| 20 | |
| 21 | utils_aosp.run_through_aosp_helper(lunch, ['emulator_fg', |
| 22 | '-partition-size', '4096', '-wipe-data'], cwd = aosp_root) |
Søren Gjesse | 6d9e155 | 2017-09-13 12:41:45 +0200 | [diff] [blame] | 23 | |
| 24 | def Main(): |
| 25 | args = parse_arguments() |
| 26 | |
| 27 | emulator_aosp(args.aosp_root, args.lunch) |
| 28 | |
| 29 | if __name__ == '__main__': |
| 30 | sys.exit(Main()) |