Maxim Sokhatsky 10 years ago
parent
commit
9b08f5e6a8
3 changed files with 4 additions and 3 deletions
  1. BIN
      mad
  2. 1 1
      src/mad.app.src
  3. 3 2
      src/mad_compile.erl

BIN
mad


+ 1 - 1
src/mad.app.src

@@ -2,5 +2,5 @@
  [{description, "MAD VXZ Build Tool"},
  [{description, "MAD VXZ Build Tool"},
   {vsn, "0.8"},
   {vsn, "0.8"},
   {registered, []},
   {registered, []},
-  {applications, [kernel,stdlib,re]},
+  {applications, [kernel,stdlib]},
   {env, []}]}.
   {env, []}]}.

+ 3 - 2
src/mad_compile.erl

@@ -125,7 +125,8 @@ app_src_files(Dir) -> filelib:fold_files(Dir, ".app.src", false, fun(F, Acc) ->
 app_src_to_app(Filename) -> filename:basename(Filename, ".app.src") ++ ".app".
 app_src_to_app(Filename) -> filename:basename(Filename, ".app.src") ++ ".app".
 yrl_to_erl(Filename) -> filename:join(filename:dirname(Filename),filename:basename(Filename, ".yrl")) ++ ".erl".
 yrl_to_erl(Filename) -> filename:join(filename:dirname(Filename),filename:basename(Filename, ".yrl")) ++ ".erl".
 erl_to_beam(Bin, Filename) -> filename:join(Bin, filename:basename(Filename, ".erl") ++ ".beam").
 erl_to_beam(Bin, Filename) -> filename:join(Bin, filename:basename(Filename, ".erl") ++ ".beam").
-is_compiled(BeamFile, File) -> mad_utils:last_modified(BeamFile) > mad_utils:last_modified(File).
+file_to_beam(Bin, Filename) -> filename:join(Bin, filename:basename(Filename) ++ ".beam").
+is_compiled(BeamFile, File) -> mad_utils:last_modified(BeamFile) >= mad_utils:last_modified(File).
 add_modules_property(Properties) ->
 add_modules_property(Properties) ->
     case lists:keyfind(modules, 1, Properties) of
     case lists:keyfind(modules, 1, Properties) of
         {modules, _} -> Properties;
         {modules, _} -> Properties;
@@ -171,7 +172,7 @@ compile_erlydtl_files(Opts) ->
 
 
     Compile = fun(F) ->
     Compile = fun(F) ->
         ModuleName = module_name(F, SourceExt, ModuleExt),
         ModuleName = module_name(F, SourceExt, ModuleExt),
-        BeamFile = erl_to_beam(OutDir, atom_to_list(ModuleName)),
+        BeamFile = file_to_beam(OutDir, atom_to_list(ModuleName)),
         Compiled = is_compiled(BeamFile, F),
         Compiled = is_compiled(BeamFile, F),
         if  Compiled =:= false ->
         if  Compiled =:= false ->
             io:format("DTL Compiling ~s~n", [F]),
             io:format("DTL Compiling ~s~n", [F]),