Last active
February 11, 2022 15:32
-
-
Save santanuchakrabarti/5784ac827c6ae1bcc17c to your computer and use it in GitHub Desktop.
Default Gradle build file to run nREPL server by Clojuresque
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
mavenCentral() | |
maven { url 'http://clojars.org/repo' } | |
} | |
dependencies { | |
classpath 'clojuresque:clojuresque:1.7.0' | |
} | |
} | |
apply plugin: 'clojure' | |
repositories { | |
mavenCentral() | |
maven { url 'http://clojars.org/repo' } | |
} | |
dependencies { | |
compile "org.clojure:clojure:1.6.0" | |
runtime "org.clojure:tools.nrepl:0.2.10" | |
} | |
clojureRepl { | |
port = "7888" | |
handler = "cider.nrepl/cider-nrepl-handler" | |
} | |
task nrepl(type: JavaExec) { | |
classpath project.sourceSets.main.clojure.srcDirs, | |
project.sourceSets.test.clojure.srcDirs, | |
sourceSets.test.runtimeClasspath, | |
sourceSets.main.runtimeClasspath | |
main = "clojure.main" | |
args '--eval', "(ns gradle-nrepl (:require [clojure.tools.nrepl.server :refer (start-server stop-server)] [cider.nrepl :refer (cider-nrepl-handler)]))", | |
'--eval', "(println \"Starting nrepl server on port 7888\")", | |
'--eval', "(def server (start-server :port 7888))" | |
} | |
task repl(type: JavaExec) { | |
classpath project.sourceSets.main.clojure.srcDirs, | |
project.sourceSets.test.clojure.srcDirs, | |
sourceSets.test.runtimeClasspath, | |
sourceSets.main.runtimeClasspath | |
//println classpath.asPath | |
main = "clojure.main" | |
standardInput = System.in | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing this. I had to change
port = "7888"
toport = 7888
i.e. no quotes, I was getting a String format exception from clojuresque-nrepl where it was trying to print the port as an integer.