Function: projectile--build-project-plist
projectile--build-project-plist is a byte-compiled function defined in
projectile.el.
Signature
(projectile--build-project-plist MARKER-FILES &key PROJECT-FILE COMPILATION-DIR CONFIGURE COMPILE INSTALL PACKAGE TEST RUN TEST-SUFFIX TEST-PREFIX SRC-DIR TEST-DIR SRC-EXTENSION TEST-EXTENSION RELATED-FILES-FN FILE-KINDS TASKS)
Documentation
Return a project type plist built from MARKER-FILES and the keyword arguments.
This is the shape a registered project type takes; the arguments, and what
each of them means, are documented on projectile-register-project-type,
which is the entry point users call and where the description belongs.
Both take the same keywords, so keeping a second copy here only bought two
descriptions that could disagree - and by the time this was written, they
already did.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(cl-defun projectile--build-project-plist
(marker-files &key project-file compilation-dir configure compile install package test run test-suffix test-prefix src-dir test-dir src-extension test-extension related-files-fn file-kinds tasks)
"Return a project type plist built from MARKER-FILES and the keyword arguments.
This is the shape a registered project type takes; the arguments, and what
each of them means, are documented on `projectile-register-project-type',
which is the entry point users call and where the description belongs.
Both take the same keywords, so keeping a second copy here only bought two
descriptions that could disagree - and by the time this was written, they
already did."
;; When PROJECT-FILE isn't given explicitly, derive it from the first
;; marker file - that's the project's primary manifest in every
;; file-based registration, so callers needn't repeat it. Function
;; markers (a symbol or lambda) have no list to derive from. Passing
;; the symbol `none' opts out of both the derivation and the root-file
;; seeding below, for types (e.g. bloop) whose only marker also shows
;; up outside real projects and so must not anchor a project root.
(let* ((project-file
(cond ((eq project-file 'none) nil)
;; An alternatives clause is a marker shape, so accept it
;; here too and keep the plain list of names the rest of
;; the code expects.
((projectile--any-marker-p project-file) (cdr project-file))
(project-file project-file)
;; Otherwise the first marker position is the project file -
;; all of its alternatives, so each can anchor a root.
(t (let ((first (car (projectile--marker-clauses marker-files))))
(cond ((null first) nil)
((cdr first) first)
((stringp (car first)) (car first)))))))
(project-plist (list 'marker-files marker-files
'project-file project-file
'compilation-dir compilation-dir
'configure-command configure
'compile-command compile
'test-command test
'install-command install
'package-command package
'run-command run))
(project-files (if (listp project-file)
project-file
(list project-file))))
(dolist (project-file project-files)
(when (and project-file (not (member project-file projectile-project-root-files)))
(add-to-list 'projectile-project-root-files project-file)))
(when test-suffix
(plist-put project-plist 'test-suffix test-suffix))
(when test-prefix
(plist-put project-plist 'test-prefix test-prefix))
(when src-dir
(plist-put project-plist 'src-dir src-dir))
(when test-dir
(plist-put project-plist 'test-dir test-dir))
(when src-extension
(plist-put project-plist 'src-extension src-extension))
(when test-extension
(plist-put project-plist 'test-extension test-extension))
(when related-files-fn
(plist-put project-plist 'related-files-fn related-files-fn))
(when file-kinds
(plist-put project-plist 'file-kinds file-kinds))
(when tasks
(plist-put project-plist 'tasks tasks))
project-plist))