This is my .clojure/deps.edn
file providing useful clj
aliases drawn from a variety of projects.
An alias to pull in my template creation tool:
:new
-- pulls in and runs the latest stable release of clj-new to create new projects from (Leiningen and other) templates
Aliases to build jar & uberjar files:
:uberjar
-- pulls in and runs the latest stable release of my fork of depstar to create an uberjar;clj -A:uberjar MyProject.jar
;java -cp MyProject.jar clojure.main -m project.core
:jar
-- pulls in and runs the latest stable release of my fork of depstar to create a "thin" JAR;clj -A:jar MyProject.jar
; along with apom.xml
(created viaclj -Spom
), this can be deployed to Clojars etc (viamvn deploy:deploy-file ...
)
And install or deploy jar files:
:install
-- pulls in and runs the latest stable release of Erik Assum's deps-deploy and installs the specified JAR file locally, based on yourpom.xml
:deploy
-- pulls in and runs the latest stable release of Erik Assum's deps-deploy and deploys the specified JAR file to Clojars, based on yourpom.xml
and theCLOJARS_USERNAME
andCLOJARS_PASSWORD
environment variables
There are aliases to pull in various useful testing and debugging tools:
:test
-- adds bothtest
andsrc/test/clojure
to your classpath and pulls in the latest stable version oftest.check
:runner
-- pulls in Cognitect Labs'test-runner
project and runs any tests it can find:readme
-- pulls in the latest stable release of seancorfield/readme and runs it on yourREADME.md
file to treat your examples as tests:eastwood
-- pulls in the latest stable release of Eastwood on yoursrc
andtest
folders; use with:test
above:check
-- pulls in Athos' Check project to compile all your namespaces to check for syntax errors and reflection warnings likelein check
:expect
-- pulls in the latest stable releases of Expectations and expectations/clojure-test -- the latter is theclojure.test
-compatible version of the former:bench
-- pulls in the latest stable release of Criterium for benchmarking your code:decompile
-- pulls in the latest stable release of Clojure Goes Fast's decompiler; requires JDK 8 (not later):measure
-- pulls in the latest stable release of Memory Meter:outdated
-- pulls in and runs version 1.8.4 of Depot and reports on outdated dependencies
There are aliases to pull in and start various REPL-related tools:
-
:nrepl
-- pulls in the latest stable release of nREPL and starts an nREPL server on a random available port -
:nrepl/old
-- pulls in the latest stable release of org.clojure/tools.nrepl and starts an nREPL server on port 60606; this is provided to support legacy tooling -
:socket
-- starts a Socket REPL on port 50505; can be combined with other aliases since this is just a JVM option -
:socket-rebl
-- starts a Socket REPL on port 50123; assumes you have Cognitect's REBL on your classpath (see:rebl
below); everything sent to this Socket REPL will also besubmit
ted to the REBL -
:socket-zero
-- starts a Socket REPL on an available and displays the selected port number (using a-e
option); if you want to start a REPL as well, you will need to specify the-r
option:clj -A:socket-zero -r
-
:prepl
-- starts a Socket pREPL on port 40404; can be combined with other aliases since this is just a JVM option; requires a recent Clojure 1.10 build! -
:rebel
-- starts a Rebel Readline REPL -
:rebl
-- starts Cognitect's REBL (assumes latest Cognitect dev-tools installed) -
:reflect
-- adds Stuart Halloway's reflector utility (best used with REBL) -
:reveal
-- pulls in the latest stable release of the Reveal data visualization tool -- see the Reveal web site for usage options -
:portal
-- pulls in the latest stable release of the Portal data visualization tool -- see the Portal web site for usage options -
:comp
-- adds the latest stable release of compliment; useful with a Socket REPL for Unravel or Chlorine for Atom
There are aliases to pull in specific versions of Clojure:
:master
-- Clojure 1.11.0-master-SNAPSHOT:1.10.1
-- Clojure 1.10.1:1.10
-- Clojure 1.10.0:1.9
-- Clojure 1.9.0- ... back to
:1.0
(note::1.5
is actually Clojure 1.5.1 to avoid a bug in Clojure 1.5.0)
For the EXPERIMENTAL add-lib
function (clojure.tools.deps.alpha.repl/add-lib
):
:add-lib
-- pulls in an (old) branch of org.clojure/tools.deps.alpha; see the exampleload-master
function in the comments in mydeps.edn
; this was previously called:deps
but I realized that conflicted with the default:deps
alias in the Clojure CLI install; be aware thatadd-lib
is unsupported and likely to break or go away astools.deps.alpha
and Clojure both evolve.
For tools.deps.graph
:
:graph
-- pulls in a recent version of tools.deps.graph to help you visualize dependency graphs
For Spec 2 (unstable, buggy -- not ready for production use):
:spec2
-- pulls in org.clojure/spec-alpha2 via GitHub
An alias for the Liquid Clojure editor:
:liquid
-- pulls in and runs the latest stable release of Liquid
For shell-related stuff:
:closh
-- pulls in and runs (from source) version 0.5.0 of the JVM version of closh which gives you a Clojure-enabled terminal shell (it's wonderful!)
And finally, a gnarly little macro, inspired by Ruby's -pne
command line option
that lets you process lines of standard input:
:pne
--cat file-of-numbers.txt | clj -Mpne -e '($ (-> $_ Long/parseLong inc))'
;$
reads stdin and evaluates the expression repeatedly with$_
bound to each line, printing the results to stdout.
Note: if you're using
closh
, you can do the same thing as:pne
directly in the shell:cat file-of-numbers.txt |> (run! #(-> % Long/parseLong inc println))