aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/push_to_android.py
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-01-05 12:20:41 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-05 19:04:30 +0000
commit7d92103f9ebed04c54f4ec8636f98dc0e4fc3056 (patch)
tree91c81ac9f9689821e774b3a85e53f8f5f4760dc1 /gn/push_to_android.py
parent90798529a02ffd0154c79d647717cf2e5b163158 (diff)
GN: add skia_android_serial and push_$foo targets when it's set
E.g. $ ninja -C out push_dm By default (ninja -C out) everything is built and pushed if skia_android_serial is set. Dependencies are tracked, so incremental builds push only executables that have changed. Change-Id: I586d81791f5f877b173cf61ed68fa9aab96234d2 Reviewed-on: https://skia-review.googlesource.com/6616 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn/push_to_android.py')
-rwxr-xr-xgn/push_to_android.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/gn/push_to_android.py b/gn/push_to_android.py
new file mode 100755
index 0000000000..b9ab36fa52
--- /dev/null
+++ b/gn/push_to_android.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import subprocess
+import sys
+
+host, serial, stamp = sys.argv[1:]
+device = '/data/local/tmp/' + os.path.basename(host)
+
+# adb push is verbose, so eat its output with check_output().
+subprocess.check_output(['adb', '-s', serial, 'push', host, device])
+subprocess.check_call(['adb', '-s', serial, 'shell', 'chmod', '+x', device])
+
+# Touch a file to let GN/Ninja know we succeeded.
+with open(stamp, 'w'):
+ pass