Skip to content

Instantly share code, notes, and snippets.

@laurentpetit
Last active December 11, 2015 15:08
Show Gist options
  • Save laurentpetit/4618628 to your computer and use it in GitHub Desktop.
Save laurentpetit/4618628 to your computer and use it in GitHub Desktop.
Tentative fix for the CCW 0.11.0 issue when creating new leiningen projects
;; Tentative fix for the CCW 0.11.0 issue when creating new leiningen projects
;; - In your running Eclipse, open an embedded REPL View (a REPLView which will be directly connected to the JVM running your Eclipse !) :
;; - Mac= Cmd+Alt+Q (Win/Lin= Ctrl+Alt+Q), then select "New REPL client for embedded Eclipse nrepl server"
;; - a REPL View should appear
;; - Copy the content of this patch into the REPL's input area and evaluate it as usual
;; - If everything goes fine, you should see "#'ccw.leiningen.util/lein-project" in the REPL log area
;; - You should now be able to create new projects with the leiningen wizard
(def lein-bundle (ccw.util.bundle/load-and-get-bundle "ccw.leiningen"))
(.start lein-bundle)
(ccw.util.bundle/with-bundle* lein-bundle
(fn [] (require 'ccw.leiningen.util)))
(ccw.util.bundle/set-bundle-classloader! "ccw.leiningen")
(in-ns 'ccw.leiningen.util)
(defn lein-project
[project & {:keys [static-loading? enhance-fn] :or {enhance-fn identity}}]
(eval-in-project project '(require 'leiningen.core.project))
(let [project-map (if (= :project-less project)
(eval-in-project
project
`(leiningen.core.project/merge-profiles
(update-in leiningen.core.project/defaults
[:repositories] (fnil conj []) ["clojars-ccw-added" {:url "https://clojars.org/repo/"}])
[:user :default]))
(eval-in-project
project
'leiningen.core.project/read
(project-clj project)))
project-map (enhance-fn project-map)]
(when-not static-loading?
(eval-in-project
project
(if (= :project-less project)
`(do
(leiningen.core.project/load-certificates '~project-map)
(leiningen.core.project/load-plugins '~project-map))
`(leiningen.core.project/init-project '~project-map))))
project-map))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment