Skip to content

Commit

Permalink
Resolve :paths defined as aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
vemv committed Nov 13, 2023
1 parent 92bc201 commit 5bedde4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools.deps/src/cider/enrich_classpath/clojure.clj
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@
mv))
libs)
paths (into paths extra-paths)
paths (into []
(mapcat (fn [path]
(if (keyword? path)
(get-in basis [:aliases path] path)
(vector path))))
paths)
original-paths-set (set paths)
original-deps-set (->> original-deps (map first) set)
shortened-jar-signature (string/join File/separator
Expand Down
5 changes: 5 additions & 0 deletions tools.deps/test-resources/path-aliases/deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{:paths [:clj-paths]
:deps {}
:aliases {:clj-paths ["the-main-source-path"]
:cljs-paths ["the-other-source-path"]
:cljc-paths {:extra-paths [:cljs-paths]}}}
16 changes: 16 additions & 0 deletions tools.deps/test/integration/cider/enrich_classpath/clojure.clj
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,22 @@
(is (string/includes? cp "-e \"(println \\\"foo\\\")\"")
"Escapes the -e value")))

(deftest path-aliases
(let [cp (sut/impl "clojure"
"deps.edn"
(str (io/file (System/getProperty "user.dir") "test-resources" "path-aliases"))
[]
true)]
(is (string/includes? cp "the-main-source-path")
"Resolves `:paths` defined as aliases"))
(let [cp (sut/impl "clojure"
"deps.edn"
(str (io/file (System/getProperty "user.dir") "test-resources" "path-aliases"))
["-A:cljc-paths"]
true)]
(is (string/includes? cp "the-main-source-path:the-other-source-path")
"CLI aliases can use `:paths` aliases too")))

(when-not (jdk/jdk8?)
(deftest jvm-opts
(testing "https://github.com/clojure-emacs/enrich-classpath/issues/56"
Expand Down

0 comments on commit 5bedde4

Please sign in to comment.