From ad2e2111bf60051a1952164592ad9416b02ba378 Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Sun, 3 Jul 2011 15:12:38 -0700 Subject: [PATCH] Support :project-init in project.clj to allow :repl-options to use pprint. --- sample.project.clj | 3 +++ src/leiningen/compile.clj | 1 + todo.org | 49 +++++++++++++++++++++------------------ 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/sample.project.clj b/sample.project.clj index bbffdec02..fa77d0c88 100644 --- a/sample.project.clj +++ b/sample.project.clj @@ -100,6 +100,9 @@ ;; Customize the socket the repl task listens on. :repl-port 4001 :repl-host "0.0.0.0" + ;; A form to prepend to every form that is evaluated inside your project. + ;; Allows working around the Gilardi Scenario: http://technomancy.us/143 + :project-init (require 'clojure.pprint) ;; If your -main namespace takes a long time to load, it could time out the ;; repl connection. Increase this to give it more time. Defaults to 100. :repl-retry-limit 1000 diff --git a/src/leiningen/compile.clj b/src/leiningen/compile.clj index 9b3193448..74a97e647 100644 --- a/src/leiningen/compile.clj +++ b/src/leiningen/compile.clj @@ -109,6 +109,7 @@ (defn get-readable-form [java project form init] (let [form `(do ~init + ~(:project-init project) ~@(let [user-clj (file (paths/leiningen-home) "user.clj")] (if (.exists user-clj) [(list 'load-file (str user-clj))])) diff --git a/todo.org b/todo.org index 8aac0241e..750e39b08 100644 --- a/todo.org +++ b/todo.org @@ -12,7 +12,6 @@ See also https://github.com/technomancy/leiningen/issues - Tests in Nailgun: would it require a separate shell script? - How could nonlinear versions be represented? * For 2.0 - - make it easier to hook inside eval-in-project - Quit using ant's Java task. It is horrible. Try a custom classloader approach? - Use Aether instead of maven-ant-tasks? @@ -28,34 +27,40 @@ See also https://github.com/technomancy/leiningen/issues - suppress useless ant output in classpath calculation for :local-repo-classpath - new push task based on clj-ssh lein-clojars task doesn't support DSA keys +* For 1.6.1 + - [X] upgrade hooke + - [X] make it easier to use :repl-options [:print clojure.pprint/pprint] + - [ ] fix shutdown-agents with repl + - [ ] investigate lein-multi failure + - [ ] don't clear out lib/dev upon jarring (221) * For 1.6 - - [x] Trampoline functionality - - [x] move exit-after-tests check to eval-in-project (discuss on list?) - - [x] don't freak out when attempting to download non-existent indices - - [x] improve error message for unconfigured deploy - - [x] make search work outside project - - [x] clear up home directory duality in Windows/MinGW - - [x] show total result count in search results - - [x] transitive native-deps support - - [x] make :repl-init change initial ns of repl and swank - - [x] more flexibility in search results - - [x] support ns/name in run task - - [x] add option to use ~/.m2-based classpath instead of copying to + - [X] Trampoline functionality + - [X] move exit-after-tests check to eval-in-project (discuss on list?) + - [X] don't freak out when attempting to download non-existent indices + - [X] improve error message for unconfigured deploy + - [X] make search work outside project + - [X] clear up home directory duality in Windows/MinGW + - [X] show total result count in search results + - [X] transitive native-deps support + - [X] make :repl-init change initial ns of repl and swank + - [X] more flexibility in search results + - [X] support ns/name in run task + - [X] add option to use ~/.m2-based classpath instead of copying to lib/? It looks like it would be easy to stop copying things into lib/ and just use Maven's notion of the project's dependencies to construct a classpath that references jars straight from ~/.m2. - - [x] Merge lein-search - - [x] Merge lein-retest - - [x] Merge native-deps - - [x] Add leiningen.util.injected namespace + - [X] Merge lein-search + - [X] Merge lein-retest + - [X] Merge native-deps + - [X] Add leiningen.util.injected namespace * For 1.5.1 ** TODO - - [x] Move ns docstrings to :help-summary to allow AOT given CLJ-130. - - [x] Put :eval-in-lein deps in lib/dev for leiningen process access. - - [x] Revert back to :warn on checksum failure. - - [x] Fix LEIN_ROOT warning in bin/lein. - - [x] Honor user-settings in more places. + - [X] Move ns docstrings to :help-summary to allow AOT given CLJ-130. + - [X] Put :eval-in-lein deps in lib/dev for leiningen process access. + - [X] Revert back to :warn on checksum failure. + - [X] Fix LEIN_ROOT warning in bin/lein. + - [X] Honor user-settings in more places. * For 1.5 - unify auth options between :repositories and :deploy-to - suppress socket closed stacktrace in interactive task