Bläddra i källkod

Merge pull request #1976 from stuart-thackray/tidyDepExport

re-expose download/3 for backwards compatibility in git deps related plugins
pull/1980/head
Fred Hebert 6 år sedan
committed by GitHub
förälder
incheckning
06f4b7e4c3
Ingen känd nyckel hittad för denna signaturen i databasen GPG-nyckel ID: 4AEE18F83AFDEB23
2 ändrade filer med 17 tillägg och 0 borttagningar
  1. +8
    -0
      src/rebar_git_resource.erl
  2. +9
    -0
      src/rebar_hg_resource.erl

+ 8
- 0
src/rebar_git_resource.erl Visa fil

@ -10,6 +10,10 @@
needs_update/2, needs_update/2,
make_vsn/2]). make_vsn/2]).
%% For backward compatibilty
-export ([ download/3
]).
-include("rebar.hrl"). -include("rebar.hrl").
%% Regex used for parsing scp style remote url %% Regex used for parsing scp style remote url
@ -123,6 +127,10 @@ download(TmpDir, AppInfo, State, _) ->
{error, Error} {error, Error}
end. end.
%% For backward compatibilty
download(Dir, AppInfo, State) ->
download_(Dir, AppInfo, State).
download_(Dir, {git, Url}, 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.", []), ?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); download_(Dir, {git, Url, {branch, "master"}}, State);

+ 9
- 0
src/rebar_hg_resource.erl Visa fil

@ -10,6 +10,11 @@
needs_update/2, needs_update/2,
make_vsn/2]). make_vsn/2]).
%% For backward compatibilty
-export([ download/3
]).
-include("rebar.hrl"). -include("rebar.hrl").
-spec init(atom(), rebar_state:t()) -> {ok, rebar_resource_v2:resource()}. -spec init(atom(), rebar_state:t()) -> {ok, rebar_resource_v2:resource()}.
@ -72,6 +77,10 @@ download(TmpDir, AppInfo, State, _) ->
{error, Error} {error, Error}
end. end.
%% For backward compatibilty
download(Dir, AppInfo, State) ->
download_(Dir, AppInfo, State).
download_(Dir, {hg, Url}, 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.", []), ?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); download_(Dir, {hg, Url, {branch, "default"}}, State);

Laddar…
Avbryt
Spara