Erlang、Rebar 和具有多个应用程序的程序组织

Posted

技术标签:

【中文标题】Erlang、Rebar 和具有多个应用程序的程序组织【英文标题】:Erlang, Rebar and organization of programs with multiple applications 【发布时间】:2014-04-01 15:03:31 【问题描述】:

我正在着手一个包含多个应用程序的大型项目;想知道如何在 Rebar 下最好地组织它。我目前的想法如下。这是一个令人满意的解决方案还是有更好的方案?

project_root_dir
   apps 
      application1 
      application2
      ...       
   deps
      dep1
      dep2
      ...
   rebar.config

rebar.config 的样子:

sub_dirs, ["apps/application1",
            "apps/application2",
            ...
           ].

lib_dirs, ["deps"].
deps, [dep1,
        dep2,
        ...
        ].

非常感谢您的指导。

LRP

【问题讨论】:

此配置中lib_dirs 选项没有必要。 大部分项目都是这样排列的。你不需要lib_dirs。看看@basho github 项目以获得灵感。您还应该通过 reltool rel/files, rel/vars.config, rel/reltoo.config 添加一个版本 【参考方案1】:

另一种方法是将apps 中的每个应用程序保存在单独的存储库中,然后您可以拥有一个运行该版本的assembling 存储库。 Riak 是这样分布的。

【讨论】:

以上是关于Erlang、Rebar 和具有多个应用程序的程序组织的主要内容,如果未能解决你的问题,请参考以下文章