redstarssystems / apptemplate

Application project template for Clojure
Eclipse Public License 1.0
34 stars 0 forks source link

== Application project template :Author: Mike Ananev :Date: 30/01/2022 :git: https://git-scm.com[git] :clojure-deps-cli: https://clojure.org/guides/getting_started[clojure deps cli] :tools-build: https://clojure.org/guides/tools_build[tools-build] :deps-new: https://github.com/seancorfield/deps-new[deps-new] :build-clj: https://github.com/seancorfield/build-clj[build-clj] :babashka: https://github.com/babashka/babashka[babashka] :toc:

=== Intro

This template helps you to quick start new app project using {clojure-deps-cli} and {deps-new}.

This template provides:

This template will give you the following basic project workflow: [source, bash]

mike@mbp02 ✗ bb tasks The following tasks are available:

clean Clean target folder build Build standalone executable uberjar file run Run application (-main function) install Install this app deploy Deploy this app test Run project 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 javac Compile java sources standalone Create a standalone application with bundled JDK (using jlink, JDK 9+) requirements Install project requirements

See also:

== Usage

Before run this template ensure you have installed {deps-new} and {babashka} (see <> ). +

Example: to generate new app project for artifact com.example/app01 run:

[source, bash]

clojure -Sdeps '{:deps {org.rssys/apptemplate {:git/tag "0.1.1" :git/sha "215be27" :git/url "https://github.com/redstarssystems/apptemplate.git"}}}' -Tnew create :template org.rssys/apptemplate :name com.example/app01


or clone this project and run from its folder:

[source, bash]

clojure -Sdeps '{:deps {org.rssys/apptemplate {:local/root "."}}}' -Tnew create :template org.rssys/apptemplate :name com.example/app01 :target-dir ../app01


NOTE: Please, see README.adoc in a root folder of created project.

To configure project workflow use scripts: tasks/src/*, bb.edn and build.clj.

IMPORTANT: tasks/src/* only for Babashka tasks code. + bb.edn file should be as minimal as possible.

[#install-prerequisites] === Install prerequisites

All these tools you need to install only once.

. Install {clojure-deps-cli} tools version 1.10.3.1069+ .. MacOS + [source,bash]

brew install clojure/tools/clojure

.. Linux + Ensure that the following dependencies are installed in OS: bash, curl, rlwrap, and Java. + [source, bash]

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} + [source,bash]

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 + [source, bash]

brew install borkdude/brew/babashka

+ .. Linux + [source, bash]

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

== License

Copyright © 2021 {Author} + Distributed under the Eclipse Public License 1.0 or (at your option) any later version.