Configuration File

rebar.config

mad uses rebar.config filename to load mad configuration. Despite mad is no fully rebar compatible (e.g. it can’t uses rebar plugins, ports compilation is rather different, etc), it uses its name to achive certail level of compatibility.

deps

deps is the core option of mad. It says which OTP applications shold be used and where they could be found. Yoy may also specify versions. Here is simpliest example:

Listing 1: deps Option


{deps, [ {kvs, ".*", {git,"git://github.com/synrc/kvs"}}, {forms, ".*", {git,"git://github.com/spawnproc/forms"}} ]}.

deps_dir

To specify where deps should be stored after fetching inside your application you use deps_dir option:

Listing 2: deps_dir Option


{deps_dir, "deps"}.

sub_dirs

If your application consist of more than one src directory, you may specify all of the sub-applications. Each sub-application should be valid OTP application with its own rebar.config configuration file.

{sub_dirs,["apps"]}.

lib_dirs

To use include directive across your sub-applications you should specify the lib_dirs directories which will be settled as include directories during compilation.

{lib_dirs,["apps"]}.

E.g. you have my_app and my_server applications inside apps directory and you including HRL file from my_server application from ap_app application:

-module(my_app). -include_lib("my_server/include/my_server.hrl").

 




Events | Privacy Policy | Feedback | Brandbook
Copyright © 2005–2016 Synrc Research Center s.r.o.