Created
August 18, 2015 06:01
-
-
Save tnoda/f53638d3ed52ee2049c8 to your computer and use it in GitHub Desktop.
Spigot サーバに Clojure の REPL を組み込んで立ち上げる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns tnoda.iwami | |
(:gen-class) | |
(:import (org.bukkit.craftbukkit Main)) | |
(:require [clojure.tools.nrepl.server :as nrepl-server])) | |
(defonce server (atom nil)) | |
(defn- nrepl-host | |
[] | |
(or (System/getenv "NREPL_HOST") "127.0.0.1")) | |
(defn- nrepl-port | |
[] | |
(if-let [env (System/getenv "NREPL_PORT")] | |
(Long/parseLong env) | |
7888)) | |
(defn -main | |
[& args] | |
(reset! server (nrepl-server/start-server :bind (nrepl-host) | |
:port (nrepl-port))) | |
(Main/main (doto (make-array String 3) | |
(aset 0 "--noconsole") | |
(aset 1 "--host") | |
(aset 2 "127.0.0.1")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment