-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear gradling Clojurians,
I finally came around to do some work. I'm bringing clojuresque
up-to-date with the latest gradle developments. (Warning: Breaking
changes ahead. However with a (hopefully) smooth deprecation period.)
Part of this is reorganising everything into smaller plugins. One of
the first is nrepl providing tasks to start and stop a gradle server
in the background.
The process is really started in the background. So in contrary to
JavaExec gradle is not blocked while running the server which solves
some problems with locks on the gradle caches.
There are two tasks "startNRepl" and "stopNRepl". By default the start
task writes the port of the started server into replInfo.edn for use
by other tooling (and the stop task). If you don't want this file, you
can hardwire the repl port in the start task. The stop task will
inherit the settings.
Via init you can inject additional code to be executed on startup. In
the following example this is done for David Greenberg's vim-redl.
- ---8<---
apply plugin: "clojure"
apply plugin: "nrepl"
dependencies {
compile "org.clojure:clojure:1.5.1"
development "org.clojure:tools.nrepl:0.2.0"
development "redl:redl:0.1.0"
}
startNRepl {
replInfo = null
replPort = 4711
replClasspath = project.files(
project.sourceSets.main.clojure.srcDirs,
project.sourceSets.main.resources.srcDirs,
project.configurations.testRuntime,
project.configurations.development
)
init << "(require 'redl.core 'redl.complete)"
}
- ---8<---
Running "gradle startNRepl" will start the server, "gradle stopNRepl"
will stop it.
Please let me know what you think.
Meikel
PS: If someone has some gradle-fu re testing the tasks more robust
then any feedback here is also appreciated!
- --
Meikel Brandmeyer
Clojure Trainings
Kastellstraße 3
63526 Erlensee
http://kotka.de
USt.-Id: DE 285 667 417
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: GPGTools -
http://gpgtools.org
Comment: Using GnuPG with Thunderbird -
http://www.enigmail.net/
iQIcBAEBAgAGBQJRXbsnAAoJEM2sO9pIirXjGLkP/jwf6IHqGMcaa8/RTeLsCDA2
x4UgzURBQwqP0viaYM2/qJ+EdLavGllwwYnwNlP1Cz8W3vDiGpYRxkZZGUnWPikz
arPBVtBQTcIIcvyokUKSLjlooh/fBMCspv6XnfWAw3wUCERD56/RScn/rw5ZvHoA
ivz6ap+6NF+3UGAg05VVm2GN82ZbszRD99iC771XsSD25D7WF3REzRtRgQBH0hhh
8k06xUd82LxX+rOAl70FHFMjKIXptMX2faWZBrQYrL/8wPxhW0kiaC12HuQE9xlr
enFvvg+u+fHwOgKExVmJuRzYUSlzHR3IOTi7mqmB3n1N+fjQTYdyX7GHVYUngVEM
yRwfd7B5/Wb4c26cBgq4X+2eyUB8VFVeG4rLaslF6G89z1M947SKwvq+BCgZGFq+
7oHDEr1mklikMSen3aS7pDXK4gQnnfTWcqUxY3WcaFEryeVwIcPvstcdT2g0Z0bd
XVMV9WT34iyUvoXlWRh6t7x92dMVBE9mkm1T6Z6b6iF/VDkgJPH0m5/8lsOXXpXO
08mjNrnXErebOWT3CAZorTlFdq4eFH63lBXXZKhUz4OcGNkj8AqjCEwGZwxBQ+8n
QAoUyC7GUbO6LW49z1L7um/R/0FeDLllZ8yRr6ink+Juf3QXD/TQ1Ityw8vRisxR
BlItyRAliReiaUc/t3eQ
=XQxa
-----END PGP SIGNATURE-----