关于clojure:project.clj了解一些部分

project.clj understanding some parts

我使用duct lein模板创建一个Web应用程序。

现在,我正在查看project.clj以了解其工作原理。

但是我不知道我是否正确地理解了这部分内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
 {:dev  [:project/dev  :profiles/dev]
   :test [:project/test :profiles/test]
   :uberjar {:aot :all}
   :profiles/dev  {}
   :profiles/test {}
   :project/dev   {:dependencies [[duct/generate"0.6.1"]
                                  [reloaded.repl"0.2.1"]
                                  [org.clojure/tools.namespace"0.2.11"]
                                  [org.clojure/tools.nrepl"0.2.12"]
                                  [eftest"0.1.1"]
                                  [kerodon"0.7.0"]]
                   :source-paths ["dev"]
                   :repl-options {:init-ns user}
                   :env {:port"3000"}}

例如:

[:project/dev :profiles/dev]是什么意思? 以及为什么我有:dev键和:project/dev键。
我知道这可能与profiles.clj文件有关。 但是我并没有真正理解它。

也许我的问题似乎有点愚蠢,但我希望自己已经清楚了。


在复合配置文件中对此进行了描述:

Sometimes it is useful to define a profile as a combination of other
profiles. To do this, just use a vector instead of a map as the
profile value. This can be used to avoid duplication:

1
2
3
4
{:shared {:port 9229, :protocol"https"}
 :qa [:shared {:servers ["qa.mycorp.com"]}]
 :stage [:shared {:servers ["stage.mycorp.com"]}]
 :production [:shared {:servers ["prod1.mycorp.com","prod1.mycorp.com"]}]}