Skip to content

Commit

Permalink
Exit Leiningen's JVM whenever project's process has exited. Fixes #324.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Nov 13, 2011
1 parent f3e2518 commit 7c1cb81
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 29 deletions.
20 changes: 11 additions & 9 deletions src/leiningen/repl.clj
Expand Up @@ -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))
Expand Down
33 changes: 13 additions & 20 deletions 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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7c1cb81

Please sign in to comment.