I’ve been learning some Clojure, and I currently have a single .clj file which I edit in a text editor and which I execute on the command line.
Where can I find a guide on the practical aspects of scaling this up to larger programs/libraries?
- How should I lay out multiple
.cljfiles on the filesystem? - How should I organize and execute test code?
- How should I document the program/library?
- How should I package it?
I’m looking for information on the practical aspects on scaling up from small scripts to something real.
I recommend using leiningen. Running
will create a new folder called
myprojectinside your current working directory with a default skeleton structure.Inside the newly generated
myprojectfolder you’ll find (among others) a folder namedsrcfor clojure source code and a folder namedtestfor your tests (leiningen will generate a default failing test).Leiningen will let you run your tests with
lein test.You can package your project as a jar file with
lein jaror create an uberjar (an executable jar with all required dependencies included) withlein uberjar.For generating documentation I recommend autodoc which integrates nicely with leiningen.