make-model

leiningen.pom

  • (make-model project)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source leiningen/pom.clj:134 top

(defn make-model [project]
  (let [model (doto (Model.)
                (.setModelVersion "4.0.0")
                (.setArtifactId (:name project))
                (.setName (:name project))
                (.setVersion (:version project))
                (.setGroupId (:group project))
                (.setDescription (:description project))
                (.setUrl (:url project)))
        build (doto (Build.)
                (.setSourceDirectory (relative-path project :source-path))
                (.setTestSourceDirectory (relative-path project :test-path)))]
    (.setBuild model build)
    (doseq [dep (:dependencies project)]
      (.addDependency model (make-dependency dep)))
    (doseq [repo (concat (:repositories project) default-repos)]
      (.addRepository model (make-repository repo)))
    (when-let [scm (make-git-scm (file (:root project) ".git"))]
      (.setScm model scm))
    (doseq [license (concat (keep #(% project)
                                  [:licence :license])
                            (:licences project)
                            (:licenses project))]
      (.addLicense model (make-license license)))
    (doseq [mailing-list (concat (if-let [ml (:mailing-list project)] [ml] [])
                                 (:mailing-lists project))]
      (.addMailingList model (make-mailing-list mailing-list)))
    model))
Vars in leiningen.pom/make-model: defn doseq let when-let
Used in 0 other vars

Comments top

No comments for make-model. Log in to add a comment.