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

查看:107
本文介绍了如何设置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.

这是一个用例:

运行lein swank后,从emacs内部,我连接到repl并编译一个文件mywebapp(with Cck),这需要一个来自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.

这是可能在leiningen吗?

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

推荐答案

这个问题来自 Lein常见问题帮助?


Q :我想要并行攻击两个项目,但是很难在他们之间切换。

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

>:使用称为检出依赖关系的功能。如果你在你的项目根目录和符号链接中创建一个名为checkouts的目录,一些其他
项目根入它,Leiningen将允许你在
parallel中对它们进行攻击。这意味着依赖的更改将在
主项目中可见,而不必通过整个
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天全站免登陆