typical project structures / sanity check

Woody Peterson woody.peterson@REDACTED
Fri Dec 10 21:30:38 CET 2010

Hi all,

The short question is: are the project used for a first target system  
and a standard OTP app mutually exclusive? In other words, can a  
project used to generate a first target system also be the source for  
an application, or must that application necessarily be a subdirectory  
somewhere, for example /lib/myproject?

I started a project (let's call it 'myproject') using the OTP  
structure like so:

- src
- ebin
- priv
- include

Now it's time to deploy, and I want to use rebar/reltool. The problem  
is that I have to tell reltool where the 'myproject' application is.  
Well, in my case, it's in ~/erlang, but so is a lot of other stuff, so  
I don't want to declare that in the reltool.config lib_dirs. I asked  
around on the rebar mailing list, and it seems that the best solution  
is to move /src to /apps/myproject/src and put /apps in lib_dirs.  
Well, now my main app doesn't follow the OTP conventions anymore :(

Erlang/OTP in Action / sinan (written by the same people) use the  
following project directory structure:

- _build.cfg
- lib
-- myapp
--- doc
--- ebin
--- include
--- src

This clearly separates the 'project' from the component application,  
but I haven't yet heard it explicitly said that these need to be  
separated in order to deploy in a standard manner.

So: do you always structure projects like this, or is there a way I  
can deploy my single OTP app using reltool (w/o breaking it's current  
OTP structure)?



More information about the erlang-questions mailing list