Browse Source

fix DTL for apps

Maxim Sokhatsky 11 years ago
parent
commit
71afcbe57b
4 changed files with 4 additions and 5 deletions
  1. BIN
      mad
  2. 1 1
      otp.mk
  3. 1 1
      src/mad.erl
  4. 2 3
      src/mad_compile.erl

BIN
mad


+ 1 - 1
otp.mk

@@ -7,7 +7,7 @@ ERL_LIBS := $(subst $(space),:,$(ROOTS))
 test: ct
 compile: get-deps
 get-deps compile clean:
-	./mad $@
+	rebar $@
 escript: compile
 	./build
 $(PLT_NAME):

+ 1 - 1
src/mad.erl

@@ -57,7 +57,7 @@ compile(Cwd, ConfigFile, Conf) ->
 %% compile a project according to the conventions
 'compile-app'(Cwd, ConfigFile, Conf) ->
     %% check sub_dirs if they have something to be compiled
-    Dirs = [mad_utils:sub_dirs(Cwd, ConfigFile, Conf)] ++ [Cwd],
+    Dirs = mad_utils:sub_dirs(Cwd, ConfigFile, Conf),
     mad_compile:foreach(fun mad_compile:app/3, Dirs, Conf, ConfigFile).
 
 'compile-deps'(Cwd, ConfigFile, Conf) ->

+ 2 - 3
src/mad_compile.erl

@@ -61,7 +61,7 @@ dep(Cwd, _Conf, ConfigFile, Name) ->
 -spec app(directory(), any(), filename()) -> ok.
 app(Dir, Conf, ConfigFile) ->
     ConfigFile1 = filename:join(Dir, ConfigFile),
-    Conf1 = mad_utils:script(ConfigFile1, Conf),
+    Conf1 = mad_utils:consult(ConfigFile1),
     SrcDir = mad_utils:src(Dir),
     Files = sort(erl_files(SrcDir)) ++ app_src_files(SrcDir),
 
@@ -85,8 +85,7 @@ app(Dir, Conf, ConfigFile) ->
 dtl(Dir,Config) ->
     case mad_utils:get_value(erlydtl_opts, Config, []) of
         [] -> skip;
-         X -> io:format("Dir: ~p DTL: ~p~n",[Dir,X]),
-              compile_erlydtl_files(validate_erlydtl_opts(Dir,X)) end.
+         X -> compile_erlydtl_files(validate_erlydtl_opts(Dir,X)) end.
 
 
 -spec validate_property({atom(), term()}, term()) -> {atom(), term()}.