-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This sub-task can be used to check arbitrary list of artifacts provided via stdin. The check-stdin sub-task will be used as default sub-task if stdin is available. The rationale is to reuse version checking machinery of lein-ancient while allowing more flexible control of input artifacts. Unfortunately lein-ancient as of 0.6.10 does not evaluate leiningen's project.clj file. It uses its own way how to read project.clj and interpret it. Probably due to optional rewriting functionality which needs to understand the project as data. Consider this example: ``` (def some-lib-version 1.2.3) (defproject my-project "X.Y.Z-SNAPSHOT" ... :dependencies [... [some-company/some-lib ~some-lib-version] ...] ... ``` This is a valid leiningen project which evaluates `some-company/some-lib`dependency as version `1.2.3`. Unfortunately lein-ancient silently skips such artifact check because it sees "~some-lib-version" which is not a valid version string. Of course the code can be arbitrarily complex so it would not be a good solution to teach lein-ancient to somehow handle this specific case. With check-stdin task we can use `lein pprint` to extract evaluated parts of project.clj and pass it into lein-ancient for checking only. ``` lein pprint :dependencies | lein ancient ``` Also note that some future release of lein pprint will support arbitrary get-in paths[1], so that it will be convenient to extract multiple lists from different parts of project.clj at once. The check-stdin is prepared for this and is able to read multiple EDN forms from input and concatenate them into one list. Also lein pprint supports with-profiles so it is flexible enough to extract list evaluated in the context of selected profile(s). [1] technomancy/leiningen@c63301a
- Loading branch information
Showing
4 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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