Namdak Tonpa 10 лет назад
Родитель
Сommit
3cbdc76795
3 измененных файлов с 5 добавлено и 6 удалено
  1. 1 1
      include/mad.hrl
  2. BIN
      mad
  3. 4 5
      src/compile/mad_app.erl

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"95e4d5").
+-define(VERSION,"490401").


+ 4 - 5
src/compile/mad_app.erl

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