diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2012-07-02 18:47:06 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2012-07-02 18:47:06 +0200 |
commit | df9b77633a7391a6eed3016378522f6754c655d6 (patch) | |
tree | f3ff6e234ec3e37c2a1533e625ac72f118dc4e20 /src | |
parent | ad2f30ccb90fd160a318d10e25e22c6fd4ce2537 (diff) |
Move erl_opts/1 and src_dirs/1 to proper place
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_utils.erl | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index f2290e0..fc8930f 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -283,6 +283,26 @@ delayed_halt(Code) -> end end. +%% @doc Return list of erl_opts +-spec erl_opts(rebar_config:config()) -> list(). +erl_opts(Config) -> + RawErlOpts = filter_defines(rebar_config:get(Config, erl_opts, []), []), + GlobalDefines = [{d, list_to_atom(D)} || + D <- rebar_config:get_global(defines, [])], + Opts = GlobalDefines ++ RawErlOpts, + case proplists:is_defined(no_debug_info, Opts) of + true -> + [O || O <- Opts, O =/= no_debug_info]; + false -> + [debug_info|Opts] + end. + +-spec src_dirs(SrcDirs::[string()]) -> [file:filename(), ...]. +src_dirs([]) -> + ["src"]; +src_dirs(SrcDirs) -> + SrcDirs. + %% ==================================================================== %% Internal functions %% ==================================================================== @@ -455,26 +475,6 @@ vcs_vsn_invoke(Cmd, Dir) -> {ok, VsnString} = rebar_utils:sh(Cmd, [{cd, Dir}, {use_stdout, false}]), string:strip(VsnString, right, $\n). -%% @doc Return list of erl_opts --spec erl_opts(rebar_config:config()) -> list(). -erl_opts(Config) -> - RawErlOpts = filter_defines(rebar_config:get(Config, erl_opts, []), []), - GlobalDefines = [{d, list_to_atom(D)} || - D <- rebar_config:get_global(defines, [])], - Opts = GlobalDefines ++ RawErlOpts, - case proplists:is_defined(no_debug_info, Opts) of - true -> - [O || O <- Opts, O =/= no_debug_info]; - false -> - [debug_info|Opts] - end. - --spec src_dirs(SrcDirs::[string()]) -> [file:filename(), ...]. -src_dirs([]) -> - ["src"]; -src_dirs(SrcDirs) -> - SrcDirs. - %% %% Filter a list of erl_opts platform_define options such that only %% those which match the provided architecture regex are returned. |