Permalink
Browse files

Merge master from 1.6.1.

  • Loading branch information...
2 parents 84e6269 + ed42411 commit d65484ce6ae0e4db7fd533ff1f824cf9b86e6d4a @technomancy committed Jul 12, 2011
View
12 NEWS
@@ -1,6 +1,16 @@
Leiningen NEWS -- history of user-visible changes
-= 1.6.1 / TBD
+= 1.6.1 / 2011-07-06
+
+* Allow alternate main namespace to be used during uberjar creation.
+
+* Add :checkout-deps-shares to share more directories in checkout dependencies.
+
+* Fix a bug where agent thread pool would be shut down in repl task.
+
+* Support :project-init in project.clj to allow pprint to be used in :repl-options.
+
+* Fix a bug where tests would not run using Clojure 1.3.
* Support for .classpath file to include context specific classpath elements.
View
@@ -6,13 +6,12 @@
> fiend from hell..."
> -- from Leiningen Versus the Ants by Carl Stephenson
-Leiningen is a build tool for Clojure designed to not set your hair on fire.
+Leiningen is for automating Clojure projects without setting your hair on fire.
<img src="https://github.com/downloads/technomancy/leiningen/leiningen-banner.png" alt="Leiningen logo" title="The man himself" align="right" />
-Building Clojure projects with tools designed for Java can be an
-exercise in frustration. With Leiningen, you describe your build with
-Clojure.
+Working on Clojure projects with tools designed for Java can be an
+exercise in frustration. With Leiningen, you just write Clojure.
## Installation
@@ -24,9 +23,6 @@ upon the first run on unix, so the first run will take longer.
2. Place it on your path and chmod it to be executable.
I like to place it in ~/bin, but it can go anywhere on the $PATH.
-To track development of Leiningen you may use [the master version of the
-script](https://github.com/technomancy/leiningen/raw/master/bin/lein)
-instead. See the "Building" section below.
On Windows most users can
@@ -45,7 +41,7 @@ and use self-install.
## Usage
The
-[tutorial](https://github.com/technomancy/leiningen/blob/stable/TUTORIAL.md)
+[tutorial](https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md)
has a detailed walk-through of the steps involved in creating a new
project, but here are the commonly-used tasks:
@@ -80,11 +76,11 @@ advantage of this, you should put it on your <tt>$PATH</tt>.
The <tt>project.clj</tt> file in the project root should look like this:
(defproject myproject "0.5.0-SNAPSHOT"
- :description "A build tool designed to not set your hair on fire."
- :url "http://github.com/technomancy/leiningen"
+ :description "A project for doing things."
+ :url "http://github.com/technomancy/myproject"
:dependencies [[org.clojure/clojure "1.2.1"]
[org.clojure/clojure-contrib "1.2.0"]]
- :dev-dependencies [[swank-clojure "1.2.1"]])
+ :dev-dependencies [[lein-ring "0.4.5"]])
The <tt>lein new</tt> task generates a project skeleton with an
appropriate starting point from which you can work. See the
@@ -102,7 +98,7 @@ You can also manage your plugins with the <tt>plugin</tt> task. Use
the same arguments you would put in the Leiningen :dev-dependencies if
you were only using the plugin on a single project.
- $ lein plugin install lein-clojars/lein-clojars "0.6.0"
+ $ lein plugin install lein-clojars "0.6.0"
See the plugin task's help for more information.
@@ -135,7 +131,7 @@ See the plugin task's help for more information.
**Q:** What's a group ID? How do snapshots work?
**A:** See the
- [tutorial](https://github.com/technomancy/leiningen/blob/stable/TUTORIAL.md)
+ [tutorial](https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md)
for background.
**Q:** How should I pick my version numbers?
@@ -147,13 +143,14 @@ See the plugin task's help for more information.
is a typo in your :dependency declaration in project.clj.
**Q:** What if my project depends on jars that aren't in any repository?
-**A:** The [deploy guide](https://github.com/technomancy/leiningen/blob/stable/DEPLOY.md)
- explains how to set up a private repository.
+**A:** The [deploy guide](https://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md)
+ explains how to set up a private repository. If you are not sharing
+ them with a team you could also just [install locally.](http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html).
**Q:** How do I write my own tasks?
**A:** If it's a task that may be useful to more than just your
project, you should make it into a
- [plugin](https://github.com/technomancy/leiningen/blob/stable/PLUGINS.md).
+ [plugin](https://github.com/technomancy/leiningen/blob/stable/doc/PLUGINS.md).
You can also include one-off tasks in your src/leiningen/ directory
if they're not worth spinning off; the plugin guide shows how.
@@ -163,7 +160,7 @@ See the plugin task's help for more information.
some other project roots into it, Leiningen will allow you to hack
on them in parallel. That means changes in the dependency will be
visible in the main project without having to go through the whole
- install/switch-projects/deps/restart-swank cycle. Note that this is
+ install/switch-projects/deps/restart-repl cycle. Note that this is
not a replacement for listing the project in :dependencies; it
simply supplements that for tighter change cycles.
@@ -186,6 +183,11 @@ See the plugin task's help for more information.
should not AOT-compile your project if other projects may depend
upon it.
+**Q:** I'm behind an HTTP proxy; how can I fetch my dependencies?
+**A:** Currently you need to configure the underlying Maven library by
+ creating <tt>~/.m2/settings.xml</tt> as explained in the
+ [Maven guide](http://maven.apache.org/guides/mini/guide-proxies.html).
+
**Q:** What can be done to speed up launch?
**A:** The main delay involved in Leiningen comes from starting the
JVM. Launching "lein interactive" will give you an interactive
@@ -201,7 +203,7 @@ See the plugin task's help for more information.
startup time. Leiningen will try to launch a client JVM, but this
only works on 32-bit JVM installations. If you are on a 64-bit
machine you can still use a client JVM if you install 32-bit
- packages; on Ubuntu try ia32-sun-java6-bin. Once you've installed
+ packages; on Debian try ia32-sun-java6-bin. Once you've installed
it, run <tt>sudo update-java-alternatives -s ia32-java-6-sun</tt>.
**Q:** I don't have access to stdin inside my project.
View
@@ -0,0 +1 @@
+The [tutorial has moved](https://github.com/technomancy/leiningen/blob/stable/TUTORIAL.md)!
View
@@ -1,6 +1,6 @@
#!/bin/bash
-LEIN_VERSION="1.6.1-SNAPSHOT"
+LEIN_VERSION="1.6.1"
export LEIN_VERSION
if [ `whoami` = "root" ] && [ "$LEIN_ROOT" = "" ]; then
@@ -77,9 +77,9 @@ fi
SHARE_JARS="ant ant-launcher classworlds clojure-1.2 \
lucene-memory maven-ant-tasks maven-artifact maven-artifact-manager \
maven-error-diagnostics maven-model maven-settings maven-project maven-profile \
-plexus-container-default-alpha plexus-interpolation plexus-utils \
-wagon-file wagon-http-lightweight wagon-http-shared wagon-provider-api xml-apis
-lucene-core lucene-highlighter clucy robert-hooke lancet leiningen
+maven-repository-metadataplexus-container-default-alpha plexus-interpolation \
+plexus-utils wagon-file wagon-http-lightweight wagon-http-shared wagon-provider-api \
+xml-apis lucene-core lucene-highlighter clucy robert-hooke lancet leiningen
backport-util-concurrent" # NFI why that last one is necessary
for JAR in $SHARE_JARS; do
CLASSPATH="$CLASSPATH":"/usr/share/java/$JAR.jar"
@@ -101,6 +101,9 @@ fi
if [ "$1" = "trampoline" ]; then
TRAMPOLINE_FILE="/tmp/lein-trampoline-$$"
+ if [ "$OSTYPE" = "cygwin" ]; then
+ TRAMPOLINE_FILE=`cygpath -w $TRAMPOLINE_FILE`
+ fi
$JAVA_CMD -Xbootclasspath/a:"$CLOJURE_JAR" -client $JVM_OPTS \
-Dleiningen.original.pwd="$ORIGINAL_PWD" \
-Dleiningen.trampoline-file=$TRAMPOLINE_FILE -cp "$CLASSPATH" \
@@ -109,7 +112,7 @@ if [ "$1" = "trampoline" ]; then
if [ -r $TRAMPOLINE_FILE ]; then
TRAMPOLINE="$(cat $TRAMPOLINE_FILE)"
rm $TRAMPOLINE_FILE
- exec sh -c "$TRAMPOLINE"
+ exec sh -c "exec $TRAMPOLINE"
fi
else
exec $RLWRAP $JAVA_CMD -Xbootclasspath/a:"$CLOJURE_JAR" -client $JVM_OPTS \
View
@@ -0,0 +1,123 @@
+#!/bin/bash
+
+# This variant of the lein script is meant for downstream packagers.
+# It has all the cross-platform stuff stripped out as well as the
+# logic for running from checkouts and self-upgrading.
+
+LEIN_VERSION="1.6.1"
+export LEIN_VERSION
+
+if [ `whoami` = "root" ] && [ "$LEIN_ROOT" = "" ]; then
+ echo "WARNING: You're currently running as root; probably by accident."
+ echo "Press control-C to abort or Enter to continue as root."
+ echo "Set LEIN_ROOT to disable this warning."
+ read _
+fi
+
+# cd to the project root, if applicable
+NOT_FOUND=1
+ORIGINAL_PWD="$PWD"
+while [ ! -r "$PWD/project.clj" ] && [ "$PWD" != "/" ] && [ $NOT_FOUND -ne 0 ]; do
+ cd ..
+ if [ "$(dirname "$PWD")" = "/" ]; then
+ NOT_FOUND=0
+ cd "$ORIGINAL_PWD"
+ fi
+done
+
+# Support $JAVA_OPTS for backwards-compatibility.
+JVM_OPTS=${JVM_OPTS:-"$JAVA_OPTS"}
+JAVA_CMD=${JAVA_CMD:-"java"}
+LEIN_HOME=${LEIN_HOME:-"$HOME/.lein"}
+
+DEV_PLUGINS="$(ls -1 lib/dev/*jar 2> /dev/null)"
+USER_PLUGINS="$(ls -1 "$LEIN_HOME"/plugins/*jar 2> /dev/null)"
+
+artifact_name () {
+ echo "$1" | sed -e "s/.*\/\(.*\)/\1/" | \
+ rev | sed -e "s/raj[-[:digit:].]*-\(.*\)/\1/" | rev
+}
+
+unique_user_plugins () {
+ saveIFS="$IFS"
+ IFS="$(printf '\n\t')"
+
+ plugins="$(echo "$DEV_PLUGINS"; echo "$USER_PLUGINS")"
+ artifacts="$(for i in $plugins; do echo "$(artifact_name "$i")"; done)"
+ duplicates="$(echo "$artifacts" | sort | uniq -d)"
+
+ if [ -z "$duplicates" ]; then
+ echo "$USER_PLUGINS"
+ else
+ for i in $USER_PLUGINS; do
+ artifact="$(artifact_name "$i")"
+ if ! echo "$duplicates" | grep -xq "$artifact"; then
+ echo "$i"
+ fi
+ done
+ fi
+ IFS="$saveIFS"
+}
+
+LEIN_PLUGIN_PATH="$(echo "$DEV_PLUGINS" | tr \\n :)"
+LEIN_USER_PLUGIN_PATH="$(echo "$(unique_user_plugins)" | tr \\n :)"
+CLASSPATH="$CLASSPATH:$LEIN_PLUGIN_PATH:$LEIN_USER_PLUGIN_PATH:test/:src/"
+LEIN_JAR="$HOME/.lein/self-installs/leiningen-$LEIN_VERSION-standalone.jar"
+CLOJURE_JAR="/usr/share/java/clojure-1.2.jar:/usr/share/java/asm3.jar"
+NULL_DEVICE=/dev/null
+
+# apply context specific CLASSPATH entries
+if [ -f .classpath ]; then
+ CLASSPATH="`cat .classpath`:$CLASSPATH"
+fi
+
+# normalize $0 on certain BSDs
+if [ "$(dirname "$0")" = "." ]; then
+ SCRIPT="$(which $(basename "$0"))"
+else
+ SCRIPT="$0"
+fi
+
+SHARE_JARS="ant ant-launcher classworlds clojure-1.2 \
+lucene-memory maven-ant-tasks maven-artifact maven-artifact-manager \
+maven-error-diagnostics maven-model maven-settings maven-project maven-profile \
+plexus-container-default-alpha plexus-interpolation plexus-utils \
+wagon-file wagon-http-lightweight wagon-http-shared wagon-provider-api xml-apis
+lucene-core lucene-highlighter clucy robert-hooke lancet leiningen
+backport-util-concurrent" # NFI why that last one is necessary
+for JAR in $SHARE_JARS; do
+ CLASSPATH="$CLASSPATH":"/usr/share/java/$JAR.jar"
+done
+
+if [ $DEBUG ]; then
+ echo $CLASSPATH
+ echo $CLOJURE_JAR
+fi
+
+# Use rlwrap if appropriate
+if ([ "$1" = "repl" ] || [ "$1" = "interactive" ] || [ "$1" = "int" ]) &&
+ [ -z $INSIDE_EMACS ] && [ "$TERM" != "dumb" ]; then
+ which rlwrap > /dev/null
+ if [ $? -eq 0 ]; then
+ RLWRAP="rlwrap -m -q '\"'" # custom quote chars
+ fi
+fi
+
+if [ "$1" = "trampoline" ]; then
+ TRAMPOLINE_FILE="/tmp/lein-trampoline-$$"
+ $JAVA_CMD -Xbootclasspath/a:"$CLOJURE_JAR" -client $JVM_OPTS \
+ -Dleiningen.original.pwd="$ORIGINAL_PWD" \
+ -Dleiningen.trampoline-file=$TRAMPOLINE_FILE -cp "$CLASSPATH" \
+ clojure.main -e "(use 'leiningen.core)(-main)" \
+ $NULL_DEVICE "$@"
+ if [ -r $TRAMPOLINE_FILE ]; then
+ TRAMPOLINE="$(cat $TRAMPOLINE_FILE)"
+ rm $TRAMPOLINE_FILE
+ exec sh -c "$TRAMPOLINE"
+ fi
+else
+ exec $RLWRAP $JAVA_CMD -Xbootclasspath/a:"$CLOJURE_JAR" -client $JVM_OPTS \
+ -Dleiningen.original.pwd="$ORIGINAL_PWD" \
+ -cp "$CLASSPATH" clojure.main -e "(use 'leiningen.core)(-main)" \
+ $NULL_DEVICE "$@"
+fi
Oops, something went wrong.

0 comments on commit d65484c

Please sign in to comment.