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

Implement higher-order task with-dependency-set #97

Merged
merged 26 commits into from
May 28, 2024

Conversation

scgerkin
Copy link
Contributor

@scgerkin scgerkin commented May 23, 2024

This PR adds a new higher-order task with-dependency-set. This works by sitting between the project evaluation and task execution, overriding values in the project.clj, and then re-running project evaluation before passing along the task. Specifically, it will override the :managed-dependencies for a root project or simply add/modify the :monolith/dependency-set for a subproject.

This allows, for instance, using dependency scanners such as antq or lein-ancient to check for outdated dependencies in a dependency set.

It can also be used to perform tests, builds, etc. by overriding the dependency set used.

Unit tests are added to verify the project structure matches the provided project other than the changes required for dependency resolution. I also performed some local testing using pprint and antq to verify the behavior is as expected.

This also includes a change to how dependency sets are evaluated when declared in a subproject. The :managed-dependencies will now be replaced with the dependency set rather than merged

@scgerkin scgerkin marked this pull request as ready for review May 23, 2024 21:48
@scgerkin scgerkin requested review from greglook, a team and DCardenasAmp May 23, 2024 21:49
.gitignore Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
project.clj Outdated Show resolved Hide resolved
example/apps/app-a/set-a.edn Outdated Show resolved Hide resolved
src/lein_monolith/task/with_dependency_set.clj Outdated Show resolved Hide resolved
src/lein_monolith/task/with_dependency_set.clj Outdated Show resolved Hide resolved
src/lein_monolith/task/with_dependency_set.clj Outdated Show resolved Hide resolved
src/leiningen/monolith.clj Outdated Show resolved Hide resolved
src/leiningen/monolith.clj Outdated Show resolved Hide resolved
src/leiningen/monolith.clj Outdated Show resolved Hide resolved
@scgerkin scgerkin requested a review from greglook May 24, 2024 18:12
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.

Looking quite clean now! Took another pass, should be good after this.

doc/config.md Outdated Show resolved Hide resolved
src/lein_monolith/plugin.clj Outdated Show resolved Hide resolved
src/lein_monolith/task/with_dependency_set.clj Outdated Show resolved Hide resolved
src/leiningen/monolith.clj Outdated Show resolved Hide resolved
src/leiningen/monolith.clj Outdated Show resolved Hide resolved
src/leiningen/monolith.clj Show resolved Hide resolved
test/lein_monolith/plugin_test.clj Outdated Show resolved Hide resolved
test/lein_monolith/task/with_dependency_set_test.clj Outdated Show resolved Hide resolved
@scgerkin scgerkin requested a review from greglook May 28, 2024 19:59
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:

@scgerkin scgerkin merged commit 0653818 into main May 28, 2024
4 checks passed
@scgerkin scgerkin deleted the scgerkin/implement-with-dep-sets-task branch May 28, 2024 20:23
@scgerkin scgerkin mentioned this pull request Jun 3, 2024
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