Function: projectile-register-project-type
projectile-register-project-type is a byte-compiled function defined
in projectile.el.
Signature
(projectile-register-project-type PROJECT-TYPE 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
Register a project type with projectile.
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-register-project-type
(project-type marker-files &key project-file compilation-dir configure compile install package test run test-suffix test-prefix src-dir test-dir related-files-fn)
"Register a project type with projectile.
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."
(setq projectile-project-types
(cons `(,project-type .
,(projectile--build-project-plist
marker-files
:project-file project-file
:compilation-dir compilation-dir
:configure configure
:compile compile
:install install
:package package
:test test
:run run
:test-suffix test-suffix
:test-prefix test-prefix
:src-dir src-dir
:test-dir test-dir
:related-files-fn related-files-fn))
projectile-project-types)))