Commits

Meikel Brandmeyer  committed 2262696

Switch repl task to options maps

  • Participants
  • Parent commits 42cc9ce

Comments (0)

Files changed (2)

File clojuresque-nrepl-runtime/src/main/resources/clojuresque/tasks/repl.clj

 (ns clojuresque.tasks.repl
   (:require
-    [clojuresque.cli :as cli]
     [clojuresque.util :as util]
     [clojure.tools.nrepl.server :as repl]))
 
 (def barrier (promise))
 (def server nil)
 
-(cli/deftask start-repl
-  "Start a nrepl server on the given port. An optional handler
-  may be given as fully-qualified symbol. The repl server may
-  be stopped via clojuresque.tasks.repl/stop-server."
-  [[port     p "server port"]
-   [handler  h "handler function" nil]]
+(util/deftask start-repl
+  [{:keys [port handler]}]
   (let [p (Long/parseLong port)
         h (if handler
             (let [custom-handler (util/resolve-required handler)]

File clojuresque-nrepl/src/main/groovy/clojuresque/tasks/ClojureRepl.groovy

 
 package clojuresque.tasks
 
+import clojuresque.Util
+
 import kotka.gradle.utils.ConfigureUtil
 import kotka.gradle.utils.Delayed
 
 
     @TaskAction
     void startRepl() {
-        def options = [ "--port", port ]
-        if (handler != null)
-            options += [ "--handler", handler ]
+        def options = [
+            port:    port,
+            handler: handler
+        ]
 
         project.clojureexec {
-            ConfigureUtil.configure delegate, this.jvmOptions
-            classpath = this.classpath
+            ConfigureUtil.configure delegate, this.getJvmOptions()
+            classpath = this.getClasspath()
             main = "clojuresque.tasks.repl/start-repl"
-            args = options
+            standardInput = Util.optionsToStream(options)
         }
     }
 }