How To: Start a REPL via aGradle Task

There is an old post that is relevant to the topic.
It specifically referred to starting a Clojure REPL.
I am particularly interested in starting a Groovy repl suitable for running Gremlin.
At the time of that post the following was close to working:

task repl(type: JavaExec) {
    group "Other"
    description "Launches a Clojure REPL with the ${project} testCompile classpath"
      classpath configurations.testCompile
    classpath sourceSets.main.gremlin.srcDirs
    classpath sourceSets.test.gremlin.srcDirs
    main "gremlin.main"

Is there a way to suppress the Gradle status line, as well as true console support (arrow keys etc.)?

I wouldn’t try to start the repl from Gradle right now. For it to work at all, you have to disable the daemon, which I wouldn’t recommend.

I would try to generate a start script and run that outside of Gradle. You could run that task in continuous build and just stop/start the repl with the script.

1 Like