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.

43 righe
1.1 KiB

  1. %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
  2. %% ex: ts=4 sw=4 et
  3. -module(rebar_resource).
  4. -export([]).
  5. -export_types([resource/0
  6. ,type/0
  7. ,location/0
  8. ,ref/0]).
  9. -type resource() :: {type(), location(), ref()}.
  10. -type type() :: atom().
  11. -type location() :: string().
  12. -type ref() :: any().
  13. -ifdef(no_callback_support).
  14. %% In the case where R14 or lower is being used to compile the system
  15. %% we need to export a behaviour info
  16. -export([behaviour_info/1]).
  17. -spec behaviour_info(atom()) -> [{atom(), arity()}] | undefined.
  18. behaviour_info(callbacks) ->
  19. [{lock, 2},
  20. {download, 2},
  21. {needs_update,2},
  22. {make_vsn, 1}];
  23. behaviour_info(_) ->
  24. undefined.
  25. -else.
  26. -callback lock(file:filename_all(), tuple()) ->
  27. rebar_resource:resource().
  28. -callback download(file:filename_all(), tuple()) ->
  29. {tarball, file:filename_all()} | {ok, any()} | {error, any()}.
  30. -callback needs_update(file:filename_all(), tuple()) ->
  31. {tarball, file:filename_all()} | {ok, any()} | {error, any()}.
  32. -callback make_vsn(file:filename_all()) ->
  33. {plain, string()} | {error, string()}.
  34. -endif.