better nrepl.

This commit is contained in:
Bryce Covert
2015-11-10 18:50:02 -08:00
parent 7b3c875fda
commit b29b980027
2 changed files with 18 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
(ns advent.core.desktop-launcher
(:require [advent.core :refer :all]
[advent.utils :as utils]
#_[clojure.tools.nrepl.server])
)
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication LwjglApplicationConfiguration]
[org.lwjgl.input Keyboard]
[com.badlogic.gdx Gdx])
@@ -9,18 +9,22 @@
(defn -main
[& [port]]
#_(try
(when port (let [{port :port} (clojure.tools.nrepl.server/start-server :port (Integer/parseInt port))]
(doseq [port-file ["target/repl-port" ".nrepl-port"]]
(-> port-file
java.io.File.
(doto .deleteOnExit)
(spit port)))
(println "Started nREPL server on port" port)))
(catch Exception e))
(when (System/getProperty "use-repl")
(eval `(require 'clojure.tools.nrepl.server))
(eval `(try
(when ~port (let [{port# :port} (clojure.tools.nrepl.server/start-server :port (Integer/parseInt ~port))]
(doseq [port-file# ["target/repl-port" ".nrepl-port"]]
(-> port-file#
java.io.File.
(doto .deleteOnExit)
(spit port#)))
(println "Started nREPL server on port" port#)))
(catch Exception e#))))
(let [cfg (LwjglApplicationConfiguration.)]
(if false