Permalink
Browse files

remove gen-class on leiningen.core and update lein shell script and p…

…roject file to deal with it
  • Loading branch information...
1 parent fe75bcb commit 07f61f6bf6c3058ec86f52365b470a8fac83acaa @danlarkin danlarkin committed Nov 22, 2009
Showing with 6 additions and 7 deletions.
  1. +2 −2 bin/lein
  2. +0 −1 project.clj
  3. +4 −4 src/leiningen/core.clj
View
4 bin/lein
@@ -31,7 +31,7 @@ done
BIN_DIR="$(dirname "$SCRIPT")"
-if [ -r "$BIN_DIR/../classes/leiningen/core.class" ]; then
+if [ -r "$BIN_DIR/../src/leiningen/core.clj" ]; then
# Running from source checkout
LEIN_DIR="$(dirname "$BIN_DIR")"
CLASSPATH="$LEIN_DIR/src:$LEIN_DIR/classes:$LEIN_DIR/lib:$LEIN_JAR:$CLASSPATH"
@@ -79,5 +79,5 @@ elif [ "$1" = "self-install" ]; then
elif [ -z "$1" ]; then
echo "Usage: `basename $0` taskname. Run `basename $0` help for a list of tasks."
else
- exec java -client -cp "$CLASSPATH" leiningen.core $@
+ exec java -client -cp "$CLASSPATH" clojure.main -e "(use 'leiningen.core)(main \"$*\")"
fi
View
1 project.clj
@@ -4,7 +4,6 @@
(defproject leiningen "1.0.0-SNAPSHOT"
:description "A build tool designed not to set your hair on fire."
- :main leiningen.core
:dependencies [[org.clojure/clojure "1.1.0-alpha-SNAPSHOT"]
[org.clojure/clojure-contrib "1.0-SNAPSHOT"]
[ant/ant-launcher "1.6.2"]
View
8 src/leiningen/core.clj
@@ -1,6 +1,5 @@
(ns leiningen.core
- (:use [clojure.contrib.with-ns])
- (:gen-class))
+ (:use [clojure.contrib.with-ns]))
(def project nil)
@@ -40,8 +39,9 @@
(catch java.io.FileNotFoundException e
(partial command-not-found command)))))
-(defn -main [command & args]
- (let [command (or (aliases command) command)
+(defn main [args-string]
+ (let [[command & args] (.split args-string " ")
+ command (or (aliases command) command)
project (if (= command "new") ; only new works without a project.clj
(first args)
(read-project))]

0 comments on commit 07f61f6

Please sign in to comment.