|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD | |||||||
java.lang.Objectorg.gradle.api.DefaultTask
clojuresque.tasks.ClojureRepl
class ClojureRepl extends DefaultTask
Starts a nrepl server for the project. To provide your own handler, eg. to use custom nrepl middlewares, put the code into a separate sourceSet and tell the task to use your specific handler factory.
sourceSets { dev }
clojureRepl {
handler = "my.repl/handler"
}
And in src/dev/clojure/my/repl.clj:
(ns my.repl
(:require
[clojure.tools.nrepl.server :as repl]))
(defn handler
[]
(repl/default-handler #'my-middleware))
If all you want is to specify custom middleware, there is a
short-hand in the middleware option. Here you can
specify the fully-qualified names of the middleware in the desired
order.
clojureRepl {
middleware << "my.repl/middleware"
}
Some environments need certain support code to be initialized from
the classpath. For example David Greenberg's redl or Petit Laurent's
counterclockwise. You can specify such namespaces via the
injections option.
clojureRepl {
injections = [ "redl.core", "redl.complete", "ccw.debug.serverrepl" ]
}
Note: You have to specify the nrepl version to use
manually. Eg. by using the development configuration or
as part of your application.
build.gradle
is touched between the runs. Then the repl has to be stopped
and restarted afresh to allow again parallel builds.| Property Summary | |
|---|---|
java.lang.Object |
classpath
Classpath required to generate the documentation. |
java.lang.Object |
handler
The fully qualified name of the repl handler. |
java.lang.Object |
injections
A list of namespaces which need to be reqired to initialise the repl environment. |
java.lang.Object |
jvmOptions
A |
java.lang.Object |
middleware
A list of fully qualified names of middlewares. |
java.lang.Object |
port
The port for the repl server to listen on. |
| Method Summary | |
|---|---|
java.lang.Object
|
classpath(java.lang.Object... fs)
Adds the given files to classpath. |
void
|
startRepl()
|
| Property Detail |
|---|
@InputFiles @Delayed java.lang.Object classpath
java.lang.Object handler
java.lang.Object injections
@Delayed java.lang.Object jvmOptions
Closure configuring the underlying exec spec.
This may be used to set eg. heap sizes etc.
java.lang.Object middleware
handler is set.
java.lang.Object port
| Method Detail |
|---|
java.lang.Object classpath(java.lang.Object... fs)
fs is subject
to expansion via project.files.
fs - Files/directories to add to the classpaththis.
@TaskAction void startRepl()
Groovy Documentation