简体   繁体   English

Leiningen 和 Clojure CLI 工具之间有什么区别,我应该如何使用它们?

[英]What's the difference between Leiningen and Clojure CLI tools and how should I use them?

I'm playing around with Clojure recently.我最近在玩 Clojure。 The most loved dependency management tool in the Clojure ecosystem is Leiningen to my knowledge.据我所知,Clojure 生态系统中最受欢迎的依赖管理工具是 Leiningen。 But I also found Clojure has provided CLI tools which probably could replace Leiningen.但我也发现 Clojure 提供了CLI 工具,可能可以替代 Leiningen。 Due to the limitation of experience in Clojure, I do not quite understand the difference between Leiningen and those CLI tools.由于Clojure经验的限制,我不太明白Leiningen和那些CLI工具的区别。 I heard those CLI tools is much lightweight, what does it mean?我听说那些 CLI 工具非常轻量级,这是什么意思? How should I use them?我应该如何使用它们?

CLI tools are more limited in scope than Leiningen - it's a small tool which you can use to launch a REPL quickly. CLI 工具的范围比 Leiningen 更有限——它是一个小工具,可用于快速启动 REPL。 Combined with tools.deps.alpha it can be used to run code and pull in 3rd party dependencies.tools.deps.alpha结合使用,它可用于运行代码并引入 3rd 方依赖项。 You can read more about it here .您可以在此处阅读更多相关信息。

Leiningen can do all of that, plus:莱宁根可以做到这一切,此外:

  • create deployment artifacts (uberjars)创建部署工件(uberjars)
  • start a REPL server or connect to a running one启动 REPL 服务器或连接到正在运行的服务器
  • manage mixed projects (for example Clojure + Java or Clojure + Clojurescript)管理混合项目(例如 Clojure + Java 或 Clojure + Clojurescript)
  • run arbitrary tasks in your project在您的项目中运行任意任务
  • manage dependencies管理依赖
  • plugin support (linters, deployment tools)插件支持(linters、部署工具)
  • integrate with Maven与 Maven 集成

The Lein repository includes a sample project file, sample.project.clj , which is a bit overwhelming but shows all the things Lein can do. Lein 存储库包含一个示例项目文件sample.project.clj ,这有点让人不知所措,但显示了 Lein 可以做的所有事情。

At this point, Lein is more useful for building applications and libraries - as it has all the features you might need to do that.在这一点上,Lein 对构建应用程序和库更有用——因为它具有您可能需要的所有功能。 That said, CLI tools + tools.deps is quickly gaining traction and there are projects which add all the missing bits from Leiningen, but you have to combine them yourself.也就是说,CLI 工具 + tools.deps正在迅速获得关注,并且有一些项目添加了 Leiningen 的所有缺失部分,但您必须自己将它们组合起来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM