;; Debian adjustments for project.clj

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

(defn dh-clj-adjust-project [project when & _]
  "Drop plugins and dependency on midje."
  (case when
    :before-plugins
    (-> (project)
        (update :plugins deb/del-dep 'lein-midje)
        (update :plugins deb/del-dep 'codox)
        (update :plugins deb/del-dep 'lein-ancient))
    :after-middleware
    (if (some #{:dev} (deb/active-profiles (project)))
      (update (project) :dependencies deb/del-dep 'midje)
      (project))
    (project)))
