pauldoo
pauldoo

Reputation: 18615

How to organise, test, document and package a Clojure project

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?

I'm looking for information on the practical aspects on scaling up from small scripts to something real.

Upvotes: 9

Views: 782

Answers (3)

Alex Baranosky
Alex Baranosky

Reputation: 50064

I use a combo of:

Good luck!

Upvotes: 1

mtyaka
mtyaka

Reputation: 8850

I recommend using leiningen. Running

$ lein new myproject

will create a new folder called myproject inside your current working directory with a default skeleton structure.

Inside the newly generatedmyproject folder you'll find (among others) a folder named src for clojure source code and a folder named test for 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 jar or create an uberjar (an executable jar with all required dependencies included) with lein uberjar.

For generating documentation I recommend autodoc which integrates nicely with leiningen.

Upvotes: 11

Alexis Dufrenoy
Alexis Dufrenoy

Reputation: 11946

If you are using Netbeans, there is a Clojure plugin which could be helpful to you.

Creating a Clojure project with it creates a bunch of folders: Source Packages, which contains a default package called com.yourcompany, Test Packages, Libraries, which contains the .jar for Clojure and a link to the JDK, and Test Libraries, which contains JUnit.

Upvotes: 2

Related Questions