Skip to content

Commit

Permalink
Fix bug in TDEPS-256 change for :project usin relative dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
puredanger committed Jan 7, 2024
1 parent d81c714 commit e0217fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Changelog

*Also see [Tools and installer changelog](https://github.com/clojure/brew-install/blob/1.11.1/CHANGELOG.md)*

* next
* Fix bug in TDEPS-256 change for :project usin relative dirs
* 0.18.1398 on Jan 4, 2023
* Fix function spec typo
* 0.18.1394 on Dec 29, 2023
Expand Down
13 changes: 9 additions & 4 deletions src/main/clojure/clojure/tools/deps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -790,13 +790,15 @@
(defmacro ^:private in-project-dir
"If project deps.edn is not in the current dir, push project directory
into current directory context while creating basis. Local deps use paths
relative to project dir."
relative to project dir. Use anaphoric 'assumed-project in body."
[project-deps & body]
`(if (and (instance? String ~project-deps)
(not (.equals dir/*the-dir* (.getParentFile (jio/file ~project-deps)))))
(dir/with-dir (.getParentFile (jio/file ~project-deps))
~@body)
(do ~@body)))
(let [~'assumed-project (.getName (jio/file ~project-deps))]
~@body))
(let [~'assumed-project ~project-deps]
~@body)))

(defn create-basis
"Create a basis from a set of deps sources and a set of aliases. By default, use
Expand Down Expand Up @@ -834,7 +836,10 @@
:classpath-roots - vector of paths in classpath order"
[{:keys [root user project extra aliases] :as params}]
(in-project-dir project
(let [basis-config (cond-> nil
(let [project assumed-project ;; use anaphoric for project deps in context of project dir
params (cond-> params (contains? params :project) (assoc :project project))

basis-config (cond-> nil
(contains? params :root) (assoc :root root)
(contains? params :project) (assoc :project project)
(contains? params :user) (assoc :user user)
Expand Down

0 comments on commit e0217fd

Please sign in to comment.