(note, try boot, it's better)
resolve dependencies for a single clj file.
Like lein-oneoff, I want a simple way to get dependencies and run a single clj file.
Once I put dependencies to the top of the clj file (start with
;;[clj-time "0.11.0"] ;;[clj-http "3.1.0"] ;;[org.clojure/core.async "0.2.374"]
I can run
./bin/oneclj-deps sample.clj to generate a bash script includes resolved classpath.
make, binaries need be found in
PATH environment variable.
CLOJURE variable is required:
$ CLOJURE=/opt/clojure-1.8.0.jar make
The version of clojure is also be added as dependency.
sample.clj as example:
$ /path/to/oneclj-deps sample.clj
Two bash scripts are generated:
Run clj script with:
The other one is for repl:
If you have
rlwrap in your
PATH, will also include a
(oneclj-rlwrap-completions) function for writing
rlwrap completion list.
The repl bash script does not load the
clj file when starting.
Makefile also generates an
oneclj-uberjar bash script.
$ /path/to/oneclj-uberjar sample.clj
sample-0.1.0-standalone.jar with all dependencies (fat-jar), which can be run anywhere with
java -jar /path/to/sample-0.1.0-starndalone.jar.
This project was started with the maven approach, kept in