config.tex 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. \section{Configuration File}
  2. \subsection{rebar.config}
  3. mad uses {\bf rebar.config} filename to load mad configuration.
  4. Despite mad is no fully rebar compatible (e.g. it can't uses
  5. rebar plugins, ports compilation is rather different, etc),
  6. it uses its name to achive certail level of compatibility.
  7. \subsection{deps}
  8. deps is the core option of mad. It says which OTP applications
  9. shold be used and where they could be found. Yoy may also specify
  10. versions. Here is simpliest example:
  11. \vspace{1\baselineskip}
  12. \begin{lstlisting}[caption=deps Option]
  13. {deps, [
  14. {kvs, ".*", {git,"git://github.com/synrc/kvs"}},
  15. {forms, ".*", {git,"git://github.com/spawnproc/forms"}}
  16. ]}.
  17. \end{lstlisting}
  18. \vspace{1\baselineskip}
  19. \subsection{deps\_dir}
  20. To specify where deps should be stored after fetching inside
  21. your application you use deps\_dir option:
  22. \vspace{1\baselineskip}
  23. \begin{lstlisting}[caption=deps\_dir Option]
  24. {deps_dir, "deps"}.
  25. \end{lstlisting}
  26. \vspace{1\baselineskip}
  27. \subsection{sub\_dirs}
  28. If your application consist of more than one src
  29. directory, you may specify all of the sub-applications.
  30. Each sub-application should be valid OTP application
  31. with its own rebar.config configuration file.
  32. \vspace{1\baselineskip}
  33. \begin{lstlisting}
  34. {sub_dirs,["apps"]}.
  35. \end{lstlisting}
  36. \vspace{1\baselineskip}
  37. \subsection{lib\_dirs}
  38. To use include directive across your sub-applications
  39. you should specify the {\bf lib\_dirs} directories
  40. which will be settled as include directories during compilation.
  41. \vspace{1\baselineskip}
  42. \begin{lstlisting}
  43. {lib_dirs,["apps"]}.
  44. \end{lstlisting}
  45. \vspace{1\baselineskip}
  46. E.g. you have my\_app and my\_server applications
  47. inside apps directory and you including HRL file
  48. from my\_server application from ap\_app application:
  49. \vspace{1\baselineskip}
  50. \begin{lstlisting}
  51. -module(my_app).
  52. -include_lib("my_server/include/my_server.hrl").
  53. \end{lstlisting}
  54. \vspace{1\baselineskip}