Groovy Documentation

clojuresque.tasks
[Groovy] Class ClojureRepl

java.lang.Object
  org.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.

Caveats


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 Closure configuring the underlying exec spec.

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

classpath

@InputFiles
@Delayed
java.lang.Object classpath
Classpath required to generate the documentation.


handler

java.lang.Object handler
The fully qualified name of the repl handler.


injections

java.lang.Object injections
A list of namespaces which need to be reqired to initialise the repl environment.


jvmOptions

@Delayed
java.lang.Object jvmOptions
A Closure configuring the underlying exec spec. This may be used to set eg. heap sizes etc.


middleware

java.lang.Object middleware
A list of fully qualified names of middlewares. Note: unused in case a custom handler is set.


port

java.lang.Object port
The port for the repl server to listen on. A string or integer.


 
Method Detail

classpath

java.lang.Object classpath(java.lang.Object... fs)
Adds the given files to classpath. fs is subject to expansion via project.files.
Parameters:
fs - Files/directories to add to the classpath
Returns:
Returns this.


startRepl

@TaskAction
void startRepl()


 

Groovy Documentation