Specifying this matcher object will allow EDE to perform a complex
check without loading the project.
-NOTE: If you use dirmatch, you may need to set :root-only to nil.
+NOTE: If you use dirmatch, you may need to set :root-only to `nil'.
While it may be a root based project, all subdirs will happen to return
-true for the dirmatch, so for scanning purposes, set it to nil.")
+true for the dirmatch, so for scanning purposes, set it to `nil'.")
(proj-root :initarg :proj-root
:type function
:documentation "A function symbol to call for the project root.
(defvar ede-project-class-files
(list
- (ede-project-autoload "edeproject-makefile"
- :name "Make" :file 'ede/proj
+ (ede-project-autoload :name "Make" :file 'ede/proj
:proj-file "Project.ede"
:root-only nil
:load-type 'ede-proj-load
:class-sym 'ede-proj-project
:safe-p nil)
- (ede-project-autoload "edeproject-automake"
- :name "Automake" :file 'ede/proj
+ (ede-project-autoload :name "Automake" :file 'ede/proj
:proj-file "Project.ede"
:root-only nil
:initializers '(:makefile-type Makefile.am)
:load-type 'ede-proj-load
:class-sym 'ede-proj-project
:safe-p nil)
- (ede-project-autoload "automake"
- :name "automake" :file 'ede/project-am
+ (ede-project-autoload :name "automake" :file 'ede/project-am
:proj-file "Makefile.am"
:root-only nil
:load-type 'project-am-load
(put 'ede-project-class-files 'risky-local-variable t)
+(defun ede-show-supported-projects ()
+ "Display all the project types registered with EDE."
+ (interactive)
+ (let ((b (get-buffer-create "*EDE Autodetect Projects*")))
+ (set-buffer b)
+ (setq buffer-read-only nil)
+ (erase-buffer)
+ (dolist (prj ede-project-class-files)
+ (insert (oref prj name))
+ (newline))
+ (display-buffer b)
+ ))
+
(defun ede-add-project-autoload (projauto &optional flag)
"Add PROJAUTO, an EDE autoload definition to `ede-project-class-files'.
Optional argument FLAG indicates how this autoload should be
front of the list so more generic projects don't get priority."
;; First, can we identify PROJAUTO as already in the list? If so, replace.
(let ((projlist ede-project-class-files)
- (projname (eieio-object-name-string projauto)))
- (while (and projlist (not (string= (eieio-object-name-string (car projlist)) projname)))
+ (projname (oref projauto name)))
+ (while (and projlist (not (string= (oref (car projlist) name) projname)))
(setq projlist (cdr projlist)))
(if projlist
NOTE: Do not call this - it should only be called from `ede-load-project-file'."
;; Last line of defense: don't load unsafe projects.
- (when (not (or (oref this :safe-p)
+ (when (not (or (oref this safe-p)
(ede-directory-safe-p dir)))
(error "Attempt to load an unsafe project (bug elsewhere in EDE)"))
;; Things are good - so load the project.
;; The ede-generic-target-c-cpp has some example methods setting up
;; the pre-processor map and system include path.
;;
-;; NOTE: It is not necessary to modify ede-generic.el to add any of
+;; NOTE: It is not necessary to modify ede/generic.el to add any of
;; the above described support features.
(require 'eieio-opt)
(let* ((alobj ede-constructing))
(when (not alobj) (error "Cannot load generic project without the autoload instance"))
;;;
- ;; TODO - find the root dir.
+ ;; TODO - find the root dir.
(let ((rootdir dir))
(funcall (oref alobj class-sym)
(symbol-name (oref alobj class-sym))
:name (file-name-nondirectory (directory-file-name dir))
:version "1.0"
:directory (file-name-as-directory rootdir)
- :file (expand-file-name (oref alobj :proj-file)
+ :file (expand-file-name (oref alobj proj-file)
rootdir)))
))
(let ((match nil))
(dolist (T targets)
(when (and (object-of-class-p T class)
- (string= (oref T :path) dir))
+ (string= (oref T path) dir))
(setq match T)
))
match))
(when (not ans)
(setq ans (make-instance
cls
- :name (oref cls shortname)
+ :name (oref-default cls shortname)
:path dir
:source nil))
(object-add-to-list proj :targets ans)
;;
;; Derived projects need an autoloader so that EDE can find the
;; different projects on disk.
-(defun ede-generic-new-autoloader (internal-name external-name
- projectfile class)
+(defun ede-generic-new-autoloader (_internal-name external-name
+ projectfile class)
"Add a new EDE Autoload instance for identifying a generic project.
-INTERNAL-NAME is a long name that identifies this project type.
-EXTERNAL-NAME is a shorter human readable name to describe the project.
+INTERNAL-NAME is obsolete and ignored.
+EXTERNAL-NAME is a human readable name to describe the project; it
+must be unique among all autoloaded projects.
PROJECTFILE is a file name that identifies a project of this type to EDE, such as
a Makefile, or SConstruct file.
CLASS is the EIEIO class that is used to track this project. It should subclass
-the class `ede-generic-project' project."
+`ede-generic-project'."
(ede-add-project-autoload
- (ede-project-autoload internal-name
- :name external-name
+ (ede-project-autoload :name external-name
:file 'ede/generic
:proj-file projectfile
:root-only nil
(defun ede-enable-generic-projects ()
"Enable generic project loaders."
(interactive)
- (ede-generic-new-autoloader "generic-makefile" "Make"
+ (ede-generic-new-autoloader "generic-makefile" "Generic Make"
"Makefile" 'ede-generic-makefile-project)
- (ede-generic-new-autoloader "generic-scons" "SCons"
+ (ede-generic-new-autoloader "generic-scons" "Generic SCons"
"SConstruct" 'ede-generic-scons-project)
- (ede-generic-new-autoloader "generic-cmake" "CMake"
+ (ede-generic-new-autoloader "generic-cmake" "Generic CMake"
"CMakeLists" 'ede-generic-cmake-project)
;; Super Generic found via revision control tags.
- (ede-generic-new-autoloader "generic-git" "Git"
+ (ede-generic-new-autoloader "generic-git" "Generic Git"
".git" 'ede-generic-vc-project)
- (ede-generic-new-autoloader "generic-bzr" "Bazaar"
+ (ede-generic-new-autoloader "generic-bzr" "Generic Bazaar"
".bzr" 'ede-generic-vc-project)
- (ede-generic-new-autoloader "generic-hg" "Mercurial"
+ (ede-generic-new-autoloader "generic-hg" "Generic Mercurial"
".hg" 'ede-generic-vc-project)
- (ede-generic-new-autoloader "generic-svn" "Subversions"
+ (ede-generic-new-autoloader "generic-svn" "Generic Subversions"
".svn" 'ede-generic-vc-project)
- (ede-generic-new-autoloader "generic-cvs" "CVS"
+ (ede-generic-new-autoloader "generic-cvs" "Generic CVS"
"CVS" 'ede-generic-vc-project)
;; Take advantage of existing 'projectile' based projects.
;; @TODO - if projectile supports compile commands etc, can we
;; read that out? Howto if projectile is not part of core emacs.
- (ede-generic-new-autoloader "generic-projectile" ".projectile"
+ (ede-generic-new-autoloader "generic-projectile" "Generic .projectile"
".projectile" 'ede-generic-vc-project)
)