Przeglądaj źródła

Reworking app discovery and dep fetching verbosity

Move most stuff that have to do with effectiveness to the debug
level, and some stuff that has to do with implementation details to
diagnostics
pull/2375/head
Fred Hebert 4 lat temu
rodzic
commit
a2331633a7
5 zmienionych plików z 15 dodań i 9 usunięć
  1. +6
    -0
      src/rebar_app_discover.erl
  2. +1
    -1
      src/rebar_fetch.erl
  3. +4
    -4
      src/rebar_git_resource.erl
  4. +3
    -3
      src/rebar_pkg_resource.erl
  5. +1
    -1
      src/rebar_prv_install_deps.erl

+ 6
- 0
src/rebar_app_discover.erl Wyświetl plik

@ -31,6 +31,12 @@ do(State, LibDirs) ->
%% There may be a top level src which is an app and there may not
%% Find it here if there is, otherwise define the deps parent as root
TopLevelApp = define_root_app(Apps, State),
?DEBUG("Found top-level apps: [~ts]~n\tusing config: ~p",
[case lists:flatten([[",",rebar_app_info:name(App)] || App <- Apps]) of
[] -> "";
Str -> tl(Str)
end,
[{src_dirs, SrcDirs}, {lib_dirs, LibDirs}]]),
%% Handle top level deps
State1 = lists:foldl(fun(Profile, StateAcc) ->

+ 1
- 1
src/rebar_fetch.erl Wyświetl plik

@ -59,7 +59,7 @@ download_source_(AppInfo, State) ->
code:del_path(filename:absname(filename:join(AppDir1, "ebin"))),
FetchDir = rebar_app_info:fetch_dir(AppInfo),
ok = rebar_file_utils:rm_rf(filename:absname(FetchDir)),
?DEBUG("Moving checkout ~p to ~p", [TmpDir, filename:absname(FetchDir)]),
?DIAGNOSTIC("Moving checkout ~p to ~p", [TmpDir, filename:absname(FetchDir)]),
rebar_file_utils:mv(TmpDir, filename:absname(FetchDir));
Error ->
Error

+ 4
- 4
src/rebar_git_resource.erl Wyświetl plik

@ -369,12 +369,12 @@ parse_tags(Dir) ->
git_clone_options() ->
Option = case os:getenv("REBAR_GIT_CLONE_OPTIONS") of
false -> "" ; %% env var not set
Opt -> %% env var set to empty or others
false ->
"" ;
Opt ->
?DEBUG("Git Clone Options: ~p",[Opt]),
Opt
end,
?DEBUG("Git clone Option = ~p",[Option]),
Option.
check_type_support() ->

+ 3
- 3
src/rebar_pkg_resource.erl Wyświetl plik

@ -220,10 +220,10 @@ cached_download(TmpDir, CachePath, Pkg={pkg, Name, Vsn, _OldHash, _Hash, RepoCon
CDN = maybe_default_cdn(State),
case request(RepoConfig#{repo_url => CDN}, Name, Vsn, ETag) of
{ok, cached} ->
?INFO("Version cached at ~ts is up to date, reusing it", [CachePath]),
?DEBUG("Version cached at ~ts is up to date, reusing it", [CachePath]),
serve_from_cache(TmpDir, CachePath, Pkg);
{ok, Body, NewETag} ->
?INFO("Downloaded package, caching at ~ts", [CachePath]),
?DEBUG("Downloaded package, caching at ~ts", [CachePath]),
maybe_store_etag_in_cache(UpdateETag, ETagPath, NewETag),
serve_from_download(TmpDir, CachePath, Pkg, Body);
error when ETag =/= <<>> ->
@ -236,7 +236,7 @@ cached_download(TmpDir, CachePath, Pkg={pkg, Name, Vsn, _OldHash, _Hash, RepoCon
maybe_default_cdn(State) ->
CDN = rebar_state:get(State, rebar_packages_cdn, ?DEFAULT_CDN),
rebar_utils:to_binary(CDN).
rebar_utils:to_binary(CDN).
-spec serve_from_cache(TmpDir, CachePath, Pkg) -> Res when
TmpDir :: file:name(),

+ 1
- 1
src/rebar_prv_install_deps.erl Wyświetl plik

@ -382,7 +382,7 @@ symlink_dep(State, From, To) ->
ok ->
RelativeFrom = make_relative_to_root(State, From),
RelativeTo = make_relative_to_root(State, To),
?INFO("Linking ~ts to ~ts", [RelativeFrom, RelativeTo]),
?DEBUG("Linking ~ts to ~ts", [RelativeFrom, RelativeTo]),
ok;
exists ->
ok

Ładowanie…
Anuluj
Zapisz