Skip to content

Commit bae0ffa

Browse files
committed
Updated nrepl task
1 parent a1df031 commit bae0ffa

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

language-adaptors/rxjava-clojure/build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,26 @@ jar {
5050
instruction 'Fragment-Host', 'com.netflix.rxjava.core'
5151
}
5252
}
53+
54+
55+
////////////////////////////////////////////////////////////////////////////////
56+
// Define a task that runs an nrepl server. The port is given with the nreplPort
57+
// property:
58+
// gradlew nrepl -PnreplPort=9999
59+
// or put the property in ~/.gradle/gradle.properties
60+
61+
def nreplPortValue = (project.hasProperty('nreplPort') && !project.nreplPort.isEmpty()) ? project.nreplPort : '9999'
62+
configurations { nrepl }
63+
dependencies { nrepl 'org.clojure:tools.nrepl:0.2.2' }
64+
task nrepl(type: JavaExec) {
65+
classpath configurations.nrepl,
66+
project.sourceSets.main.clojure.srcDirs,
67+
project.sourceSets.test.clojure.srcDirs,
68+
sourceSets.main.runtimeClasspath,
69+
sourceSets.test.runtimeClasspath
70+
71+
main = "clojure.main"
72+
args '--eval', "(ns gradle-nrepl (:require [clojure.tools.nrepl.server :refer (start-server stop-server)]))",
73+
'--eval', "(println \"Starting nrepl server on port $nreplPortValue\")",
74+
'--eval', "(def server (start-server :port $nreplPortValue))"
75+
}

0 commit comments

Comments
 (0)