Skip to content

Commit

Permalink
Use bootclasspath inside eval-in-project. Fixes technomancy#639.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Jun 14, 2012
1 parent a145841 commit 80fa274
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions leiningen-core/src/leiningen/core/eval.clj
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,17 @@
(pr-str (pr-str form))
(pr-str form)))

(defn- classpath-arg [project]
(if (:bootclasspath project true)
[(apply str "-Xbootclasspath/a:"
(interpose java.io.File/pathSeparatorChar
(classpath/get-classpath project)))]
["-cp" (string/join java.io.File/pathSeparatorChar
(classpath/get-classpath project))]))

(defn shell-command [project form]
`(~(or (:java-cmd project) (System/getenv "JAVA_CMD") "java")
"-cp" ~(string/join java.io.File/pathSeparatorChar
(classpath/get-classpath project))
~@(classpath-arg project)
~@(get-jvm-args project)
"clojure.main" "-e" ~(form-string form)))

Expand Down
3 changes: 3 additions & 0 deletions sample.project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@
;; Defaults to :subprocess, but can also be :leiningen (for plugins)
;; or :classloader (experimental) to avoid starting a subprocess.
:eval-in :leiningen
;; Disable bootclasspath optimization. This improves boot time but interferes
;; with using things like pomegranate at runtime.
:bootclasspath false
;; Set parent for working with in a multi-module maven project
:parent [org.example/parent "0.0.1" :relative-path "../parent/pom.xml"]
;; Extensions here will be propagated to the pom but not used by Leiningen.
Expand Down

0 comments on commit 80fa274

Please sign in to comment.