Index: build/android/pylib/__init__.py |
diff --git a/build/android/pylib/__init__.py b/build/android/pylib/__init__.py |
index 727e987e6b621957ed56f20af1968525a9abadcf..b5491bc02e1544dcbfc26886cfc08888d4cb3ff0 100644 |
--- a/build/android/pylib/__init__.py |
+++ b/build/android/pylib/__init__.py |
@@ -2,3 +2,16 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+import os |
+ |
+if not os.environ.get('ANDROID_SDK_ROOT'): |
+ # If envsetup.sh hasn't been sourced and there's no adb in the path, |
+ # set it here. |
+ try: |
+ import subprocess |
tonyg
2013/05/23 17:10:05
This should be at the top of the file
bulach
2013/05/23 17:29:03
Done.
|
+ subprocess.call(['adb', 'version']) |
+ except OSError: |
+ os.environ['PATH'] += os.pathsep + os.path.abspath(os.path.join( |
+ os.path.dirname(__file__), |
+ '..', '..', '..', |
+ 'third_party', 'android_tools', 'sdk', 'platform-tools')) |