You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.8 KiB

преди 10 години
преди 15 години
преди 10 години
преди 10 години
преди 15 години
преди 15 години
преди 10 години
преди 10 години
преди 10 години
преди 10 години
  1. -module(rebar_prv_deps).
  2. -behaviour(provider).
  3. -export([init/1,
  4. do/1,
  5. format_error/1]).
  6. -include("rebar.hrl").
  7. -define(PROVIDER, deps).
  8. -define(DEPS, []).
  9. -spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
  10. init(State) ->
  11. State1 = rebar_state:add_provider(State, providers:create([{name, ?PROVIDER},
  12. {module, ?MODULE},
  13. {bare, true},
  14. {deps, ?DEPS},
  15. {example, "rebar deps"},
  16. {short_desc, "List dependencies"},
  17. {desc, info("List dependencies")},
  18. {opts, []}])),
  19. {ok, State1}.
  20. -spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
  21. do(State) ->
  22. {ok, State}.
  23. -spec format_error(any()) -> iolist().
  24. format_error(Reason) ->
  25. io_lib:format("~p", [Reason]).
  26. info(Description) ->
  27. io_lib:format("~s.~n"
  28. "~n"
  29. "Valid rebar.config options:~n"
  30. " ~p~n"
  31. " ~p~n"
  32. "Valid command line options:~n"
  33. " deps_dir=\"deps\" (override default or rebar.config deps_dir)~n",
  34. [
  35. Description,
  36. {deps_dir, "deps"},
  37. {deps,
  38. [app_name,
  39. {rebar, "1.0.*"},
  40. {rebar, ".*",
  41. {git, "git://github.com/rebar/rebar.git"}},
  42. {rebar, ".*",
  43. {git, "git://github.com/rebar/rebar.git", "Rev"}},
  44. {rebar, "1.0.*",
  45. {git, "git://github.com/rebar/rebar.git", {branch, "master"}}},
  46. {rebar, "1.0.0",
  47. {git, "git://github.com/rebar/rebar.git", {tag, "1.0.0"}}},
  48. {rebar, "",
  49. {git, "git://github.com/rebar/rebar.git", {branch, "master"}},
  50. [raw]},
  51. {app_name, ".*", {hg, "https://www.example.org/url"}},
  52. {app_name, ".*", {rsync, "Url"}},
  53. {app_name, ".*", {svn, "https://www.example.org/url"}},
  54. {app_name, ".*", {svn, "svn://svn.example.org/url"}},
  55. {app_name, ".*", {bzr, "https://www.example.org/url", "Rev"}},
  56. {app_name, ".*", {fossil, "https://www.example.org/url"}},
  57. {app_name, ".*", {fossil, "https://www.example.org/url", "Vsn"}},
  58. {app_name, ".*", {p4, "//depot/subdir/app_dir"}}]}
  59. ]).