Skip to content

Commit

Permalink
Implemented the 'include all classpaths for stand alone repl'
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Thor authored and Eric Thor committed Jan 11, 2010
1 parent f36e7dc commit d0d7b41
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@
(set (apply concat (map #(.getPaths (GlobalPathRegistry/getDefault) %)
["classpath/source" "classpath/compile"]))))

(defn get-all-project-classpaths
"Puts all the source roots first so clojure will be able to find the source files.
After that follows the compile dependant classpaths for each of the projects."
[]
(let [[src compile]
(map #(ClassPathSupport/createProxyClassPath
(into-array (.getPaths (GlobalPathRegistry/getDefault) %)))
["classpath/source" "classpath/compile"])]
(str src File/pathSeparator compile)))

(defn get-all-classpaths-launch-string []
(build-launcher-cp-string (get-all-classpaths)))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,18 @@ and port settings." repl-id) e)))))
"Top level function that grabs the preferences and starts a stand alone repl"
[action]
(try
(let [prefs (enclojure-options-category/get-stand-alone-settings)]
(let [{:keys [include-all-project-classpaths jvm-additional-args] :as prefs}
(enclojure-options-category/get-stand-alone-settings)]
(start-stand-alone-repl
"Stand-alone REPL"
(:jvm-additional-args prefs)
jvm-additional-args
(apply str (classpath-utils/classpath-for-repl)
java.io.File/pathSeparator
(interpose java.io.File/pathSeparator
(:classpaths (:platform prefs))))))
(:classpaths (:platform prefs)))
(when include-all-project-classpaths
(str java.io.File/pathSeparator
(classpath-utils/get-all-classpaths))))))
(catch Exception e
(error-reporting/report-error
(str "Stand alone repl failed to start. Make sure you have Clojure
Expand Down

0 comments on commit d0d7b41

Please sign in to comment.