build-image
build-image copied to clipboard
feat(caching): Cache clojure dependencies
Summary
Fixes #485.
Projects that contain a deps.edn file are compiled by the Clojure CLI. (This is analogous to a Gemfile, which signals that a project is built with ruby.)
This PR speeds up builds of these projects by caching their dependencies. The following directories are now cached:
.m2As a JVM language, most Clojure dependencies are stored in the global.m2directory..gitlibsThe Clojure CLI can also download dependencies directly from git repositories rather than from a package manager. It saves these downloads in the.gitlibsdirectory..cpcacheClojure uses the.cpcachedirectory to avoid unnecessarily re-calculating the JVM classpath. Caching this directory won't prevent downloads, but does improve build time slightly.
For us to review and ship your PR efficiently, please perform the following steps:
- [x] Open a bug/issue before writing your code ๐งโ๐ป. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire ๐ฅ (e.g. incident related), you can skip this step.
- [x] Read the contribution guidelines ๐. This ensures your code follows our style guide and passes our tests.
- ~Update or add tests (if any source code was changed or added) ๐งช~
- ~Update the included software doc (if you updated included software) ๐~
- ~Update or add documentation (if features were changed or added) ๐~
- [ ] Make sure the status checks below are successful โ