Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-expose download/3 for backwards compatibility in git deps related plugins #1976

Merged
merged 8 commits into from
Dec 18, 2018
8 changes: 8 additions & 0 deletions src/rebar_git_resource.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
needs_update/2,
make_vsn/2]).

%% For backward compatibilty
-export ([ download/3
]).

-include("rebar.hrl").

%% Regex used for parsing scp style remote url
Expand Down Expand Up @@ -123,6 +127,10 @@ download(TmpDir, AppInfo, State, _) ->
{error, Error}
end.

%% For backward compatibilty
download(Dir, AppInfo, State) ->
download_(Dir, AppInfo, State).

download_(Dir, {git, Url}, State) ->
?WARN("WARNING: It is recommended to use {branch, Name}, {tag, Tag} or {ref, Ref}, otherwise updating the dep may not work as expected.", []),
download_(Dir, {git, Url, {branch, "master"}}, State);
Expand Down
9 changes: 9 additions & 0 deletions src/rebar_hg_resource.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
needs_update/2,
make_vsn/2]).


%% For backward compatibilty
-export([ download/3
]).

-include("rebar.hrl").

-spec init(atom(), rebar_state:t()) -> {ok, rebar_resource_v2:resource()}.
Expand Down Expand Up @@ -72,6 +77,10 @@ download(TmpDir, AppInfo, State, _) ->
{error, Error}
end.

%% For backward compatibilty
download(Dir, AppInfo, State) ->
download_(Dir, AppInfo, State).

download_(Dir, {hg, Url}, State) ->
?WARN("WARNING: It is recommended to use {branch, Name}, {tag, Tag} or {ref, Ref}, otherwise updating the dep may not work as expected.", []),
download_(Dir, {hg, Url, {branch, "default"}}, State);
Expand Down