#+TITLE: Clojure/ClojureScript Boot literate programming template #+SETUPFILE: build/setup.org * Table of contents :noexport:TOC_4_org: - [[Introduction][Introduction]] - [[Quick start][Quick start]] - [[Project specification][Project specification]] - [[Dependencies][Dependencies]] - [[Environment and project requirements][Environment and project requirements]] - [["Library of Babel" helper code blocks library]["Library of Babel" helper code blocks library]] - [[Boot-project][Boot-project]] - [[Project code][Project code]] - [[Footnotes][Footnotes]] * Introduction #+INCLUDE: "README.org" :minlevel 2 * Quick start - *Git* clone from https://github.com/MaximGB/clojure-boot-literate.git. - Load project *Library of Babel*, by executing the following code block src_emacs-lisp[]{(org-babel-lob-ingest "build/lob.org")}, to execute it place the cursor on the block and press C-c C-c. - Fill in the table in the [[#project-specification][Project specification]] section. - Read the [[#env-requirements][Environment and project requirements]] section, setup your environment accordingly and create the code exporting scripts ~tangle.sh~ and ~tangle-all.sh~. - Export initial project code by runing src_sh[]{./tangle-all.sh}, place the cursor on the code block and press C-c C-c to execute it from *Emacs*, or run ~tangle-all.sh~ from a terminal. - Build the project with *Boot*: - For *Clojure* src_sh[]{boot clj-build}, place the cursor on the code block and press C-c C-c to execute it, or run ~boot clj-build~ from a terminal. - For *ClojureScript* src_sh[]{boot cljs-figwheel}, place the cursor on the code block and press C-c C-c to execute it, or run ~boot cljs-figwheel~ from a terminal. - Run the project by running src_sh[:dir "." :noweb yes]{java -jar <>/project.jar}, place the cursor on the code block and press C-c C-c, or run ~java jar target/project.jar~ from a terminal. - Keep working on the project export the code periodically. - To export the project documentation: - Into ~project.pdf~ press С-с С-e l p. - Into ~project.html~ press C-c C-e h h. * Project specification :PROPERTIES: :CUSTOM_ID: project-specification :END: Project specification is given in the table following. The project file system as well as ~boot.properties~ and ~build.boot~ files are generated according to the specification. #+CAPTION: Project specification #+NAME: project-specification | Property | Value | |-----------------------+------------------| | Boot | | |-----------------------+------------------| | Version | 2.6.0 | |-----------------------+------------------| | Project name | literate-boot | | Project version | 0.1.0-SNAPSHOT | | Org sources path | org | | Tests path | tests | | Resource path | resources | | Assets path | assets | | Target path | target | | Main namespace | core | |-----------------------+------------------| | Clojure | yes | |-----------------------+------------------| | Version | 1.8.0 | | Sources path | src | |-----------------------+------------------| | ClojureScript | yes | |-----------------------+------------------| | Version | 1.9.225 | | Sources path | src | | Public resources path | resources/public | |-----------------------+------------------| | Cider | | |-----------------------+------------------| | Version | 0.14.0 | ** Dependencies :PROPERTIES: :CUSTOM_ID: project-dependencies :END: Project dependencies are given in the *dependencies* table\\ One dependency per the table row should be given. The table columns correspond to options supported by [[https://github.com/cemerick/pomegranate][pomegranate]] library, which in it's turn, is used by *Boot* for dependecies resolution [fn:1]: * *Name* - artifact name * *Version* - artifact version * *Scope* - dependency scope (in Maven terms), mighe be one of: ~compile, provided, runtime, test, system, import~ * *Optional* - dependency optionality flag, any dependency having ~no~ or empty value in this column is considired to be optional * *Classifier* - dependency classifier (in Maven terms) * *Extension* - dependency extension (in Maven-terms) * *Exclusion* - transitive dependencies exclusions for the dependency, one exclusion per the table row is allowed if you need to setup several exclusions for one dependency than for second and other exclusions *name*, *version*, *scope*, *optional*, *classifier*, *extension* columns should be empty * *Classifier* - exclusion dependency classifier (in Maven terms) * *Extension* - exclusion dependency extension (in Maven-terms) * *Note* - this column is ignored, it's used for documentation purposes #+CAPTION: Dependencies #+ATTR_LATEX: :width \textwidth :align |l|r|r|c|r|r|l|r|r|l| :float nil #+NAME: project-dependencies | Name | Version | Scope | Optional | Classifier | Extension | Exclusion | Classifier | Extension | Note | |------+---------+-------+----------+------------+-----------+-----------+------------+-----------+------| * Environment and project requirements :PROPERTIES: :CUSTOM_ID: env-requirements :END: #+INCLUDE: "build/build.org" :minlevel 2 * "Library of Babel" helper code blocks library #+INCLUDE: "build/lob.org" :minlevel 2 * Boot-project #+INCLUDE: "build/boot.org" :minlevel 2 * Project code #+INCLUDE: "org/core.org" :minlevel 2 * Footnotes [fn:1] For the one interested please see the documentation for ~cemeric.pomegranate.aether/resolve-dependencies~ function