Skip to content

Commit 3377d9d

Browse files
committed
Document Gradle usage
Filled out the missing pieces where other build tools where mentioned and Gradle wasn't or was incomplete.
1 parent 773cc97 commit 3377d9d

File tree

4 files changed

+40
-7
lines changed

4 files changed

+40
-7
lines changed

doc/modules/ROOT/pages/basics/middleware_setup.adoc

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ automatically injects this middleware and other dependencies as required.
1212
NOTE: In the past, if you were setting up CIDER, you might have had to
1313
modify `profiles.clj` or `profile.boot`. CIDER now handles
1414
everything automatically and you don't need to add anything
15-
special to these files. The same is true of your `deps.edn` file.
15+
special to these files. The same is true of your `deps.edn` file and
16+
your `build.gradle` (as of Clojurephant 0.7.0-alpha.6).
1617

1718
If you prefer a standalone REPL, you will need to invoke
1819
`cider-connect` instead of `cider-jack-in` and manually add the
@@ -45,7 +46,7 @@ A minimal `profiles.clj` for CIDER would be:
4546

4647
[source,clojure]
4748
----
48-
{:repl {:plugins [[cider/cider-nrepl "0.28.4"]
49+
{:repl {:plugins [[cider/cider-nrepl "0.28.5"]
4950
[mx.cider/enrich-classpath "1.9.0"]]}}
5051
----
5152

@@ -95,7 +96,24 @@ run `cider-connect` or `cider-connect-cljs`.
9596

9697
=== Using Gradle
9798

98-
NOTE: This section is currently a stub. Contributions welcome!
99+
NOTE: Make sure you're using https://github.com/clojurephant/clojurephant[Clojurephant] 0.4.0 or newer.
100+
101+
.build.gradle
102+
[source, groovy]
103+
----
104+
dependencies {
105+
devImplementation 'nrepl:nrepl:0.9.0'
106+
devImplementation 'cider:cider-nrepl:0.28.5'
107+
}
108+
109+
tasks.named('clojureRepl') {
110+
middleware = ['cider.nrepl/cider-middleware']
111+
}
112+
----
113+
114+
You can then launch the nREPL server from the command line via: `./gradlew clojureRepl`.
115+
116+
For more information, see the https://clojurephant.dev[Clojurephant docs].
99117

100118
=== Using Maven
101119

doc/modules/ROOT/pages/basics/up_and_running.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ Here's how you can modify the injected dependencies for `cider-jack-in-clj`:
8888
"foo/bar" "1.0")
8989
----
9090

91+
IMPORTANT: Always use the fully qualified `group/artifact` (e.g. `re-frame/re-frame`) in these dependencies, since only Leiningen supports the bare `re-frame` syntax.
92+
9193
CIDER will also inject the most recent version of nREPL that it supports. This is a simple
9294
trick to override the version of nREPL bundled with your build tool (e.g. Leiningen), so you can gain
9395
access to the newest nREPL features. Generally that's one aspect of CIDER's inner workings
@@ -104,10 +106,6 @@ for example, if your project defaults to an older version of Clojure than that
104106
supported by the CIDER middleware. Set `cider-jack-in-auto-inject-clojure`
105107
appropriately to enable this.
106108

107-
NOTE: CIDER does not currently support
108-
dependency auto-injection for Gradle projects. Unfortunately there's no
109-
way to pass extra dependencies to Gradle via its command-line interface.
110-
111109
=== Jacking-in without a Project
112110

113111
If you try to run `cider-jack-in` outside a project

doc/modules/ROOT/pages/cljs/configuration.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ variable. Here's an example:
1717
(cider-add-to-alist 'cider-jack-in-cljs-dependencies "weasel/weasel" "0.7.1")
1818
----
1919

20+
IMPORTANT: Always use the fully qualified `group/artifact` (e.g. `re-frame/re-frame`) in these dependencies, since only Leiningen supports the bare `re-frame` syntax.
21+
2022
Typically, modifying this variable is not needed, as ClojureScript dependencies are declared
2123
explicitly in your project configuration most of the time.
2224

doc/modules/ROOT/pages/cljs/up_and_running.adoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ or in `deps.edn`:
5555
"[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}}}
5656
----
5757

58+
or in `build.gradle`:
59+
60+
[source, groovy]
61+
----
62+
dependencies {
63+
devImplementation 'nrepl:nrepl:0.9.0'
64+
devImplementation 'cider:cider-nrepl:0.28.5'
65+
devImplementation 'cider:cider-piggieback:0.5.3'
66+
}
67+
68+
tasks.named('clojureRepl') {
69+
middleware = ['cider.nrepl/cider-middleware', 'cider.piggieback/wrap-cljs-repl']
70+
}
71+
----
72+
5873
== Starting a ClojureScript REPL
5974

6075
Open a ClojureScript file in your project and type kbd:[M-x]

0 commit comments

Comments
 (0)