Liking cljdoc? Tell your friends :D

license clojars

Library template

Intro

This Library template helps you to quick start new library project using clojure deps cli and clj-new.

This Library template provides:

  • project control using babashka tasks (v0.3.7+);

  • environment variables control and project configuration using project-config.edn file;

  • secrets & passwords control using project-secrets.edn file;

  • 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
build        Build deployable jar file for this project
bump         Bump version artifact in `project-version` file, level may be one of: major, minor, patch, alpha, beta, rc, release.
clean        Clean target folder
deploy       Deploy this library to Clojars
format       Format source code
install      Install deployable jar locally (requires the pom.xml file)
lint         Lint source code
outdated     Check for outdated dependencies
repl         Run Clojure repl
requirements Install project requirements
test         Run tests

See also:

Using Library template

New library project

Before creating a project from this template, please install prerequisites (see below). To create a project from this template just run:

    clojure -X:new :template org.rssys.libtemplate :name com.example/lib01
    cd lib01

where :new is alias in ~/.clojure/deps.edn file (see prerequisites below).

Please, see README.adoc in a root folder of created project to install other tools once.

Install prerequisites

All these tools you need to install only once.

  1. Install clojure deps cli tools

    1. MacOS

      brew install clojure/tools/clojure
    2. Linux

      Ensure that the following dependencies are installed in OS: bash, curl, rlwrap, and Java.

      curl -O https://download.clojure.org/install/linux-install-1.10.3.822.sh
      chmod +x linux-install-1.10.3.822.sh
      sudo ./linux-install-1.10.3.822.sh
  2. Install latest clj-new library to a file ~/.clojure/deps.edn

    {
     :aliases {
               :new     {:extra-deps {seancorfield/clj-new {:mvn/version "1.1.297"}}
                         :exec-fn    clj-new/create}
              }
    
     }
  3. Install babashka v0.3.7+

    1. MacOS

      brew install borkdude/brew/babashka
    2. Linux

      sudo bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)

License

Copyright © 2021 Mike Ananev
Distributed under the Eclipse Public License 2.0 or (at your option) any later version.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close