Function: projectile--define-subproject-commands
projectile--define-subproject-commands is a macro defined in
projectile.el.
Signature
(projectile--define-subproject-commands &rest PHASES)
Documentation
Define a subproject variant of the lifecycle command of each of PHASES.
Each variant runs the phase command in the nearest subproject rather than
at the project root; see projectile--run-subproject-phase.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defmacro projectile--define-subproject-commands (&rest phases)
"Define a subproject variant of the lifecycle command of each of PHASES.
Each variant runs the phase command in the nearest subproject rather than
at the project root; see `projectile--run-subproject-phase'."
`(progn
,@(mapcar
(lambda (phase)
(let ((name (intern (format "projectile-%s-subproject" phase))))
`(defun ,name (arg)
,(format "Run the %s command of the project in the nearest subproject.
Find the closest project manifest (e.g. pom.xml, Cargo.toml) between the
current directory and the project root, and run the command there instead
of over the whole repository. In a monorepo that is the module being
worked on. The command itself is unchanged - only the directory it runs
in - so a project type that builds in a subdirectory (Meson in `build',
say) still does, relative to the subproject.
Normally you will be prompted for the command, unless variable
`compilation-read-command'. You can force the prompt with a prefix ARG."
phase)
(interactive "P")
(projectile--run-subproject-phase ',phase arg))))
phases)))