parent
828a5875d8
commit
8b9d66cd7c
2 changed files with 22 additions and 16 deletions
|
@ -679,25 +679,27 @@
|
|||
(utils/error "cannot resolve" hook-name "hook"))))
|
||||
|
||||
(defn load-hooks [project & [ignore-missing?]]
|
||||
(when (and (:implicits project true) (:implicit-hooks project true))
|
||||
(doseq [hook-name (concat (plugin-hooks project) (:hooks project))]
|
||||
;; if hook-name is just a namespace assume hook fn is called activate
|
||||
(let [hook-name (if (namespace hook-name)
|
||||
hook-name
|
||||
(symbol (name hook-name) "activate"))]
|
||||
(load-hook hook-name)))
|
||||
(load-hook hook-name))))
|
||||
project)
|
||||
|
||||
(defn apply-middleware
|
||||
([project]
|
||||
(reduce apply-middleware project
|
||||
(concat (plugin-middleware project)
|
||||
(:middleware project))))
|
||||
(concat (plugin-middleware project) (:middleware project))))
|
||||
([project middleware-name]
|
||||
(if (and (:implicits project true) (:implicit-middleware project true))
|
||||
(if-let [middleware (utils/require-resolve middleware-name)]
|
||||
(middleware project)
|
||||
(do (when-not (:optional (meta middleware-name))
|
||||
(utils/error "cannot resolve" middleware-name "middleware"))
|
||||
project))))
|
||||
project))
|
||||
project)))
|
||||
|
||||
(defn load-certificates
|
||||
"Load the SSL certificates specified by the project and register
|
||||
|
|
|
@ -165,10 +165,14 @@
|
|||
:repl {:plugins [[cider/cider-nrepl "0.7.1"]]}}
|
||||
;; Load these namespaces from within Leiningen to pick up hooks from them.
|
||||
:hooks [leiningen.hooks.difftest]
|
||||
;; Apply these middleware functions from plugins to your project when it
|
||||
;; loads. Both hooks and middleware can be loaded implicitly by giving them a
|
||||
;; name matching a specific pattern as well as by listing them here.
|
||||
;; Apply these middleware functions from plugins to your project
|
||||
;; when it loads. Both hooks and middleware can be loaded implicitly
|
||||
;; or by being listed here.
|
||||
:middleware [lein-xml.plugin/middleware]
|
||||
;; These settings disable the implicit loading of middleware and
|
||||
;; hooks, respectively. You can disable both with :implicits false.
|
||||
:implicit-middleware false
|
||||
:implicit-hooks false
|
||||
|
||||
;;; Entry Point
|
||||
;; The -main function in this namespace will be run at launch
|
||||
|
|
Loading…
Reference in a new issue