문제

To add a dependency to a clojurescript project, you can include it with

:dependencies [[dependency/thing "0.0.1"]]

however, I have multiple targets in my leiningen file for clojurescript

:cljsbuild {
    :builds {
      :target1 {...}
      :target2 {...}}}

and I would like to have the dependency be only present for one of the two targets. Is there a way to do this?

도움이 되었습니까?

해결책

You can do this using leiningen profiles. For example, I have a test dependency in my :test profile that is used for my :test build but not for my regular build:

:cljsbuild {
  :builds {
    :main {...}
  }}

:profiles {
  :test {
    :dependencies [["test-dep" "1.0.0"]]
    :cljsbuild {
      :builds {
        :test {...}
  }}}}

The test dependency is only added to the project when the test profile is active, so it won't get added to your pom.xml file, for example, and it won't get compiled into your main build.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top