This template
helps you to quick start new library project using clojure deps cli and deps-new.
This template
provides:
-
project control using babashka tasks;
-
building Clojure project using tools-build;
-
editor configuration via
.editorconfig
file; -
configured
clj-kondo
linter; -
configured
cljstyle
formatter; -
run tests using kaocha.
This template will give you the following basic project workflow:
mike@mbp02 ✗ bb tasks
The following tasks are available:
clean Clean target folder
build Build deployable jar file for this project
install Install deployable jar locally (requires the pom.xml file)
deploy Deploy this library to Clojars
test Run tests
repl Run Clojure repl
outdated Check for outdated dependencies
outdated:fix Check for outdated dependencies and fix
format Format source code
lint Lint source code
requirements Install project requirements
See also:
Before run this template ensure you have installed deps-new and babashka (see Install prerequisites ).
Example: to generate new library project for artifact com.example/lib01
run:
clojure -Sdeps '{:deps {org.rssys/libtemplate {:git/tag "0.1.3" :git/sha "905bf3e" :git/url "https://github.com/redstarssystems/libtemplate.git"}}}' -Tnew create :template org.rssys/libtemplate :name com.example/lib01
or clone this project and run from its folder:
clojure -Sdeps '{:deps {org.rssys/libtemplate {:local/root "."}}}' -Tnew create :template org.rssys/libtemplate :name com.example/lib01 :target-dir ../lib01
Note
|
Please, see README.adoc in a root folder of created project.
|
All these tools you need to install only once.
-
Install clojure deps cli tools version 1.10.3.1069+
-
MacOS
brew install clojure/tools/clojure
-
Linux
Ensure that the following dependencies are installed in OS:
bash
,curl
,rlwrap
, andJava
.curl -O https://download.clojure.org/install/linux-install-1.10.3.1069.sh chmod +x linux-install-1.10.3.1069.sh sudo ./linux-install-1.10.3.1069.sh
-
-
Install latest deps-new
clojure -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.4.9"}' :as new
Tool will be installed in
~/.gitlibs/libs/
-
Install babashka v0.4.0+
-
MacOS
brew install borkdude/brew/babashka
-
Linux
sudo bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)
-