|
@@ -20,7 +20,8 @@ compile(File,_Inc,Bin,_Opt,_Deps) ->
|
|
|
Modules = [list_to_atom(filename:basename(X, ".beam")) || X <- BeamFiles],
|
|
|
[Struct|_] = mad_utils:consult(File),
|
|
|
{application, AppName, Props} = Struct,
|
|
|
- Props1 = add_modules_property(Props),
|
|
|
+ Props0 = add_modules_property(Props),
|
|
|
+ Props1 = generate_deps(Props0),
|
|
|
Props2 = [validate_property(X, Modules) || X <- Props1],
|
|
|
Struct1 = {application, AppName, Props2},
|
|
|
file:write_file(AppFile, io_lib:format("~p.~n", [Struct1])),
|
|
@@ -31,3 +32,11 @@ add_modules_property(Properties) ->
|
|
|
case lists:keyfind(modules, 1, Properties) of
|
|
|
{modules, _} -> Properties;
|
|
|
_ -> Properties ++ [{modules, []}] end.
|
|
|
+
|
|
|
+generate_deps(Properties) ->
|
|
|
+ case lists:keyfind(applications, 1, Properties) of
|
|
|
+ false -> Properties ++ [apps()];
|
|
|
+ Exists -> Properties ++ [Exists] end.
|
|
|
+
|
|
|
+apps() -> {ok,Apps} = mad_plan:orderapps(),
|
|
|
+ {applications,Apps}.
|