如何设置 leiningen 以处理多个项目? [英] How can I set up leiningen to work with multiple projects?

查看:24
本文介绍了如何设置 leiningen 以处理多个项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个独立的 leiningen 项目,这些项目表面上可以相互依赖.

I have multiple, separate leiningen projects that ostensibly could depend on one-another.

示例:

~/projects/mywebapp  (my own project)
~/projects/noir      (a clone of the github repo)
~/projects/clojureql (a clone of the github repo)

我想让它们同时编译到同一个 JVM 中.我想运行 git repos 的前沿(拉新提交/进行我自己的提交),而不必运行 lein jar 或 lein deps,如果我更改任何项目,当然不必重新启动 VM.

I want to have them all compiled into the same JVM at the same time. I would like to run the git repos bleeding edge (pulling new commits/making my own commits) and not have to run lein jar or lein deps and certainly not have to restart the VM if I change any of the projects.

这是一个用例:

在 emacs 中运行 lein swank 后,我连接到 repl 并从 mywebapp(使用 C-c-k)编译一个文件,这需要一个来自 noir 的文件.它在我的项目目录中找到文件的版本.后来,我打开那个文件,编辑它,然后编译它(用 C-c-k).

After running lein swank, from within emacs, I connect to the repl and compile a file from mywebapp (with C-c-k), which requires a file from noir. It finds the version of the file in my projects directory. Later, I open that file, edit it, and compile it (with C-c-k).

请注意,当我执行 git pull 时,我并没有要求自动编译.我只是不想重新启动 JVM 或执行冗长的 jar 编译过程.

Note that I'm not asking for auto-compiling when I do git pull. I just don't want to have to restart the JVM or do lengthy jar compiling processes.

这在莱宁根可以吗?我该如何设置?

Is this possible in leiningen? How can I set this up?

推荐答案

Does this question from the Lein FAQ 帮助?

Does this question from the Lein FAQ help?

Q:我想同时破解两个项目,但在它们之间切换很烦人.

Q: I want to hack two projects in parallel, but it's annoying to switch between them.

A:使用称为结帐依赖项的功能.如果您在项目根目录中创建一个名为 checkouts 的目录并符号链接其他一些项目根植于其中,Leiningen 将允许您破解它们平行线.这意味着依赖项的变化将在主项目无需走整体install/switch-projects/deps/restart-repl 循环.请注意,这不是在 :dependencies 中列出项目的替代品;它只是对更紧凑的变更周期进行补充.

A: Use a feature called checkout dependencies. If you create a directory called checkouts in your project root and symlink some other project roots into it, Leiningen will allow you to hack on them in parallel. That means changes in the dependency will be visible in the main project without having to go through the whole install/switch-projects/deps/restart-repl cycle. Note that this is not a replacement for listing the project in :dependencies; it simply supplements that for tighter change cycles.

这篇关于如何设置 leiningen 以处理多个项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆