简体   繁体   English

如何将新的 Erlang 应用程序添加到 Rebar3 伞式项目?

[英]How to add new Erlang application to a Rebar3 umbrella project?

I couldn't find it in the docs (or, more probably, I missed it), so I presume these are the steps:我在文档中找不到它(或者,更可能的是,我错过了它),所以我认为这些是步骤:

  1. Copy existing Erlang application (or create a new one with rebar3 new app ) into <umbrella_root>/apps/ (or <umbrella_root>/libs/将现有的 Erlang 应用程序(或使用rebar3 new app创建一个新应用程序)复制到<umbrella_root>/apps/ (或<umbrella_root>/libs/

  2. Add the new app to the relx section in <umbrella_root>/rebar.config :将新应用程序添加到<umbrella_root>/rebar.config中的relx部分:

     { relx, [ {release, { your_big_project_name, "0.1.0" }, [ your_big_project_name_or_smth_else, the_newly_copied_app %, sasl ] }, {sys_config, "./config/sys.config"}, {vm_args, "./config/vm.args"}, {dev_mode, true}, {include_erts, false}, {extended_start_script, true} ] }.
  3. Add the new app's required configuration environment variables to <umbrella_root>/config/sys.config .将新应用所需的配置环境变量添加到<umbrella_root>/config/sys.config

  4. If the new app uses a plugin, configure it in <umbrella_root>/apps/<new_app>/rebar.config .如果新应用程序使用插件,请在<umbrella_root>/apps/<new_app>/rebar.config中配置它。

Am I close?我很接近吗? If yes, does that mean that umbrella applications can be nested?如果是,是否意味着伞式应用程序可以嵌套? (This should probably be a separate question). (这可能应该是一个单独的问题)。

Yes, that should be it all you need to include an app file in a release.是的,这就是您在发布中包含应用程序文件所需的全部内容。

Regarding nested umbrella applications, please have a look at the following thread in rebar3's site关于嵌套的 umbrella 应用程序,请查看rebar3 站点中的以下线程

EDIT:编辑:
The linked thread talks about having umbrella apps as dependencies, which is not supported by rebar3.链接的线程讨论了将 umbrella 应用程序作为依赖项,rebar3 不支持。 Quote:引用:

Umbrella applications of that form are just not supported as dependencies.这种形式的 Umbrella 应用程序不支持作为依赖项。 Handling versioning and locking for a single dependencies that contains multiple apps is not a thing we ever figured out, so it's just not doable.处理包含多个应用程序的单个依赖项的版本控制和锁定不是我们想出的事情,所以它是不可行的。

That does not mean that you cannot use some tricks, like using git submodules and multiple project_app_dirs configured in the root.这并不意味着您不能使用一些技巧,例如使用 git 子模块和在根目录中配置的多个project_app_dirs For rebar3 those apps will be local apps, you'll need to handle them from 'outside' rebar3, though (not really 'nested' umbrella applications).对于 rebar3,这些应用程序将是本地应用程序,但您需要从“外部”rebar3 处理它们(不是真正的“嵌套”保护伞应用程序)。

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

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