• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
6import gradle
7import os
8import subprocess
9import sys
10import utils
11
12JAR = os.path.join(utils.REPO_ROOT, 'build', 'libs', 'bisect.jar')
13
14def 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
24def 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
34if __name__ == '__main__':
35  sys.exit(main())
36