Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Calling it good: releasing 0.5.0!

  • Loading branch information...
commit f97228f1a79147e3f6ec514d82f7dcd52c602161 1 parent a387b21
@technomancy authored
View
5 bin/lein
@@ -1,9 +1,10 @@
#!/bin/bash
# TODO: this gives us a trailing colon
+VERSION=0.5.0
LIBS="$(find -H lib/ -mindepth 2> /dev/null 1 -maxdepth 1 -print0 | tr \\0 \:)"
CLASSPATH="src/:classes/:$LIBS"
-LEIN_JAR=$HOME/.m2/repository/leiningen/leiningen/0.5.0-SNAPSHOT/leiningen-0.5.0-SNAPSHOT.jar
+LEIN_JAR=$HOME/.m2/repository/leiningen/leiningen/$VERSION/leiningen-$VERSION.jar
# this needs to exist before the JVM is launched apparently
mkdir -p classes
@@ -39,7 +40,7 @@ if [ "$1" = "repl" ]; then
elif [ "$1" = "self-install" ]; then
echo "Downloading Leiningen now..."
mkdir -p `dirname "$LEIN_JAR"`
- LEIN_URL=http://repo.technomancy.us/leiningen.jar
+ LEIN_URL=http://repo.technomancy.us/leiningen-$VERSION.jar
if type -p curl >/dev/null 2>&1; then
exec curl -o "$LEIN_JAR" "$LEIN_URL"
else
View
4 project.clj
@@ -2,8 +2,8 @@
;; defproject form. It can have other code in it as well, including
;; loading other task definitions.
-(defproject leiningen "0.5.0-SNAPSHOT"
- :description "A build tool designed not to set your hair on file."
+(defproject leiningen "0.5.0"
+ :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"]
View
29 src/leiningen/help.clj
@@ -0,0 +1,29 @@
+(ns leiningen.help
+ "Display a list of tasks or help for a given task."
+ (:use [clojure.contrib.find-namespaces :only [find-namespaces-on-classpath]]))
+
+(def tasks (filter #(re-find #"^leiningen\.(?!core)" (name %))
+ (find-namespaces-on-classpath)))
+
+(defn help-for [task]
+ (let [task-ns (symbol (str "leiningen." task))
+ _ (require task-ns)
+ task (ns-resolve task-ns (symbol task))]
+ (println (or (:doc (meta task))
+ (:doc (meta (find-ns task-ns)))))))
+
+(defn help-summary-for [task-ns]
+ (require task-ns)
+ (let [task-name (last (.split (name task-ns) "\\."))]
+ (println task-name (apply str (repeat (- 7 (count task-name)) " "))
+ "-" (:doc (meta (find-ns task-ns))))))
+
+(defn help [project & [task]]
+ (if task
+ (help-for task)
+ (do (println "Leiningen is a build tool for Clojure.\n")
+ (println "Several tasks are available:")
+ (doseq [task-ns tasks]
+ (help-summary-for task-ns))
+ (println "\nRun lein help $TASK for details.")
+ (println "See http://github.com/technomancy/leiningen as well."))))
View
5 src/leiningen/jar.clj
@@ -6,8 +6,9 @@
(defn make-manifest [project]
(doto (str (:root project) "/Manifest.txt")
- (spit (when (:main project)
- (str "Main-Class: " (:main project) "\n")))))
+ (spit (if (:main project)
+ (str "Main-Class: " (:main project) "\n")
+ ""))))
(defn jar
"Create a $PROJECT.jar file containing the compiled .class files as well as
View
3  src/leiningen/pom.clj
@@ -25,7 +25,8 @@
(.setUrl url)))
(def default-repos {"central" "http://repo1.maven.org/maven2"
- "clojure-snapshots" "http://build.clojure.org/snapshots"})
+ "clojure-snapshots" "http://build.clojure.org/snapshots"
+ "clojars" "http://clojars.org/repo/"})
(defn make-model [project]
(let [model (doto (Model.)
Please sign in to comment.
Something went wrong with that request. Please try again.