Skip to content

Commit

Permalink
make mad regular OTP application back
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed May 10, 2014
1 parent 4b1fcd0 commit fe1e953
Show file tree
Hide file tree
Showing 25 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion apps/mad/rebar.config

This file was deleted.

3 changes: 0 additions & 3 deletions apps/rebar.config

This file was deleted.

2 changes: 1 addition & 1 deletion build
Expand Up @@ -10,7 +10,7 @@ main(_) ->

files() ->
[{filename:basename(F), read_file(F)}
|| F <- filelib:wildcard(filename:join("apps/mad/ebin", "*")) ++
|| F <- filelib:wildcard(filename:join("ebin", "*")) ++
filelib:wildcard(filename:join(["deps", "*", "ebin", "*"]))].

read_file(File) ->
Expand Down
Binary file modified mad
Binary file not shown.
2 changes: 1 addition & 1 deletion otp.mk
Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion rebar.config
@@ -1,5 +1,4 @@
{cache,"~/.mad/repos"}.
{sub_dirs,["apps"]}.
{deps_dir,"deps"}.
{deps, [
{getopt, ".*", {git, "git://github.com/jcomellas/getopt.git", {tag, "v0.8.2"}}}
Expand Down
File renamed without changes.
10 changes: 6 additions & 4 deletions apps/mad/src/mad.erl → src/mad.erl
Expand Up @@ -49,12 +49,14 @@ main(Args) ->

%% compile dependencies and the app
compile(Cwd, ConfigFile, Conf) ->
'compile-deps'(Cwd, ConfigFile, Conf),
'compile-apps'(Cwd, ConfigFile, Conf).
'compile-apps'(Cwd, ConfigFile, Conf),
'compile-deps'(Cwd, ConfigFile, Conf).

'compile-apps'(Cwd, ConfigFile, Conf) ->
Dirs = mad_utils:sub_dirs(Cwd, ConfigFile, Conf),
mad_compile:deps(Cwd, Conf, ConfigFile, Dirs).
Dirs = get_value(sub_dirs, Conf, []),
case Dirs of
[] -> mad_compile:dep(Cwd, Conf, ConfigFile, Cwd);
Apps -> mad_compile:deps(Cwd, Conf, ConfigFile, Apps) end.

'compile-deps'(Cwd, ConfigFile, Conf) ->
mad_compile:deps(Cwd, Conf, ConfigFile, get_value(deps, Conf, [])).
Expand Down
4 changes: 2 additions & 2 deletions apps/mad/src/mad_compile.erl → src/mad_compile.erl
Expand Up @@ -11,7 +11,7 @@
deps(_, _, _, []) -> ok;
deps(Cwd, Conf, ConfigFile, [H|T]) ->
{Name, _} = mad_deps:name_and_repo(H),
case get(mad_utils:to_atom(Name)) of
case get(Name) of
compiled -> ok;
_ -> dep(Cwd, Conf, ConfigFile, Name) end,
deps(Cwd, Conf, ConfigFile, T).
Expand Down Expand Up @@ -50,7 +50,7 @@ dep(Cwd, _Conf, ConfigFile, Name) ->

dtl(DepPath,Conf1),

put(mad_utils:to_atom(Name), compiled),
put(Name, compiled),
ok
end.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fe1e953

Please sign in to comment.