Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add new Erlang application to a Rebar3 umbrella project?

Tags:

erlang

rebar3

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/

  2. Add the new app to the relx section in <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}
       ]
     }.
    
  3. Add the new app's required configuration environment variables to <umbrella_root>/config/sys.config.

  4. If the new app uses a plugin, configure it in <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).

like image 572
toraritte Avatar asked Sep 11 '25 15:09

toraritte


1 Answers

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).

like image 171
José M Avatar answered Sep 14 '25 09:09

José M