Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: samples/android/tools/build.py

Issue 11362103: Rotating spheres sample (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More cleanup Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: samples/android/tools/build.py
diff --git a/samples/android/tools/build.py b/samples/android/tools/build.py
new file mode 100755
index 0000000000000000000000000000000000000000..c7ded1b922cb7bf25c210b94d5250fcaed91a619
--- /dev/null
+++ b/samples/android/tools/build.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+#
+
+"""Build, install, and launch a sample Android application that uses Dart."""
+
+import os
+import platform
+import subprocess
+import sys
+
+SCRIPT_DIR = os.path.dirname(sys.argv[0])
+PROJECT_DIR = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
+DART_ROOT = os.path.realpath(os.path.join(PROJECT_DIR, '../..'))
+THIRD_PARTY_ROOT = os.path.join(DART_ROOT, 'third_party')
+ADB = os.path.join(THIRD_PARTY_ROOT, 'android_tools/sdk/platform-tools/adb')
+
+def Main():
+ if platform.system() != "Linux":
+ sys.stderr.write("Android Dart support currently only builds on Linux.\n")
+ return -1
+ os.chdir(DART_ROOT)
+ subprocess.check_call(
+ ["tools/build.py", "--os=android", "-m", "release", "samples"])
+ os.chdir(PROJECT_DIR)
+ subprocess.check_call(
+ [ADB, "install", "-r", "bin/DartActivity-debug.apk"])
+ subprocess.check_call(
+ [ADB, "shell", "am", "start", "-n",
+ "org.dartlang.example.dart/org.dartlang.example.dart.DartActivity"])
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(Main())
« no previous file with comments | « samples/android/src/org/dartlang/example/dart/DartActivity.java ('k') | samples/sample_extension/sample_extension.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698