Skip to content

Commit

Permalink
Support :project-init in project.clj to allow :repl-options to use pp…
Browse files Browse the repository at this point in the history
…rint.
  • Loading branch information
technomancy committed Jul 3, 2011
1 parent 9bfc582 commit ad2e211
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
3 changes: 3 additions & 0 deletions sample.project.clj
Expand Up @@ -100,6 +100,9 @@
;; Customize the socket the repl task listens on. ;; Customize the socket the repl task listens on.
:repl-port 4001 :repl-port 4001
:repl-host "0.0.0.0" :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 ;; 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 connection. Increase this to give it more time. Defaults to 100.
:repl-retry-limit 1000 :repl-retry-limit 1000
Expand Down
1 change: 1 addition & 0 deletions src/leiningen/compile.clj
Expand Up @@ -109,6 +109,7 @@


(defn get-readable-form [java project form init] (defn get-readable-form [java project form init]
(let [form `(do ~init (let [form `(do ~init
~(:project-init project)
~@(let [user-clj (file (paths/leiningen-home) "user.clj")] ~@(let [user-clj (file (paths/leiningen-home) "user.clj")]
(if (.exists user-clj) (if (.exists user-clj)
[(list 'load-file (str user-clj))])) [(list 'load-file (str user-clj))]))
Expand Down
49 changes: 27 additions & 22 deletions todo.org
Expand Up @@ -12,7 +12,6 @@ See also https://github.com/technomancy/leiningen/issues
- Tests in Nailgun: would it require a separate shell script? - Tests in Nailgun: would it require a separate shell script?
- How could nonlinear versions be represented? - How could nonlinear versions be represented?
* For 2.0 * For 2.0
- make it easier to hook inside eval-in-project
- Quit using ant's Java task. It is horrible. - Quit using ant's Java task. It is horrible.
Try a custom classloader approach? Try a custom classloader approach?
- Use Aether instead of maven-ant-tasks? - Use Aether instead of maven-ant-tasks?
Expand All @@ -28,34 +27,40 @@ See also https://github.com/technomancy/leiningen/issues
- suppress useless ant output in classpath calculation for :local-repo-classpath - suppress useless ant output in classpath calculation for :local-repo-classpath
- new push task based on clj-ssh - new push task based on clj-ssh
lein-clojars task doesn't support DSA keys 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 * For 1.6
- [x] Trampoline functionality - [X] Trampoline functionality
- [x] move exit-after-tests check to eval-in-project (discuss on list?) - [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] don't freak out when attempting to download non-existent indices
- [x] improve error message for unconfigured deploy - [X] improve error message for unconfigured deploy
- [x] make search work outside project - [X] make search work outside project
- [x] clear up home directory duality in Windows/MinGW - [X] clear up home directory duality in Windows/MinGW
- [x] show total result count in search results - [X] show total result count in search results
- [x] transitive native-deps support - [X] transitive native-deps support
- [x] make :repl-init change initial ns of repl and swank - [X] make :repl-init change initial ns of repl and swank
- [x] more flexibility in search results - [X] more flexibility in search results
- [x] support ns/name in run task - [X] support ns/name in run task
- [x] add option to use ~/.m2-based classpath instead of copying to - [X] add option to use ~/.m2-based classpath instead of copying to
lib/? It looks like it would be easy to stop copying things lib/? It looks like it would be easy to stop copying things
into lib/ and just use Maven's notion of the project's into lib/ and just use Maven's notion of the project's
dependencies to construct a classpath that references jars dependencies to construct a classpath that references jars
straight from ~/.m2. straight from ~/.m2.
- [x] Merge lein-search - [X] Merge lein-search
- [x] Merge lein-retest - [X] Merge lein-retest
- [x] Merge native-deps - [X] Merge native-deps
- [x] Add leiningen.util.injected namespace - [X] Add leiningen.util.injected namespace
* For 1.5.1 * For 1.5.1
** TODO ** TODO
- [x] Move ns docstrings to :help-summary to allow AOT given CLJ-130. - [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] Put :eval-in-lein deps in lib/dev for leiningen process access.
- [x] Revert back to :warn on checksum failure. - [X] Revert back to :warn on checksum failure.
- [x] Fix LEIN_ROOT warning in bin/lein. - [X] Fix LEIN_ROOT warning in bin/lein.
- [x] Honor user-settings in more places. - [X] Honor user-settings in more places.
* For 1.5 * For 1.5
- unify auth options between :repositories and :deploy-to - unify auth options between :repositories and :deploy-to
- suppress socket closed stacktrace in interactive task - suppress socket closed stacktrace in interactive task
Expand Down

0 comments on commit ad2e211

Please sign in to comment.