-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update subproject clean targets with absolute paths #99
Conversation
test/lein_monolith/config_test.clj
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I initially thought the test would be checking that lein monolith each clean
would remove the correct local directory in the example project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add that, I was biased toward testing the immediate change initially
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of a script-level example test but this is better!
When running a command like
lein monolith each do clean, install
, any subprojects that provide relative paths for their clean targets will clean from the working directory that lein monolith was called from, instead of the root of the subproject (see technomancy/leiningen#2707). Leiningen seems to handle relative paths for other config values like target path and source path, but seems like clean targets is the odd one out.We can work around this issue by prepending the clean target paths with the root of the subproject as we're loading the project maps, which seems ok enough to me.
Tested this by adding a unit test, and also confirmed that
lein monolith each clean
cleans the right directories after this change.