1 %%%---------------------------------------------------------------------------
2 %%% @author Eric Merritt
4 %%% Provides the task and resource definitions for the system.
6 %%% @copyright 2007 Erlware
7 %%%---------------------------------------------------------------------------
9 %% @doc Describes n application, and whether or not the application is a
10 %% runtime dep or compile time dep, also wether it is a project
11 %% application or a dependency
12 -record(app
, {name
:: atom(),
15 type
:: runtime
| compiletime
,
17 %% Everything below will only be populated if the
18 %% project field above is true otherwise they will be
20 id
="" :: string() | list(),
21 maxP
=infinity
:: integer() | infinity
,
22 maxT
=infinity
:: integer() | infinity
,
24 start_phases
= undefined
:: term() | undefined
,
25 basedir
:: string() | undefined
,
26 description
="" :: string() | list(),
27 registered :: [atom()] | undefined
,
28 applications
:: [atom()] | undefined
,
29 included_applications
:: [atom()] | undefined
,
30 dep_constraints
:: term() | undefined
,
31 mod
:: term() | undefined
,
32 dotapp
:: string() | undefined
,
33 deps
:: [atom()] | undefined
,
34 properties
=[] :: proplists:proplist(),
35 modules
:: [atom()] | undefined
}).
37 %% @doc describes a module in the system
38 %% - name: is the name of the module
39 -record(module
, {name
:: module(),
40 type
:: hrl
| yrl
| erl
| {other
, string()},
42 module_deps
:: [module()],
44 include_timestamps
:: [{string(),
45 sin_file_info:date_time()}],
47 called_modules
:: [atom()],
48 changed
:: sin_file_info:date_time(),
49 change_sig
:: number()}).
52 -record(task
, {name
:: atom(), % The 'user friendly' name of the task
53 task_impl
:: atom(), % The implementation of the task, maybe fun or
54 bare
:: boolean(), % Indicates whether a build config is needed
55 deps
:: [atom()], % The list of dependencies
56 desc
:: string(), % The description for the task
57 short_desc
:: string(), % A one line short description of the task
58 example
:: string(), % An example of the task usage
59 opts
:: list()}). % The list of options that the task requires/understands
62 -define(SIN_EXEP_UNPARSE(S
, Problem
, Description
),
63 {pe
, S
, {_
, _
, {Problem
, Description
}}}).
64 -define(SIN_EXEP_UNPARSE(S
, Problem
),
65 {pe
, S
, {_
, _
, Problem
}}).
67 -define(SIN_RAISE(State
, Problem
),
69 sin_state:add_run_error(?MODULE
,
70 {?MODULE
, ?LINE
, Problem
}, State
),
71 {?MODULE
, ?LINE
, Problem
}})).
73 -define(SIN_RAISE(State
, Problem
, Description
),
75 sin_state:add_run_error(?MODULE
,
77 {Problem
, Description
}}, State
),
79 {Problem
, Description
}}})).
81 -define(SIN_RAISE(State
, Problem
, Description
, DescArgs
),
83 sin_state:add_run_error(?MODULE
,
87 io_lib:format(Description
,
91 lists:flatten(io_lib:format(Description
, DescArgs
))}}})).
93 -define(WARN(State
, Warnings
),
96 sin_state:add_run_warning(?MODULE
, Warnings
, State
),
101 -define(WARN(State
, Warnings
, Detail
),
104 sin_state:add_run_warning(?MODULE
,
105 lists:flatten(io_lib:format(Warnings
, Detail
)), State
),