Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

67 righe
2.8 KiB

  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. ]).