From 6178eea319be8526f9628f0d9796f3758de7c742 Mon Sep 17 00:00:00 2001 From: Marco Biscaro Date: Mon, 14 Aug 2023 19:17:01 -0300 Subject: [PATCH] fix: Preserve exclusions in leiningen plugin Carry exclusions metadata from dependencies when using antq as a leiningen plugin. Fixes https://github.com/liquidz/antq/issues/231. --- src/antq/dep/leiningen.clj | 2 +- src/leiningen/antq.clj | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/antq/dep/leiningen.clj b/src/antq/dep/leiningen.clj index eb0c4dc5..17dc8547 100644 --- a/src/antq/dep/leiningen.clj +++ b/src/antq/dep/leiningen.clj @@ -27,7 +27,7 @@ (get const/deps-exclude-key) (true?))) -(defn- exclude-version-range +(defn exclude-version-range [v] (-> (meta v) (get const/deps-exclude-key) diff --git a/src/leiningen/antq.clj b/src/leiningen/antq.clj index cbc61544..4d17175b 100644 --- a/src/leiningen/antq.clj +++ b/src/leiningen/antq.clj @@ -29,14 +29,15 @@ (into managed-dependencies) (into plugins) (distinct) - (keep (fn [[dep-name version]] + (keep (fn [[dep-name version :as dep]] (when (dep.lein/acceptable-version? version) (r/map->Dependency {:project :leiningen :type :java :file "project.clj" :name (dep.lein/normalize-name dep-name) :version version - :repositories repos})))) + :repositories repos + :exclude-versions (seq (dep.lein/exclude-version-range dep))})))) (antq.core/antq options))] (report/reporter outdated options)