Mads Ager | 418d1ca | 2017-05-22 09:35:49 +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 | import gradle |
| 7 | import os |
| 8 | import subprocess |
| 9 | import sys |
| 10 | import utils |
| 11 | |
| 12 | JAR = os.path.join(utils.REPO_ROOT, 'build', 'libs', 'bisect.jar') |
| 13 | |
| 14 | def run(args, build, debug): |
| 15 | if build: |
| 16 | gradle.RunGradle(['bisect']) |
| 17 | cmd = ['java'] |
| 18 | if debug: |
| 19 | cmd.append('-ea') |
| 20 | cmd.extend(['-jar', JAR]) |
| 21 | cmd.extend(args) |
| 22 | subprocess.check_call(cmd) |
| 23 | |
| 24 | def main(): |
| 25 | build = True |
| 26 | args = [] |
| 27 | for arg in sys.argv[1:]: |
| 28 | if arg in ("--build", "--no-build"): |
| 29 | build = arg == "--build" |
| 30 | else: |
| 31 | args.append(arg) |
| 32 | run(args, build, True) |
| 33 | |
| 34 | if __name__ == '__main__': |
| 35 | sys.exit(main()) |