| 1 | from __future__ import absolute_import, print_function, unicode_literals |
| 2 | |
| 3 | import os |
| 4 | import pipes |
| 5 | import shutil |
| 6 | import subprocess |
| 7 | import sys |
| 8 | |
| 9 | args = [os.environ['RUST_ANDROID_GRADLE_CC'], os.environ['RUST_ANDROID_GRADLE_CC_LINK_ARG']] + sys.argv[1:] |
| 10 | |
| 11 | # This only appears when the subprocess call fails, but it's helpful then. |
| 12 | printable_cmd = ' '.join(pipes.quote(arg) for arg in args) |
| 13 | print(printable_cmd) |
| 14 | |
| 15 | code = subprocess.call(args) |
| 16 | if code == 0: |
| 17 | shutil.copyfile(sys.argv[sys.argv.index('-o') + 1], os.environ['RUST_ANDROID_GRADLE_TARGET']) |
| 18 | sys.exit(code) |
| 19 | |