Skip to content

Commit

Permalink
0.7.1 Omitting :dirs will use system classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Jun 11, 2024
1 parent 68ed989 commit 7558d0e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.7.1 - June 11, 2024

- Omitting `:dirs` will use system classpath
- Add `clj-reload.core/classpath-dirs`

# 0.7.0 - May 4, 2024

- [ BREAKING ] `:only` argument will force load unloaded namespaces, but will not reload unchanged ones
Expand Down
5 changes: 2 additions & 3 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{:jvm-opts ["-Duser.language=en" "-Duser.country=US" "-Dfile.encoding=UTF-8"]
:deps
{:deps
{org.clojure/clojure {:mvn/version "1.11.3"}}
:aliases
{:dev
{:jvm-opts ["-ea"]
{:jvm-opts ["-ea" "-Duser.language=en" "-Duser.country=US" "-Dfile.encoding=UTF-8"]
:extra-paths ["dev" "test" "fixtures/core_test" "fixtures/keep_test"]
:extra-deps
{org.clojure/tools.namespace {:mvn/version "1.5.0"}}}}}
10 changes: 8 additions & 2 deletions src/clj_reload/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
:to-load' nses-load}))

(defn find-namespaces
"Returns namespaces matching regex, or all of them"
([]
(find-namespaces #".*"))
([regex]
Expand All @@ -130,6 +131,11 @@
{:keys [namespaces']} (scan-impl files 0)]
(into #{} (filter #(re-matches regex (name %)) (keys namespaces')))))))

(def ^{:doc "Returns dirs that are currently on classpath"
:arglists '([])}
classpath-dirs
util/classpath-dirs)

(defn init
"Options:
Expand All @@ -145,7 +151,7 @@
[opts]
(with-lock
(binding [util/*log-fn* nil]
(let [dirs (vec (:dirs opts))
(let [dirs (vec (or (:dirs opts) (classpath-dirs)))
files (or (:files opts) #".*\.cljc?")
now (util/now)]
(alter-var-root #'*config*
Expand Down Expand Up @@ -394,4 +400,4 @@
;; See https://github.com/tonsky/clj-reload/pull/4
;; and https://github.com/clojure-emacs/cider-nrepl/issues/849
(init
{:dirs (util/classpath-dirs)})
{:dirs (classpath-dirs)})

0 comments on commit 7558d0e

Please sign in to comment.