Skip to content

redstarssystems/libtemplate

Repository files navigation

Library project template

Intro

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:

Usage

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.

Install prerequisites

All these tools you need to install only once.

  1. Install clojure deps cli tools version 1.10.3.1069+

    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.1069.sh
      chmod +x linux-install-1.10.3.1069.sh
      sudo ./linux-install-1.10.3.1069.sh
  2. 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/

  3. Install babashka v0.4.0+

    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 1.0 or (at your option) any later version.

About

Library project template for Clojure

Resources

License

Stars

Watchers

Forks

Packages

No packages published