diff --git a/src/rebar_fetch.erl b/src/rebar_fetch.erl index 9c76e0eaa..25b7a58db 100644 --- a/src/rebar_fetch.erl +++ b/src/rebar_fetch.erl @@ -34,7 +34,7 @@ download_source(AppInfo, State) -> {true, AppInfo2} -> rebar_app_info:is_available(AppInfo2, true); false -> - throw(?PRV_ERROR({dep_app_not_found, rebar_app_info:name(AppInfo1)})) + rebar_app_info:is_available(AppInfo1, true) end; {error, Reason} -> throw(?PRV_ERROR(Reason)) diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl index cf2bcf283..a948838c0 100644 --- a/src/rebar_prv_compile.erl +++ b/src/rebar_prv_compile.erl @@ -162,6 +162,10 @@ compile(State, Providers, AppInfo) -> AppInfo2 = rebar_hooks:run_all_hooks(AppDir, pre, ?ERLC_HOOK, Providers, AppInfo1, State), + %% For non-rebar3 built deps the proper app structure should be created by pre-hooks + %% by this time. Verify that. + ok = verify_app_structure(AppInfo2, AppDir), + build_app(AppInfo2, State), AppInfo3 = rebar_hooks:run_all_hooks(AppDir, post, ?ERLC_HOOK, Providers, AppInfo2, State), @@ -214,6 +218,14 @@ build_app(AppInfo, State) -> end end. +verify_app_structure(AppInfo, AppDir) -> + case rebar_app_discover:find_app(AppInfo, AppDir, all) of + {true, _AppInfo1} -> + ok; + false -> + throw(?PRV_ERROR({dep_app_not_found, rebar_app_info:name(AppInfo)})) + end. + update_code_paths(State, ProjectApps) -> ProjAppsPaths = paths_for_apps(ProjectApps), ExtrasPaths = paths_for_extras(State, ProjectApps),