Ian Zerny | 5fffb0a | 2019-02-11 13:54:22 +0100 | [diff] [blame] | 1 | #!/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 | |
| 6 | import jdk |
| 7 | import utils |
| 8 | import subprocess |
| 9 | import sys |
| 10 | |
| 11 | def run(args): |
| 12 | cmd = [jdk.GetJavacExecutable()] + args |
| 13 | utils.PrintCmd(cmd) |
| 14 | result = subprocess.check_output(cmd) |
| 15 | print result |
| 16 | return result |
| 17 | |
| 18 | def 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 | |
| 27 | if __name__ == '__main__': |
| 28 | sys.exit(main()) |