Make gradle.py print an actual exception instead of complaining that
raise needs an exception when executing gradle.

Make {d8/r8/compatdx}.py not print python error on failure, but
instead print only tool output and exit with correct exit code.

Bug:
Change-Id: I3f95ab293467fb0893f8cc13d0ec6e15ca019097
diff --git a/tools/d8.py b/tools/d8.py
index 3eecf83..bf97845 100755
--- a/tools/d8.py
+++ b/tools/d8.py
@@ -36,7 +36,13 @@
       build = arg == "--build"
     else:
       args.append(arg)
-  run(args, build)
+  try:
+    run(args, build)
+  except subprocess.CalledProcessError as e:
+    # In case anything relevant was printed to stdout, normally this is already
+    # on stderr.
+    print(e.output)
+    return e.returncode
 
 if __name__ == '__main__':
   sys.exit(main())