From f6333042c293947c3fce796cc9e8439a1b7d35a9 Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Wed, 16 Jun 2010 19:30:41 -0700 Subject: [PATCH] Fix #54; make sure all tasks have fn-level docstrings. This is a workaround for Clojure issue #130. --- src/leiningen/deps.clj | 17 ++--------------- src/leiningen/help.clj | 4 +++- src/leiningen/install.clj | 4 +++- src/leiningen/new.clj | 4 ++++ src/leiningen/pom.clj | 1 + src/leiningen/repl.clj | 4 +++- src/leiningen/uberjar.clj | 4 +--- 7 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/leiningen/deps.clj b/src/leiningen/deps.clj index e2a7039f..02a3d980 100644 --- a/src/leiningen/deps.clj +++ b/src/leiningen/deps.clj @@ -42,21 +42,8 @@ (:repositories project))) (defn deps - "Download and install all :dependencies listed in project.clj into the lib/ -directory. With an argument it will skip development dependencies. Dependencies -should be a vector of entries specifying group, name, and version like the -following: - [org.clojure/clojure-contrib \"1.0-SNAPSHOT\"] - -It is also possible to exclude specific indirect dependencies of a direct -dependency using the optional :exclusions keyword and vector of entries. -A project that depends on log4j could exclude unnecessary indirect -dependencies with the following: - [log4j \"1.2.15\" :exclusions [javax.mail/mail - javax.jms/jms - com.sun.jdmk/jmxtools - com.sun.jmx/jmxri]]" - ;; TODO: get deps from ~/.m2 while offline + "Download and install all :dependencies listed in project.clj. +With an argument it will skip development dependencies." ([project skip-dev set] (let [deps-task (DependenciesTask.)] (.setBasedir lancet/ant-project (:root project)) diff --git a/src/leiningen/help.clj b/src/leiningen/help.clj index 57f0512d..08f8699a 100644 --- a/src/leiningen/help.clj +++ b/src/leiningen/help.clj @@ -2,7 +2,8 @@ "Display a list of tasks or help for a given task." (:use [clojure.contrib.find-namespaces :only [find-namespaces-on-classpath]])) -(def tasks (set (filter #(re-find #"^leiningen\.(?!core)" (name %)) +(def tasks (set (filter #(re-find #"^leiningen\.(?!core|checkout-deps)" + (name %)) (find-namespaces-on-classpath)))) (defn get-arglists [task] @@ -27,6 +28,7 @@ " - " (:doc (meta (find-ns task-ns)))))) (defn help + "Display a list of tasks or help for a given task." ([task] (println (help-for task))) ([] (println "Leiningen is a build tool for Clojure.\n") diff --git a/src/leiningen/install.clj b/src/leiningen/install.clj index fbb1f6c3..3b33166c 100644 --- a/src/leiningen/install.clj +++ b/src/leiningen/install.clj @@ -38,7 +38,9 @@ (.getPackaging model) nil)) -(defn install [project] +(defn install + "Install the project and its dependencies in your local repository." + [project] (let [jarfile (file (jar project)) model (make-model project) artifact (make-artifact model) diff --git a/src/leiningen/new.clj b/src/leiningen/new.clj index 1645812d..684c099e 100644 --- a/src/leiningen/new.clj +++ b/src/leiningen/new.clj @@ -8,6 +8,10 @@ Neither group-id nor artifact-id may contain slashes." [clojure.contrib.string :only [join]])) (defn new + "Create a new project skeleton. +lein new [group-id/]artifact-id [project-dir] +Group-id is optional. Project-dir defaults to artifact-id if not given. +Neither group-id nor artifact-id may contain slashes." ([project-name project-dir] (when (re-find #"(?