Permalink
Browse files

Exit Leiningen's JVM whenever project's process has exited. Fixes #324.

  • Loading branch information...
1 parent f3e2518 commit 7c1cb81786c7e30ca0b500c753effb7b7f96e41e @technomancy committed Nov 13, 2011
Showing with 24 additions and 29 deletions.
  1. +11 −9 src/leiningen/repl.clj
  2. +13 −20 todo.org
View
20 src/leiningen/repl.clj
@@ -84,20 +84,22 @@
(defn copy-out-loop [reader]
(let [buffer (make-array Character/TYPE 1000)]
- (loop []
- (.write *out* buffer 0 (.read reader buffer))
- (flush)
- (Thread/sleep 100)
- (recur))))
+ (loop [length (.read reader buffer)]
+ (when-not (neg? length)
+ (.write *out* buffer 0 length)
+ (flush)
+ (Thread/sleep 100)
+ (recur (.read reader buffer))))))
(defn repl-client [reader writer & [socket]]
- (.start (Thread. #(copy-out-loop reader)))
- (loop [reader reader, writer writer]
+ (.start (Thread. #(do (copy-out-loop reader)
+ (exit 0))))
+ (loop []
(let [input (read-line)]
- (when (and input (not= "" input))
+ (when (and input (not= "" input) (not (.isClosed socket)))
(.write writer (str input "\n"))
(.flush writer)
- (recur reader writer)))))
+ (recur)))))
(defn- connect-to-server [socket handler]
(let [reader (InputStreamReader. (.getInputStream socket))
View
33 todo.org
@@ -1,12 +1,11 @@
-#-*- mode: org -*-
-#+startup: overview
-#+startup: hidestars
-#+TODO: TODO | INPROGRESS | DONE
-
Leiningen TODOs
See also https://github.com/technomancy/leiningen/issues
+* For 1.6.3
+ - [X] System/exit in repl (#324)
+ - [ ] Fix JVM_OPTS escaping
+ - [ ] help task in Windows doesn't show text (#323)
* For 1.6.2
- [X] resources with eval-in-leiningen (#248)
- [X] fix :omit-default-repositories wrt central (#211)
@@ -40,12 +39,11 @@ See also https://github.com/technomancy/leiningen/issues
- [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.0
- unify auth options between :repositories and :deploy-to
- suppress socket closed stacktrace in interactive task
@@ -123,19 +121,14 @@ See also https://github.com/technomancy/leiningen/issues
- upgrade task (patch submitted)
- doc generation (autodoc plugin)
* For 1.0
- - Remove install task dependency on having Maven installed :Phil:
- - Use -Xbootclasspath where possible :Dan:
- - Don't write manifest, pom, etc. to disk when jarring :Dan:
- - Don't put uberjar in ~/.m2 :Phil:
+ - Remove install task dependency on having Maven installed
+ - Use -Xbootclasspath where possible
+ - Don't write manifest, pom, etc. to disk when jarring
+ - Don't put uberjar in ~/.m2
- Perform compilation in either a subprocess or with a separate classloader
- Allow test task to take namespaces as an argument
- Fix eval-in-project to let plugins pass in extra args
- Resources directory added to classpath (for properties, etc)
-* Plugin ideas
- - metrics
- - LOC
- - complexity
- - time logs
* Git-aware dependencies (experimental back-burner idea)
Talking with Rich after Emerging Langs day 1
Problem: you can pull in two versions of the same library

0 comments on commit 7c1cb81

Please sign in to comment.