Skip to content

Instantly share code, notes, and snippets.

@thickey
Forked from solussd/deps+nrepl.md
Last active October 26, 2018 19:57
Show Gist options
  • Save thickey/fec7602d3801087a331a4507e137ed11 to your computer and use it in GitHub Desktop.
Save thickey/fec7602d3801087a331a4507e137ed11 to your computer and use it in GitHub Desktop.
nrepl + deps.edn quickstart

Instructions

  1. Add nrepl server dep to deps.edn :dev alias extra deps
org.clojure/tools.nrepl {:mvn/version "0.2.12"}
  1. create dev/user.clj containing the following:
(ns user
  (:require [clojure.tools.nrepl.server :as nrepl]))

(defonce nrepl-server (nrepl/start-server))
(spit "./.nrepl-port" (:port nrepl-server))
  1. add dev to extra-paths under your dev alias

Example deps.edn (taken from ions starter demo project)

{:paths ["src" "resources"]
 :deps {com.datomic/ion {:mvn/version "0.9.26"}
        org.clojure/data.json {:mvn/version "0.2.6"}
        org.clojure/clojure {:mvn/version "1.9.0"}}
 :mvn/repos {"datomic-cloud" {:url "s3://datomic-releases-1fc2183a/maven/releases"}}
 :aliases
 {:dev {:extra-paths ["dev"]
        :extra-deps {org.clojure/tools.nrepl {:mvn/version "0.2.12"}
                     com.datomic/client-cloud {:mvn/version "0.8.63"}
                     com.datomic/ion-dev {:mvn/version "0.9.176"}}}}}

Run with: clj -A:dev to add the dev deps and paths.

@thickey
Copy link
Author

thickey commented Oct 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment