Skip to content
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

Merged
merged 5 commits into from
Oct 15, 2024

Conversation

DCardenasAmp
Copy link
Contributor

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.

@DCardenasAmp DCardenasAmp requested a review from a team August 20, 2024 23:34
src/lein_monolith/config.clj Show resolved Hide resolved
.circleci/config.yml Show resolved Hide resolved
Copy link
Collaborator

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.

Copy link
Contributor Author

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

@DCardenasAmp DCardenasAmp requested a review from greglook August 26, 2024 20:57
Copy link
Collaborator

@greglook greglook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

test/lein_monolith/task/each_test.clj Outdated Show resolved Hide resolved
test/lein_monolith/task/each_test.clj Outdated Show resolved Hide resolved
Copy link
Collaborator

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!

@DCardenasAmp DCardenasAmp merged commit 4563afd into main Oct 15, 2024
4 checks passed
@DCardenasAmp DCardenasAmp deleted the dcardenas-absolute-clean-targets branch October 15, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants