自动化Leiningen本地依赖关系管理 [英] Automating Leiningen local dependency management

查看:176
本文介绍了自动化Leiningen本地依赖关系管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用一个本地maven存储库来容纳我用来开发项目的一些代码。我已经在我的 project.clj 文件中引用了这个仓库,现在我能够以这种方式依赖于本地jars(如何在前一个我的问题)。

I am using a local maven repository to house some code I am using to develop a project. I have cited this repository in my project.clj file, and am now able to rely on local jars in this way (how to do this in a previous question of mine).

由于我积极开发这些项目,我有我的 project.clj 文件寻找 LATEST 版本。但是,为了更新依赖,我仍然需要增加该依赖的版本号,然后运行 lein install 来构建它到maven存储库。

Since I am actively developing these projects, I have my project.clj file looking for the LATEST version. But, in order to update a dependency, I still have to increment the version number of that dependency and then run lein install to build it to the maven repository.

leiningen有办法做到这一点,当我构建的项目,这取决于从maven仓库的东西自动完成吗?

Does leiningen have a way to do this where this is automatically done for me when I build the project that depends on things from the maven repo? Can lein just look for those things and rebuild them as needed?

推荐答案

如果你想并行开发两个项目,根据其他,您可以在 checkouts 目录中使用符号链接,以避免一直安装快照。

If you want to develop two projects in parallel, with one depending on the other, you can use symlinks in a checkouts directory to avoid having to install snapshots all the time.

引用 Leiningen README


Q:我想并行地破解两个项目,但是在它们之间切换很麻烦。

A:使用一个名为checkout dependencies的功能。如果在项目根目录中创建一个名为checkouts的目录,并将一些其他项目根目录连接到其中,Leiningen将允许您并行地攻击它们。这意味着依赖的更改将在主项目中可见,而不必通过整个install / switch-projects / deps / restart-repl循环。请注意,这不是替代项目列表中的:dependencies;它只是补充了更紧密的更改周期。

Q: I want to hack two projects in parallel, but it's annoying to switch between them.
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天全站免登陆