Lines Matching defs:android
0 ;;; android-compile.el --- Compile the Android source tree.
3 ;; Copyright (C) 2009 The Android Open Source Project
19 ;; Helper functions to compile Android file within emacs.
25 ;; The only interactive function is 'android-compile'.
26 ;; In your .emacs load this file (e.g (require 'android-compile)) then:
28 ;; (add-hook 'c++-mode-hook 'android-compile)
29 ;; (add-hook 'java-mode-hook 'android-compile)
31 ;; (global-set-key [f9] 'android-compile)
40 (require 'android-common)
43 (defvar android-compile-ignore-re
47 suppressed if `android-compilation-no-buildenv-warning' is non nil.")
49 (defun android-makefile-exists-p (directory)
50 "Return t if an Android makefile exists in DIRECTORY."
51 ; Test for Android.mk first: more likely.
52 (or (file-exists-p (concat directory "Android.mk"))
55 (defun android-find-makefile (topdir)
56 "Ascend the current path until an Android makefile is found.
57 Makefiles are named Android.mk except in the root directory where
70 (not (android-makefile-exists-p default-directory)))
75 (when (not (android-makefile-exists-p default-directory))
76 (error "Not in a valid android tree"))
82 (setq file (concat default-directory "Android.mk"))
90 ;; We store in a buffer local variable `android-compile-context' a
96 (defun android-compile-filter ()
102 Has effect only if `android-compilation-no-buildenv-warning' is
107 (when android-compilation-no-buildenv-warning
109 ;; Check if android-compile-context does not exist or if the
112 (unless (and (local-variable-p 'android-compile-context)
113 (eq proc (cadr android-compile-context)))
114 (setq android-compile-context (list (point-min) proc))
115 (make-local-variable 'android-compile-context)))
117 (let ((beg (car android-compile-context))
129 (while (search-forward-regexp android-compile-ignore-re end t)
135 (setcar android-compile-context (point)))))
137 (defun android-compile ()
142 Use `android-compilation-jobs' to control the number of jobs used
145 (if (android-project-p)
146 (let* ((topdir (android-find-build-tree-root))
147 (makefile (android-find-makefile topdir))
149 (concat " -j " (number-to-string android-compilation-jobs))))
154 (add-hook 'compilation-filter-hook 'android-compile-filter)
164 (provide 'android-compile)
166 ;;; android-compile.el ends here