Skip to content

Commit 7544f23

Browse files
committed
fix external (non-rebar3) project compile
1 parent 8e28561 commit 7544f23

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/rebar_fetch.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ download_source(AppInfo, State) ->
3434
{true, AppInfo2} ->
3535
rebar_app_info:is_available(AppInfo2, true);
3636
false ->
37-
throw(?PRV_ERROR({dep_app_not_found, rebar_app_info:name(AppInfo1)}))
37+
rebar_app_info:is_available(AppInfo1, true)
3838
end;
3939
{error, Reason} ->
4040
throw(?PRV_ERROR(Reason))

src/rebar_prv_compile.erl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ compile(State, Providers, AppInfo) ->
162162

163163
AppInfo2 = rebar_hooks:run_all_hooks(AppDir, pre, ?ERLC_HOOK, Providers, AppInfo1, State),
164164

165+
%% For non-rebar3 built deps the proper app structure should be created by pre-hooks
166+
%% by this time. Verify that.
167+
ok = verify_app_structure(AppInfo2, AppDir),
168+
165169
build_app(AppInfo2, State),
166170

167171
AppInfo3 = rebar_hooks:run_all_hooks(AppDir, post, ?ERLC_HOOK, Providers, AppInfo2, State),
@@ -214,6 +218,14 @@ build_app(AppInfo, State) ->
214218
end
215219
end.
216220

221+
verify_app_structure(AppInfo, AppDir) ->
222+
case rebar_app_discover:find_app(AppInfo, AppDir, all) of
223+
{true, _AppInfo1} ->
224+
ok;
225+
false ->
226+
throw(?PRV_ERROR({dep_app_not_found, rebar_app_info:name(AppInfo)}))
227+
end.
228+
217229
update_code_paths(State, ProjectApps) ->
218230
ProjAppsPaths = paths_for_apps(ProjectApps),
219231
ExtrasPaths = paths_for_extras(State, ProjectApps),

0 commit comments

Comments
 (0)