CIDER (The Clojure Interactive Development Environment for Emacs that Rocks) functionality is largely build-tool-agnostic except for the startup (a.k.a "jack-in") process to start and connect to nREPL. In recent versions, this works with Gradle the same as it does for other build tools.
Once you’re jacked-in or connected, see CIDER’s documentation for usage information.
Note
|
cider-javadoc does not require enrich-classpath to work with Gradle. Clojurephant will automatically add sources/javadoc JARs of your dependencies to the REPL classpath.
|
Tip
|
For CIDER’s dependency injection to work to work, you need at least:
|
As long as your Gradle build is using either or both of the reference:plugins/clojure.adoc or reference:plugins/clojurescript.adoc plugins, CIDER will handle the rest.
-
Open Emacs
-
Visit a Clojure file in your project
-
Run
M-x cider-jack-in-clj
CIDER will automatically inject the needed nREPL version and middleware, start the nREPL server, and connect to it.
If you’re someone who (setq cider-inject-dependencies-at-jack-in nil)
, then here are the needed changes to manually configure your project for use with CIDER.
dependencies {
devImplementation 'cider:cider-nrepl:{cider-nrepl-version}'
}
clojureRepl {
middleware = ['cider.nrepl/cider-middleware']
}
-
Open Emacs
-
Visit a Clojure file in your project
-
Run
M-x cider-jack-in-clj
Start your nREPL server.
$ ./gradlew clojureRepl
Optionally, omit the middleware from the build.gradle
and include it on the commandline:
$ ./gradlew clojureRepl --middleware=cider.nrepl/cider-middleware
Then M-x cider-connect
. CIDER should pick up the port via the .nrepl-port
file.