Merge pull request #2413 from aroemers/fix-duplicate-alias
Ensure aliases are replaced when merging profiles
|9 months ago|
|.circleci||1 year ago|
|bin||11 months ago|
|doc||1 year ago|
|lein-pprint||1 year ago|
|leiningen-core||9 months ago|
|resources||10 months ago|
|src/leiningen||10 months ago|
|test||9 months ago|
|test_projects||10 months ago|
|.gitattributes||8 years ago|
|.gitignore||10 months ago|
|CONTRIBUTING.md||1 year ago|
|COPYING||2 years ago|
|NEWS.md||1 year ago|
|README.md||1 year ago|
|TUTORIAL.md||7 years ago|
|bash_completion.bash||2 years ago|
|pcmpl-lein.el||5 years ago|
|project.clj||11 months ago|
|sample.project.clj||1 year ago|
|zsh_completion.zsh||4 years ago|
"Leiningen!" he shouted. "You're insane! They're not creatures you can fight—they're an elemental—an 'act of God!' Ten miles long, two miles wide—ants, nothing but ants! And every single one of them a fiend from hell..."
- from Leiningen Versus the Ants by Carl Stephenson
Leiningen is for automating Clojure projects without setting your hair on fire.
If your preferred package manager offers a recent version of Leiningen, try that first as long as it has version 2.x.
Leiningen installs itself on the first run of the
lein shell script; there is no
separate install script. Follow these instructions to install Leiningen manually:
leinscript from the
stablebranch of this project.
~/binis a good choice if it is on your path.)
chmod +x ~/bin/lein)
There is an installer which will handle downloading and placing Leiningen and its dependencies.
The manual method of putting
the batch file.
PATH and running
lein self-install should still work for
most users. If you have Cygwin you should be
able to use the shell script above rather than the batch file.
N.B.: Avoid using a LEIN_JAR environment variable.
If you have one instance of Leiningen on your PATH as well as a LEIN_JAR
pointing to a different instance, there is a known problem where
lein -v and
lein upgrade will refer to the first instance, while usage of Leiningen, such
lein new foobar, will refer to the latter.
The tutorial has a detailed walk-through of the steps involved in creating a new project, but here are the commonly-used tasks:
$ lein new [TEMPLATE] NAME # generate a new project skeleton $ lein test [TESTS] # run the tests in the TESTS namespaces, or all tests $ lein repl # launch an interactive REPL session $ lein run -m my.namespace # run the -main function of a namespace $ lein uberjar # package the project and dependencies as standalone jar $ lein deploy clojars # publish the project to Clojars as a library
lein help to see a complete list.
lein help $TASK shows the
usage for a specific task.
You can also chain tasks together in a single command by using the
do task with comma-separated tasks:
$ lein do clean, test foo.test-core, jar
Most tasks need to be run from somewhere inside a project directory to
work, but some (
run from anywhere.
project.clj file in the project root should look like this:
(defproject myproject "0.5.0-SNAPSHOT" :description "A project for doing things." :license "Eclipse Public License 1.0" :url "http://github.com/technomancy/myproject" :dependencies org.clojure/clojure "1.8.0" :plugins lein-tar "3.2.0")
lein new task generates a project skeleton with an appropriate
starting point from which you can work. See the
file (also available via
lein help sample) for a detailed listing of
project.clj file can be customized further with the use of
Leiningen documentation is organized as a number of guides:
Leiningen supports plugins which may introduce new tasks. See
the plugins wiki page
for a full list. If a plugin is needed for successful test or build
runs, (such as
lein-tar) then it should be added to
project.clj, but if it's for your own convenience (such as
lein-pprint) then it should be added to the
:plugins list in the
:user profile in
~/.lein/profiles.clj. See the
for details on how to add to your
:user profile. The
explains how to write plugins.
Source Copyright © 2009-2017 Phil Hagelberg, Alex Osborne, Dan Larkin, and contributors. Distributed under the Eclipse Public License, the same as Clojure uses. See the file COPYING.
Thanks to Stuart Halloway for Lancet and Tim Dysinger for convincing me that good builds are important.
Images Copyright © 2010 Phil Hagelberg. Distributed under the Creative Commons Attribution + ShareAlike License. Full-size version available.