Skip to content

Commit

Permalink
Change default directories to be under target
Browse files Browse the repository at this point in the history
The default output directory is now target/austin/repl and the static
dir is target/austin/out.

This allows the directories to be cleaned by the default lein clean
task.

Fixes cemerick#14
  • Loading branch information
hugoduncan committed Aug 28, 2014
1 parent a2e09b2 commit 31923b4
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/clj/cemerick/austin.clj
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ function."
(defn- always-preload
"Return a list of all namespaces which are always loaded into the browser
when using a browser-connected REPL."
[]
(let [cljs (provides-and-requires (cljsc/cljs-dependencies {} ["clojure.browser.repl"]))
goog (provides-and-requires (cljsc/js-dependencies {} cljs))]
[opts]
(let [cljs (provides-and-requires (cljsc/cljs-dependencies opts ["clojure.browser.repl"]))
goog (provides-and-requires (cljsc/js-dependencies opts cljs))]
(disj (set (concat cljs goog)) nil)))

(defn repl-env
Expand All @@ -377,11 +377,11 @@ function."
session-id: The id of the (pre-existing) session to bind to
working-dir: The directory where the compiled REPL client JavaScript will
be stored. Defaults to \".repl\".
be stored. Defaults to \"target/austin/repl\".
serve-static: Should the REPL server attempt to serve static content?
Defaults to true.
static-dir: List of directories to search for static content. Defaults to
[\".\" \"out/\"].
[\".\" \"target/austin/out/\"].
preloaded-libs: List of namespaces that should not be sent from the REPL server
to the browser. This may be required if the browser is already
loading code and reloading it would cause a problem.
Expand All @@ -398,9 +398,9 @@ function."
(env/with-compiler-env (env/default-compiler-env opts)
(let [opts (merge (BrowserEnv.)
{:optimizations :simple
:working-dir ".repl"
:working-dir "target/austin/repl"
:serve-static true
:static-dir ["." "out/"]
:static-dir ["." "target/austin/out/"]
:preloaded-libs []
:src "src/"
:host "localhost"
Expand All @@ -414,8 +414,10 @@ function."
:repl-url repl-url
:entry-url (str repl-url "/start")
:working-dir (str (:working-dir opts) "/" session-id))
preloaded-libs (set (concat (always-preload)
(map str (:preloaded-libs opts))))]
preloaded-libs (set
(concat
(always-preload {:output-dir (:working-dir opts)})
(map str (:preloaded-libs opts))))]
(swap! sessions update-in [session-id] #(merge %2 %)
(assoc session-init
:ordering (agent {:expecting nil :fns {}})
Expand Down

0 comments on commit 31923b4

Please sign in to comment.