This repository was archived by the owner on Jan 25, 2023. It is now read-only.
feat: Cache Clojure dependencies #553
Closed
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.
This PR adds caching for repos built with the Clojure CLI tools. It extends 52f8eb9, which added initial support for building with the Clojure CLI tools, but did not address caching. It is similar to f3a4d49 which introduced caching for Leiningen and Boot, two other ways of building Clojure code.
This PR contains three commits. I'd like to see them all put into use, but the second one is certainly optional.
The first commit will significantly improve build times and decrease network bandwidth for Clojure repos. It does this by restoring the
.m2
directory before building, as otherJVM
based tools do.The second commit is less important. It has two parts.
.m2
directory before starting the build. Technically this is unnecessary. As opposed to a tool like, for example,bundler
, which expects to resolve and download dependencies before the "real" code is run, the Clojure CLI tools combine dependency management and code execution into one step. Therefore existing builds that use the Clojure CLI tools already populate.m2
. So, this change merely separates the steps, isolating errors that occur during download.The third commit caches the
~/.gitlibs
directory, which the Clojure CLI tools use to cache dependencies procured from git repos (as opposed to from package managers). This will improve build times and decrease network bandwidth for Clojure repos which use this type of dependency procurement.