简体   繁体   English

使用父目录作为Leiningen依赖项?

[英]Using a parent directory as a Leiningen dependency?

I am working on a Clojure library. 我正在研究Clojure库。 Inside the library is an example app that shows how to use the library. 库内部是一个示例应用程序,显示了如何使用库。 In the example app, which is in a subdirectory, what is the cleanest way to depend on the parent library? 在子目录中的示例应用程序中,依赖父库的最干净方法是什么? I want this to be fast; 我希望这个很快。 I want the dependency always be in step with the current library code. 我希望依赖项始终与当前库代码保持一致。 That means avoiding deploying to Clojars (or elsewhere). 这意味着避免部署到Clojars(或其他地方)。

You can add "../src" to the :source-paths in project.clj 您可以在project.clj的:source-paths中添加“ ../src”

Since you always want the current version of the parent's code, and it will always be in the same relative place, it's less a "dependency" to be resolved and more a classpath to be used to find code. 由于您始终需要父代代码的当前版本,并且始终处于相同的相对位置,因此可以解决的不是依赖关系,而更多的是用于查找代码的类路径。

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

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