I’m using Gradle + the Clojuresque plugin for a large and complicated project. It would be desirable to be able to type “gradle :subproject:repl” and have the REPL fired up with all dependencies of “:subproject” on the classpath.
So far I have this:
task repl(type: JavaExec) {
group "Other"
description "Launches a Clojure REPL with the ${project} testCompile classpath"
classpath configurations.testCompile
classpath sourceSets.main.clojure.srcDirs
classpath sourceSets.test.clojure.srcDirs
main "clojure.main"
}
That builds the right command and the REPL starts, then immediately shuts down:
Starting process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_12.jdk/Contents/Home/bin/java''. Working directory: /Users/hlship/workspaces/annadale/nexus/core-services Command: /Library/Java/JavaVirtualMachines/jdk1.7.0_12.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -cp /Users/hlship/workspaces/annadale/nexus/util/logging/build/l ... f9f135bf4/jackson-dataformat-smile-2.0.4.jar:/Users/hlship/workspaces/annadale/nexus/core-services/src/main/clojure:/Users/hlship/workspaces/annadale/nexus/core-services/src/test/clojure clojure.main An attempt to initialize for well behaving parent process finished. Successfully started process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_12.jdk/Contents/Home/bin/java'' Clojure 1.4.0 user=> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_12.jdk/Contents/Home/bin/java'' finished with exit value 0 (state: SUCCEEDED) BUILD SUCCESSFUL
Any advice on how to, say, set JavaExec.inputStream to read from the console?