我在文档中找不到它(或者,更有可能是我错过了),所以我认为这些是步骤:
将现有的 Erlang 应用程序(或使用
rebar3 new app
创建一个新应用程序)复制到<umbrella_root>/apps/
中(或<umbrella_root>/libs/
将新应用添加到
relx
<umbrella_root>/rebar.config
中的部分:{ 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} ] }.
将新应用所需的配置环境变量添加到
<umbrella_root>/config/sys.config
.如果新应用使用插件,请在
<umbrella_root>/apps/<new_app>/rebar.config
中配置它.
我接近了吗?如果是,是否意味着伞式应用程序可以嵌套? (这可能应该是一个单独的问题)。
最佳答案
是的,这就是您在发布中包含应用文件所需的一切。
关于嵌套伞应用,请看下面thread in rebar3's site
编辑:
链接的线程讨论了将 umbrella 应用程序作为依赖项,rebar3 不支持。引用:
Umbrella applications of that form are just not supported as dependencies. 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.
这并不意味着你不能使用一些技巧,比如使用 git 子模块和多个 project_app_dirs在根目录下配置。对于 rebar3,这些应用程序将是本地应用程序,但您需要从“外部”rebar3 处理它们(不是真正的“嵌套”保护伞应用程序)。
关于erlang - 如何将新的 Erlang 应用程序添加到 Rebar3 伞式项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63528034/