(load-foreign-library* lib-spec)
(load-foreign-library* lib-spec cp-only?)
Given a library spec (a map containing the keys :file
and :provides), returns a map containing :provides, :requires, :file
and :url
Source
(defn load-foreign-library*
"Given a library spec (a map containing the keys :file
and :provides), returns a map containing :provides, :requires, :file
and :url"
([lib-spec] (load-foreign-library* lib-spec false))
([lib-spec cp-only?]
(let [find-func (if cp-only? io/resource find-url)]
(cond-> (assoc lib-spec :foreign true)
(:file lib-spec)
(assoc :url (find-func (:file lib-spec)))
(:file-min lib-spec)
(assoc :url-min (find-func (:file-min lib-spec)))))))