Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

90 linhas
3.2 KiB

há 10 anos
há 10 anos
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
há 6 anos
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
há 6 anos
  1. %% TODO: rename FAIL to ABORT once we require at least R13B04 for
  2. %% building rebar. Macros with different arity were not supported by the
  3. %% compiler before 13B04.
  4. -define(FAIL, rebar_utils:abort()).
  5. -define(ABORT(Str, Args), rebar_utils:abort(Str, Args)).
  6. -define(CONSOLE(Str, Args), io:format(Str++"~n", Args)).
  7. -define(DEBUG(Str, Args), rebar_log:log(debug, Str, Args)).
  8. -define(INFO(Str, Args), rebar_log:log(info, Str, Args)).
  9. -define(WARN(Str, Args), rebar_log:log(warn, Str, Args)).
  10. -define(ERROR(Str, Args), rebar_log:log(error, Str, Args)).
  11. -define(CRASHDUMP(Str, Args), rebar_log:crashdump(Str, Args)).
  12. -define(FMT(Str, Args), lists:flatten(io_lib:format(Str, Args))).
  13. -define(DEFAULT_BASE_DIR, "_build").
  14. -define(DEFAULT_ROOT_DIR, ".").
  15. -define(DEFAULT_PROJECT_APP_DIRS, ["apps/*", "lib/*", "."]).
  16. -define(DEFAULT_CHECKOUTS_DIR, "_checkouts").
  17. -define(DEFAULT_DEPS_DIR, "lib").
  18. -define(DEFAULT_PLUGINS_DIR, "plugins").
  19. -define(DEFAULT_TEST_DEPS_DIR, "test/lib").
  20. -define(DEFAULT_RELEASE_DIR, "rel").
  21. -define(CONFIG_VERSION, "1.1.0").
  22. -define(DEFAULT_CDN, "https://repo.hex.pm/").
  23. -define(REMOTE_PACKAGE_DIR, "tarballs").
  24. -define(LOCK_FILE, "rebar.lock").
  25. -define(DEFAULT_COMPILER_SOURCE_FORMAT, relative).
  26. -define(PACKAGE_INDEX_VERSION, 5).
  27. -define(PACKAGE_TABLE, package_index).
  28. -define(INDEX_FILE, "packages.idx").
  29. -define(HEX_AUTH_FILE, "hex.config").
  30. -define(PUBLIC_HEX_REPO, <<"hexpm">>).
  31. %% ignore this function in all modules
  32. %% not every module that exports it and relies on it being called implements provider
  33. -ignore_xref([{format_error, 1}]).
  34. %% the package record is used in a select match spec which upsets dialyzer
  35. %% this is the suggested workaround from Tobias
  36. %% http://erlang.org/pipermail/erlang-questions/2009-February/041445.html
  37. -type ms_field() :: '$1' | '_'.
  38. %% TODO: change package and requirement keys to be required (:=) after dropping support for OTP-18
  39. -record(package, {key :: {unicode:unicode_binary() | ms_field(), unicode:unicode_binary() | ms_field(),
  40. unicode:unicode_binary() | ms_field()},
  41. checksum :: binary() | ms_field(),
  42. retired :: boolean() | ms_field(),
  43. dependencies :: [#{package => unicode:unicode_binary(),
  44. requirement => unicode:unicode_binary()}] | ms_field()}).
  45. -record(resource, {type :: atom(),
  46. module :: module(),
  47. state :: term(),
  48. implementation :: rebar_resource | rebar_resource_v2}).
  49. -ifdef(namespaced_types).
  50. -type rebar_dict() :: dict:dict().
  51. -else.
  52. -type rebar_dict() :: dict().
  53. -endif.
  54. -ifdef(namespaced_types).
  55. -type rebar_digraph() :: digraph:graph().
  56. -else.
  57. -type rebar_digraph() :: digraph().
  58. -endif.
  59. -ifdef(namespaced_types).
  60. -type rebar_set() :: sets:set().
  61. -else.
  62. -type rebar_set() :: set().
  63. -endif.
  64. -ifdef(fun_stacktrace).
  65. -define(WITH_STACKTRACE(T, R, S), T:R -> S = erlang:get_stacktrace(),).
  66. -else.
  67. -define(WITH_STACKTRACE(T, R, S), T:R:S ->).
  68. -endif.
  69. -define(GRAPH_VSN, 2).
  70. -type v() :: {digraph:vertex(), term()} | 'false'.
  71. -type e() :: {digraph:vertex(), digraph:vertex()}.
  72. -type graph() :: {list(v()), list(e())}.
  73. -record(graph,
  74. {
  75. vsn = ?GRAPH_VSN :: pos_integer(),
  76. info = {[], []} :: graph()
  77. }).