I noticed that when I run rebar3 new lib project_name that it includes an app.src file. I found this odd since the library won’t have any processes.
Could someone shed some light on this? Thanks!
I noticed that when I run rebar3 new lib project_name that it includes an app.src file. I found this odd since the library won’t have any processes.
Could someone shed some light on this? Thanks!
Simply, library is an application without starting point. It also has name, version, registered names and similar things mentioned in the .app.src file.
Build systems like rebar3 will use that file to generate the .app file inside ebin/ (check Erlang -- app). Alongside what was mentioned by @mmin, you’ll also be able to include metadata for Hex.pm publishing (Rebar3 publish package | Hex), default configurations options and start phases (not sure a lib. has these, though). If your lib. requires applications like crypto to be started, for example, this can also be included there, under key applications.
One can think of *.app.src file as “manifests” in other programming languages.