diff options
-rw-r--r-- | src/rebar_paths.erl | 9 | ||||
-rw-r--r-- | src/rebar_prv_compile.erl | 3 | ||||
-rw-r--r-- | src/rebar_prv_upgrade.erl | 6 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/rebar_paths.erl b/src/rebar_paths.erl index 82c0218..160f9fa 100644 --- a/src/rebar_paths.erl +++ b/src/rebar_paths.erl @@ -111,7 +111,6 @@ purge_and_load([{_Group, Apps}|Rest], Seen) -> %% Shouldn't unload ourselves; rebar runs without ever %% being started and unloading breaks logging! AppName =/= <<"rebar">>], - %% 4) CandidateMods = lists:append( %% Start by asking the currently loaded app (if loaded) @@ -121,8 +120,12 @@ purge_and_load([{_Group, Apps}|Rest], Seen) -> Mods; undefined -> %% if not found, parse the app file on disk, in case - %% the app's modules are used without it being loaded - case rebar_app_info:app_details(App) of + %% the app's modules are used without it being loaded; + %% invalidate the cache in case we're proceeding during + %% compilation steps by setting the app details to `[]', which + %% is its empty value; the details will then be reloaded + %% from disk when found + case rebar_app_info:app_details(rebar_app_info:app_details(App, [])) of [] -> []; Details -> proplists:get_value(modules, Details, []) end diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl index ee96d9f..cf2bcf2 100644 --- a/src/rebar_prv_compile.erl +++ b/src/rebar_prv_compile.erl @@ -195,13 +195,14 @@ build_app(AppInfo, State) -> case rebar_app_info:project_type(AppInfo) of Type when Type =:= rebar3 ; Type =:= undefined -> Compilers = rebar_state:compilers(State), + rebar_paths:set_paths([deps], State), rebar_compiler:compile_all(Compilers, AppInfo); Type -> ProjectBuilders = rebar_state:project_builders(State), case lists:keyfind(Type, 1, ProjectBuilders) of {_, Module} -> %% load plugins since thats where project builders would be - rebar_paths:set_paths([plugins, deps], State), + rebar_paths:set_paths([deps, plugins], State), Res = Module:build(AppInfo), rebar_paths:set_paths([deps], State), case Res of diff --git a/src/rebar_prv_upgrade.erl b/src/rebar_prv_upgrade.erl index b1b1b16..565f342 100644 --- a/src/rebar_prv_upgrade.erl +++ b/src/rebar_prv_upgrade.erl @@ -132,11 +132,13 @@ update_pkg_deps([], _, _) -> update_pkg_deps([{Name, _, _} | Rest], AppInfos, State) -> case rebar_app_utils:find(Name, AppInfos) of {ok, AppInfo} -> - case element(1, rebar_app_info:source(AppInfo)) of + Source = rebar_app_info:source(AppInfo), + case element(1, Source) of pkg -> Resources = rebar_state:resources(State), #{repos := RepoConfigs} = rebar_resource_v2:find_resource_state(pkg, Resources), - [update_package(Name, RepoConfig, State) || RepoConfig <- RepoConfigs]; + PkgName = element(2, Source), + [update_package(PkgName, RepoConfig, State) || RepoConfig <- RepoConfigs]; _ -> skip end; |