;; Debian adjustments for project.clj

(require '[debian.dh-clojure-lein.client :as deb])

(defn adjust-deps [deps proj]
  "Drop dependency on criterium."
  (cond-> deps
          (deb/get-dep deps 'criterium) (deb/del-dep 'criterium)))

(defn dh-clj-adjust-project [project when & _]
  "Drop lein-codox plugin and process dependencies."
  (case when
    :before-plugins
    (-> (project)
        (update :plugins deb/del-dep 'lein-codox))
    :after-middleware
    (-> (project)
        (update :dependencies adjust-deps project))
    (project)))
