Lines Matching defs:android
0 ;;; android-common.el --- Common functions/variables to dev Android in Emacs.
3 ;; Copyright (C) 2009 The Android Open Source Project
19 ;; Variables to customize and common functions for the Android build
26 ;; need to add a mapping in `android-product-alias-map'. For instance
33 (defgroup android nil
34 "Support for android development in Emacs."
35 :prefix "android-" ; Currently unused.
36 :tag "Android"
40 (defcustom android-compilation-jobs 2
43 :group 'android)
46 (defcustom android-compilation-no-buildenv-warning t
51 :group 'android)
54 (defcustom android-product-alias-map nil
56 product build directory used by `android-product'.
62 :group 'android)
64 (defconst android-output-buffer-name "*Android Output*"
68 (defun android-find-build-tree-root ()
69 "Ascend the current path until the root of the android build tree is found.
84 (error "Not in a valid android tree"))))
86 (defun android-project-p ()
87 "Return nil if not in an android build tree."
89 (android-find-build-tree-root)
92 (defun android-host ()
102 (defun android-product ()
106 Additional product aliases can be listed in `android-product-alias-map'
110 (let* ((buildspec (concat (android-find-build-tree-root) "buildspec.mk"))
116 (alias (assoc product android-product-alias-map)))
122 (defun android-product-path ()
125 Additional product aliases can be added in `android-product-alias-map'
128 (let ((path (concat (android-find-build-tree-root) "out/target/product/"
129 (android-product))))
132 add an entry to android-product-map." path (android-product))))
135 (defun android-find-host-bin (binary)
140 (if (android-project-p)
141 (let ((path (concat (android-find-build-tree-root) "out/host/"
142 (android-host) "/bin/" binary)))
148 (defun android-adb ()
151 (android-find-host-bin "adb"))
153 (defun android-fastboot ()
158 (concat (android-find-host-bin "fastboot") " -p " (android-product)))
160 (defun android-adb-command (command &optional product)
162 If the optional PRODUCT is not nil, -p (android-product-path) is used
164 (when (get-buffer android-output-buffer-name)
165 (with-current-buffer android-output-buffer-name
168 (shell-command (concat (android-adb) " -p " (android-product-path)
170 android-output-buffer-name)
171 (shell-command (concat (android-adb) " " command)
172 android-output-buffer-name)))
174 (defun android-adb-shell-command (command)
176 (android-adb-command (concat " shell " command)
177 android-output-buffer-name))
179 (provide 'android-common)
181 ;;; android-common.el ends here