简体   繁体   English

从事多个leiningen项目

[英]Working on a multiple leiningen project

I'm building a web apps that uses http-kit and clojurescript. 我正在构建一个使用http-kit和clojurescript的Web应用程序。 At some point, I want to separate the front and back each into a lein project on its own. 在某个时候,我想将正面和背面分别分离成一个lein项目。 The scenario is: 该方案是:

  1. For the front, if on development mode, uses a lein ring server to serve directory and the app will display a mock data. 对于前端,如果处于开发模式,则使用lein ring server提供目录,该应用将显示模拟数据。

  2. The back will serve any resources/public in the front lein project. 背面将为正面lein项目中的任何resources/public服务。

I'm thinking of doing a nested lein project, but not sure how to handle it. 我正在考虑做一个嵌套的lein项目,但不确定如何处理它。 Any suggestion or pointer is very much appreciated. 非常感谢任何建议或指示。

The way your question is posted it is not very clear " why two projects?". 您的问题的发布方式还不清楚“ 为什么要有两个项目?”。 It seems that you may be confusing different projects with different profiles , eg .. classpaths? 看来您可能会混淆具有不同配置文件的不同项目,例如..classpaths?

In order to work with multiple lein projects at once, similar to the way you would work with master pom => child poms with maven, there is a lein-sub . 为了一次处理多个lein项目,类似于使用maven使用master pom => child poms的方式 ,有一个lein-sub

But in your case, it seems that what you want is different lein profiles , classpaths. 但是在您的情况下,您似乎想要的是不同的lein配置文件 ,类路径。 Take a look at lein profiles documentation, it should solve "in dev do this, in test do this, in production do this" behavior you are after. 看一下lein配置文件,它应该解决“在开发中执行此操作,在测试中执行此操作,在生产中执行此操作”的行为。

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

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