Say I have a vanilla project.clj like
(defproject myservice "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:mailing-list {:name "myservice@example.com" :post "myservice@climate.com"}
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[ring/ring-core "1.4.0"]
[ring/ring-jetty-adapter "1.4.0"]
[compojure "1.4.0"]
[ring/ring-defaults "0.1.5"]
[org.clojure/tools.logging "0.3.1"]
[clj-http "2.0.0"]]
:plugins [[lein-ring "0.9.7"]]
:ring {:handler myservice.core/standalone-app
:port 3000}
:profiles {
:uberjar {:ring {:handler myservice.core/app}}}
)
In a lein repl
, can I lookup values from the project.clj? How? Of course my blind hack didn't work?
user=> (:mailing-list project)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: project in this context, compiling:(/private/var/folders/1g/fnytl2x93sx6hp2f1rsf4h1r5xtqv_/T/form-init6671981825845237047.clj:1:1)
The follow on question is can I use stuff from the project map further on in the project.clj? Like if I wanted to pull that mailing list :name out and substitute it in as a :deb :maintainer?
:deb
{:toDir "target"
:package "mysevice"
:maintainer {:name "Meeples", :email "myservice@example.com"}
...
}
I'm sure you can tell, I'm kind-of new to this, but the project.clj is just executable Clojure, no? If I knew the name of the project's map, I should be able to query it, right?