Reputation: 331
I found these description in the Erlang doc and learnyousomeerlang.com, but not sure which one is the "Application Resource File". When should I use .app and .app.src?
7.3 Application Resource File http://www.erlang.org/doc/design_principles/applications.html
The Application Resource File http://learnyousomeerlang.com/building-otp-applications
Upvotes: 9
Views: 2861
Reputation: 9648
The .app
file (in ebin/
) is the file necessary by the Erlang VM to load OTP applications. It must contain fields such as the dependencies of the application, the modules it contains, the version, and so on.
Particularly, the list of modules for the application is tedious to maintain, but there's other stuff that can be dynamically added. People write .app.src
files (in src/
) with the static content filled in so that their build tool of choice (rebar, rebar3, erlang.mk, and so on) can fill in the dynamic parts with what they want, such as the modules found on disk.
This allows for a more streamlined dev process with a lot less stuff to juggle and maintain by hand.
Upvotes: 19
Reputation: 44871
My understanding is that the OTP application should have the application.app file in the ebin directory together with the compiled beam-files.
Keeping an application.app.src file (which would be identical to the one in the ebin directory) in the src directory is optional but can be useful to have the build process generate the application.app file.
Upvotes: 3