From 620867d5d511e1c6e962f54e7f53a3b2ae2a052e Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Wed, 25 Nov 2009 20:24:51 -0700 Subject: More work on getting compilation and clean working properly --- src/rebar_doterl_compiler.erl | 9 ++++++--- src/rebar_utils.erl | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rebar_doterl_compiler.erl b/src/rebar_doterl_compiler.erl index cf345cd..60baa59 100644 --- a/src/rebar_doterl_compiler.erl +++ b/src/rebar_doterl_compiler.erl @@ -40,11 +40,14 @@ compile(Config, Dir) -> fun compile_mib/2). clean(Config, Dir) -> -% rebar_utils:delete_files("ebin/*.beam"), -% rebar_utils:delete_files("priv/mibs/*.bin"). + %% TODO: This would be more portable if it used Erlang to traverse + %% the dir structure and delete each file; however it would also + %% much slower. + [] = os:cmd("rm -f ebin/*.beam priv/mibs/*.bin"), ok. + %% =================================================================== %% Internal functions %% =================================================================== @@ -96,7 +99,7 @@ compile_erl(Source, Config) -> end. compile_mib(Source, Config) -> - Opts = meab_config:get_list(mibc_opts, []), + Opts = rebar_config:get_list(Config, mibc_opts, []), case snmpc:compile(Source, [{outdir, "priv/mibs"}, {i, ["priv/mibs"]}] ++ Opts) of {ok, _} -> ok; diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index 0ad6edc..92f40ec 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -29,3 +29,4 @@ get_cwd() -> {ok, Dir} = file:get_cwd(), Dir. + -- cgit v1.1