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 RELATED-FILES-FN)
Documentation
Return a project type plist with the provided arguments.
A project type is defined by PROJECT-TYPE, a set of MARKER-FILES,
and optional keyword arguments:
PROJECT-FILE the main project file in the root project directory. It may be a
single file or a list of possible files.
COMPILATION-DIR the directory to run the tests- and compilations in,
CONFIGURE which specifies a command that configures the project
%s in the command will be substituted with (projectile-project-root)
before the command is run,
COMPILE which specifies a command that builds the project,
INSTALL which specifies a command to install the project.
PACKAGE which specifies a command to package the project.
TEST which specifies a command that tests the project,
RUN which specifies a command that runs the project,
TEST-SUFFIX which specifies test file suffix, and
TEST-PREFIX which specifies test file prefix.
SRC-DIR which specifies the path to the source relative to the project root.
TEST-DIR which specifies the path to the tests relative to the project root.
RELATED-FILES-FN which specifies a custom function to find the related
files such as test/impl/other files as below:
CUSTOM-FUNCTION accepts FILE as relative path from the project root and
returns a plist containing :test, :impl or :other as key and the
relative path/paths or predicate as value. PREDICATE accepts a
relative path as the input.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260310.858/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 related-files-fn)
"Return a project type plist with the provided arguments.
A project type is defined by PROJECT-TYPE, a set of MARKER-FILES,
and optional keyword arguments:
PROJECT-FILE the main project file in the root project directory. It may be a
single file or a list of possible files.
COMPILATION-DIR the directory to run the tests- and compilations in,
CONFIGURE which specifies a command that configures the project
`%s' in the command will be substituted with (projectile-project-root)
before the command is run,
COMPILE which specifies a command that builds the project,
INSTALL which specifies a command to install the project.
PACKAGE which specifies a command to package the project.
TEST which specifies a command that tests the project,
RUN which specifies a command that runs the project,
TEST-SUFFIX which specifies test file suffix, and
TEST-PREFIX which specifies test file prefix.
SRC-DIR which specifies the path to the source relative to the project root.
TEST-DIR which specifies the path to the tests relative to the project root.
RELATED-FILES-FN which specifies a custom function to find the related
files such as test/impl/other files as below:
CUSTOM-FUNCTION accepts FILE as relative path from the project root and
returns a plist containing :test, :impl or :other as key and the
relative path/paths or predicate as value. PREDICATE accepts a
relative path as the input."
(let ((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 related-files-fn
(plist-put project-plist 'related-files-fn related-files-fn))
project-plist))