blob: 0d8ac0504187343e4faa9c69fac88b2ab688020d [file] [log] [blame]
Ian Zerny5fffb0a2019-02-11 13:54:22 +01001#!/usr/bin/env python
2# Copyright (c) 2019, 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 jdk
7import utils
8import subprocess
9import sys
10
11def run(args):
12 cmd = [jdk.GetJavacExecutable()] + args
13 utils.PrintCmd(cmd)
14 result = subprocess.check_output(cmd)
15 print result
16 return result
17
18def main():
19 try:
20 run(sys.argv[1:])
21 except subprocess.CalledProcessError as e:
22 # In case anything relevant was printed to stdout, normally this is already
23 # on stderr.
24 print e.output
25 return e.returncode
26
27if __name__ == '__main__':
28 sys.exit(main())