diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_app_discover.erl | 21 | ||||
-rw-r--r-- | src/rebar_prv_common_test.erl | 26 | ||||
-rw-r--r-- | src/rebar_prv_install_deps.erl | 1 |
3 files changed, 25 insertions, 23 deletions
diff --git a/src/rebar_app_discover.erl b/src/rebar_app_discover.erl index e2bf05e..aad8985 100644 --- a/src/rebar_app_discover.erl +++ b/src/rebar_app_discover.erl @@ -121,23 +121,10 @@ create_app_info(AppDir, AppFile) -> AppVsn = proplists:get_value(vsn, AppDetails), Applications = proplists:get_value(applications, AppDetails, []), IncludedApplications = proplists:get_value(included_applications, AppDetails, []), - C = rebar_config:consult(AppDir), - S = rebar_state:new(rebar_state:new(), C, AppDir), - AppDeps = rebar_state:deps_names(S), - AbsCwd = filename:absname(rebar_dir:get_cwd()), - {ok, AppInfo} = rebar_app_info:new(AppName, AppVsn, AppDir, AppDeps), - RebarConfig = filename:join(AppDir, "rebar.config"), - AppState = case filelib:is_file(RebarConfig) of - true -> - Terms = rebar_config:consult_file(RebarConfig), - rebar_state:new(Terms); - false -> - rebar_state:new() - end, - AppState1 = rebar_state:set(AppState, base_dir, AbsCwd), - AppInfo1 = rebar_app_info:applications(rebar_app_info:config( - rebar_app_info:app_details(AppInfo, AppDetails) - ,AppState1), IncludedApplications++Applications), + {ok, AppInfo} = rebar_app_info:new(AppName, AppVsn, AppDir, []), + AppInfo1 = rebar_app_info:applications( + rebar_app_info:app_details(AppInfo, AppDetails), + IncludedApplications++Applications), rebar_app_info:dir(AppInfo1, AppDir); _ -> error diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl index 3d64517..20d554e 100644 --- a/src/rebar_prv_common_test.erl +++ b/src/rebar_prv_common_test.erl @@ -38,11 +38,11 @@ do(State) -> Opts1 = transform_opts(Opts), ok = create_dirs(Opts1), expand_test_deps(filename:join(rebar_dir:profile_dir(State), ?DEFAULT_DEPS_DIR)), - case ct:run_test(Opts1) of - {_, 0, _} -> {ok, State}; - {_, FailedCount, _} -> {error, {?MODULE, {failures_running_tests, - FailedCount}}}; - {error, Reason} -> {error, {?MODULE, {error_running_tests, Reason}}} + case handle_results(ct:run_test(Opts1)) of + {error, Reason} -> + {error, {?MODULE, Reason}}; + ok -> + {ok, State} end. -spec format_error(any()) -> iolist(). @@ -240,3 +240,19 @@ help(ct_hooks) -> ""; help(userconfig) -> "". + +handle_results([Result]) -> + handle_results(Result); +handle_results([Result|Results]) when is_list(Results) -> + case handle_results(Result) of + ok -> + handle_results(Results); + Error -> + Error + end; +handle_results({_, 0, _}) -> + ok; +handle_results({_, FailedCount, _}) -> + {error, {failures_running_tests, FailedCount}}; +handle_results({error, Reason}) -> + {error, {error_running_tests, Reason}}. diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index 5fcc4d6..ade0c81 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -207,7 +207,6 @@ update_src_deps(Level, SrcDeps, PkgDeps, SrcApps, State, Update, Seen) -> ,SrcAppsAcc ,Level ,StateAcc1) - end, {SrcDepsAcc1, PkgDepsAcc1, SrcAppsAcc1, StateAcc2, SeenAcc1} end, {[], PkgDeps, SrcApps, State, Seen}, SrcDeps) of |