made screen reloading middleware.

This commit is contained in:
Bryce Covert
2016-01-14 09:46:38 -08:00
parent 73d3bee5ca
commit 746082e120
7 changed files with 16 additions and 18 deletions

View File

@@ -9,22 +9,19 @@
(def has-nrepl?
(try
(require '[play-clj-nrepl.core :as a])
(System/getProperty "use-repl")
(catch Exception e
(println e)
false)))
(defn -main
[& [port]]
(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#))))
(when has-nrepl?
(play-clj-nrepl.core/start-nrepl advent.core/advent port))
(let [cfg (LwjglApplicationConfiguration.)]
#_(println (.exists (files! :classpath "icon/icon_128x128.png")))