Skip to content

Instantly share code, notes, and snippets.

@reedho
Created July 18, 2018 11:11
Show Gist options
  • Save reedho/3d3aeb805f20fc6f3aec03881c74cab4 to your computer and use it in GitHub Desktop.
Save reedho/3d3aeb805f20fc6f3aec03881c74cab4 to your computer and use it in GitHub Desktop.

PART I - Installing PR 540

cd /tmp/
git clone https://github.com/clojure-emacs/cider-nrepl
cd cider-nrepl
git fetch origin pull/540/head:CIDER-NREPL-019
git checkout CIDER-NREPL-019
lein deps
lein install

PART II - Starting nrepl 0.4.1 server

mkdir -p /tmp/test1 /tmp/test1/dev
cd /tmp/test1/
cat <<EOF > deps.edn
{:aliases
 {:nrepl-server
  {:extra-paths ["dev"]
   :extra-deps {
                nrepl {:mvn/version "0.4.1"}
                cider/cider-nrepl {:mvn/version "0.19.0-SNAPSHOT"}
                }
   :main-opts ["-m" "my-nrepl-server-starter"]}}
 }
EOF

cat <<EOF > dev/my_nrepl_server_starter.clj
(ns my-nrepl-server-starter
  (:require [cider-nrepl.main :as nrepl]))

(defn -main []
  (nrepl/init ["cider.nrepl/cider-middleware"]))
EOF

clj -Anrepl-server
-> nREPL server started on port 50115 on host localhost - nrepl://localhost:50115

PART III -- Check cider operation

M-x cider-connect RET localhost RET 50115 RET
-> WARNING: CIDER's version (0.18.0-snapshot) does not match cider-nrepl's version (0.19.0-snapshot). Things will break!

user> nrepl.core/version
{:major 0, :minor 4, :incremental 1, :qualifier nil, :version-string "0.4.1"}

(time (reduce + 0 (range 1000)))
"Elapsed time: 0.76332 msecs"
499500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment