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

0s7z1bwu  于 2022-12-08  发布在  Erlang
关注(0)|答案(1)|浏览(159)

我在文档中找不到它(或者,更有可能的是,我错过了它),所以我假设这些是步骤:
1.将现有Erlang应用程序(或使用rebar3 new app创建新应用程序)复制到<umbrella_root>/apps/(或<umbrella_root>/libs/
1.将新应用程序添加到<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}
   ]
 }.

1.将新应用程序所需的配置环境变量添加到<umbrella_root>/config/sys.config
1.如果新应用使用插件,请在<umbrella_root>/apps/<new_app>/rebar.config中配置它。
如果是,这是否意味着伞式应用程序可以嵌套?(这可能是一个单独的问题)。

2ledvvac

2ledvvac1#

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

EDIT:

The linked thread talks about having umbrella apps as dependencies, which is not supported by rebar3. Quote:
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.
That does not mean that you cannot use some tricks, like using git submodules and multiple project_app_dirs configured in the root. For rebar3 those apps will be local apps, you'll need to handle them from 'outside' rebar3, though (not really 'nested' umbrella applications).

相关问题