diff options
author | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-05-23 07:35:18 -0500 |
---|---|---|
committer | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-05-23 07:35:18 -0500 |
commit | fe181f950d1588d6212f82f68f45e216eecf6c98 (patch) | |
tree | 617263bc7397a4584936ab2db5c578a949bf79d2 /src/rebar_app_discover.erl | |
parent | d9bad345062ec29d748d77c1497232b769a379d0 (diff) | |
parent | 7ff23a63dcfacf064dc0fca04bd6649181e00b0a (diff) |
Merge pull request #461 from erocci/master
Add excluded_apps rebar.config keyword
Diffstat (limited to 'src/rebar_app_discover.erl')
-rw-r--r-- | src/rebar_app_discover.erl | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/rebar_app_discover.erl b/src/rebar_app_discover.erl index e2ef179..332efb0 100644 --- a/src/rebar_app_discover.erl +++ b/src/rebar_app_discover.erl @@ -20,13 +20,19 @@ do(State, LibDirs) -> %% Sort apps so we get the same merged deps config everytime SortedApps = rebar_utils:sort_deps(Apps), lists:foldl(fun(AppInfo, StateAcc) -> - {AppInfo1, StateAcc1} = merge_deps(AppInfo, StateAcc), - Name = rebar_app_info:name(AppInfo), - OutDir = filename:join(DepsDir, Name), - AppInfo2 = rebar_app_info:out_dir(AppInfo1, OutDir), - ProjectDeps1 = lists:delete(Name, ProjectDeps), - rebar_state:project_apps(StateAcc1 - ,rebar_app_info:deps(AppInfo2, ProjectDeps1)) + Name = rebar_app_info:name(AppInfo), + case enable(State, AppInfo) of + true -> + {AppInfo1, StateAcc1} = merge_deps(AppInfo, StateAcc), + OutDir = filename:join(DepsDir, Name), + AppInfo2 = rebar_app_info:out_dir(AppInfo1, OutDir), + ProjectDeps1 = lists:delete(Name, ProjectDeps), + rebar_state:project_apps(StateAcc1 + ,rebar_app_info:deps(AppInfo2, ProjectDeps1)); + false -> + ?INFO("Ignoring ~s", [Name]), + StateAcc + end end, State, SortedApps). format_error({module_list, File}) -> @@ -211,3 +217,10 @@ try_handle_app_src_file(_, AppDir, [File], Validate) when Validate =:= invalid end; try_handle_app_src_file(_, _AppDir, Other, _Validate) -> throw({error, {multiple_app_files, Other}}). + +enable(State, AppInfo) -> + not lists:member(to_atom(rebar_app_info:name(AppInfo)), + rebar_state:get(State, excluded_apps, [])). + +to_atom(Bin) -> + list_to_atom(binary_to_list(Bin)). |