    [boot.core          :as b]
    [clojure.java.io    :as io]
    [clojure.set        :as set]
-   [clojure.string     :as string]
    [boot.pod           :as pod]
    [boot.file          :as file]
    [boot.util          :as util]

  [b ids BUILD_IDS #{str} "Only inject reloading into these builds (= .cljs.edn files)"
   i ip ADDR         str  "The (optional) IP address for the websocket server to listen on."
   p port PORT       int  "The (optional) port the websocket server listens on."
   d domain DOMAIN   str  "The (optional) server domain name to pass through requests."
   j on-jsload SYM   sym  "The (optional) callback to call when JS files are reloaded."
   a asset-path PATH str  "The (optional) asset-path. This is removed from the start of reloaded urls."]


         (sort-by :dependency-order)
         (map tmp-path))))

(defn- start-server [pod {:keys [ip port ws-host] :as opts}]
  (let [{:keys [ip port]}
        (pod/with-call-in pod (adzerk.boot-reload.server/start ~opts))
        host
        (cond ws-host ws-host (= ip "0.0.0.0") "localhost" :else ip)]
    (util/with-let [url (format "ws://%s:%d" host port)]
      (util/info "<< started reload server on %s >>\n" url))))

