Run subproject commands in the type's compilation directory#2123
Merged
Conversation
The subproject commands replaced projectile-project-compilation-dir with the subproject's path, which discarded whatever the project type (or the user's dir-locals) had put there: in a Meson monorepo compiling a subproject ran ninja in sub/ rather than sub/build/. The subproject is now the directory the compilation directory is resolved against, which projectile-compilation-dir takes as an argument and the lifecycle runner threads through to the command it runs. That also makes the remaining three variants free, so configure, install and package join compile, test and run, and the prompt can say which subproject it is about to build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2121, from its review.
The subproject commands passed the subproject down by let-binding
projectile-project-compilation-dirto it, which replaces rather thancomposes - so whatever the project type (or your
.dir-locals.el) had putthere was discarded. In a Meson monorepo
projectile-compile-subprojectranninja in
sub/instead ofsub/build/, which is the one case the featureexists for.
The subproject is now the directory the compilation directory is resolved
against:
projectile-compilation-dirtakes it as an optional argument, and thelifecycle runner threads the result through to
projectile--run-project-cmdinstead of that function recomputing it - so the command that gets looked up
and the directory it runs in can't diverge.
Doing it that way makes the remaining variants free, so
configure,installand
packagejoin compile, test and run (s-p c m o,s-p c m i,s-p c m p), generated from the lifecycle phase table rather than hand-written.The prompt now also says where the command will run -
Test command in services/api/:- since nothing else distinguished a subproject build from awhole-project one.