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.

182 linhas
6.7 KiB

há 9 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
há 10 anos
  1. rebar
  2. =====
  3. rebar [3.0](#30) is an Erlang build tool that makes it easy to compile and test Erlang
  4. applications, port drivers and releases.
  5. [![Build Status](https://travis-ci.org/rebar/rebar3.svg?branch=master)](https://travis-ci.org/rebar/rebar3) [![Windows build status](https://ci.appveyor.com/api/projects/status/yx4oitd9pvd2kab3?svg=true)](https://ci.appveyor.com/project/TristanSloughter/rebar3)
  6. rebar is a self-contained Erlang script, so it's easy to distribute or even
  7. embed directly in a project. Where possible, rebar uses standard Erlang/OTP
  8. conventions for project structures, thus minimizing the amount of build
  9. configuration work. rebar also provides dependency management, enabling
  10. application writers to easily re-use common libraries from a variety of
  11. locations ([hex.pm](http://hex.pm), git, hg, and so on).
  12. 3.0 Beta-4
  13. ====
  14. [DOCUMENTATION](http://www.rebar3.org/v3.0/docs)
  15. ### Commands
  16. | Command | Description |
  17. |----------- |------------ |
  18. | as | Higher-order provider to run multiple tasks in sequence as certain profiles |
  19. | compile | Build project |
  20. | clean | Remove project apps beam files |
  21. | cover | Generate coverage info from data compiled by `eunit --cover` or `ct --cover` |
  22. | ct | Run Common Test suites |
  23. | deps | Lists dependencies currently in use |
  24. | do | Higher-order provider to run multiple tasks in sequence |
  25. | dialyzer | Run the Dialyzer analyzer on the project |
  26. | edoc | Generate documentation using edoc |
  27. | escriptize | Generate escript of project |
  28. | eunit | Run eunit tests |
  29. | help | Print help for rebar or task |
  30. | new | Create new rebar project from templates |
  31. | path | Print paths to build dirs in current profile |
  32. | pkgs | List available packages |
  33. | plugins | List or upgrade plugins |
  34. | release | Build release of project |
  35. | relup | Creates relup from 2 releases |
  36. | report | Report on environment and versions for bug reports |
  37. | shell | Run shell with project apps in path |
  38. | tar | Package release into tarball |
  39. | tree | Print dependency tree |
  40. | unlock | Unlock dependencies |
  41. | unstable | Namespace providing commands that are still in flux |
  42. | update | Update package index |
  43. | upgrade | Fetch latest version of dep |
  44. | version | Print current version of Erlang/OTP and rebar |
  45. | xref | Run cross reference analysis on the project |
  46. A more complete list can be found on the [docs page](http://www.rebar3.org/v3.0/docs/commands)
  47. ### Changes
  48. #### Since Rebar 2.x
  49. * Fetches and builds deps if missing when running any command that relies on them
  50. * Automatically recognizes `apps` and `lib` directory structure
  51. * Relx for releases and relups
  52. * deterministic builds and conflict resolution
  53. * New plugin handling mechanism
  54. * New hook mechanism
  55. * Support for packages
  56. * A ton more
  57. ### Gone
  58. * Reltool integeration
  59. * Quickcheck integration (moved to [a plugin](http://www.rebar3.org/v3.0/docs/using-available-plugins#quickcheck))
  60. * C code compiling (moved to [a plugin](http://www.rebar3.org/v3.0/docs/using-available-plugins#port-compiler) or hooks)
  61. ### Providers
  62. Providers are the modules that do the work to fulfill a user's command.
  63. Example:
  64. ```erlang
  65. -module(rebar_prv_something).
  66. -behaviour(rebar_provider).
  67. -export([init/1,
  68. do/1,
  69. format_error/1]).
  70. -define(PROVIDER, something).
  71. -define(DEPS, []).
  72. %% ===================================================================
  73. %% Public API
  74. %% ===================================================================
  75. -spec init(rebar_state:state()) -> {ok, rebar_state:state()}.
  76. init(State) ->
  77. State1 = rebar_state:add_provider(State, rebar_provider:create([{name, ?PROVIDER},
  78. {module, ?MODULE},
  79. {bare, false},
  80. {deps, ?DEPS},
  81. {example, "rebar dummy"},
  82. {short_desc, "dummy plugin."},
  83. {desc, ""},
  84. {opts, []}])),
  85. {ok, State1}.
  86. -spec do(rebar_state:state()) -> {ok, rebar_state:state()}.
  87. do(State) ->
  88. %% Do something
  89. {ok, State}.
  90. -spec format_error(any()) -> iolist().
  91. format_error(Reason) ->
  92. io_lib:format("~p", [Reason]).
  93. ```
  94. Building
  95. --------
  96. Recommended installation of [Erlang/OTP](http://www.erlang.org) is source built using [erln8](http://erln8.github.io/erln8/) or [kerl](https://github.com/yrashk/kerl). For binary packages use those provided by [Erlang Solutions](https://www.erlang-solutions.com/downloads/download-erlang-otp), but be sure to choose the "Standard" download option or you'll have issues building projects.
  97. ### Dependencies
  98. To build rebar you will need a working installation of Erlang R15 (or later).
  99. Should you want to clone the rebar repository, you will also require git.
  100. #### Downloading
  101. You can download a pre-built binary version of rebar3 based on the last commit from:
  102. https://s3.amazonaws.com/rebar3/rebar3
  103. #### Bootstrapping rebar3
  104. ```sh
  105. $ git clone https://github.com/rebar/rebar3
  106. $ cd rebar3
  107. $ ./bootstrap
  108. ```
  109. ### Developing on rebar3
  110. When developing you can simply run `escriptize` to build your changes but the new escript is under `_build/default/bin/rebar3`
  111. ```sh
  112. $ ./rebar3 escriptize
  113. $ _build/default/bin/rebar3
  114. ```
  115. Contributing to rebar
  116. =====================
  117. Please refer to [CONTRIBUTING](CONTRIBUTING.md).
  118. Community and Resources
  119. -----------------------
  120. In case of problems that cannot be solved through documentation or examples, you
  121. may want to try to contact members of the community for help. The community is
  122. also where you want to go for questions about how to extend rebar, fill in bug
  123. reports, and so on.
  124. The main place to go for questions is the [rebar mailing
  125. list](http://lists.basho.com/pipermail/rebar_lists.basho.com/). If you need
  126. quick feedback, you can try the #rebar channel on
  127. [irc.freenode.net](http://freenode.net). Be sure to check the
  128. [documentation](http://www.rebar3.org/v3.0/docs) first, just to be sure you're not
  129. asking about things with well known answers.
  130. For bug reports, roadmaps, and issues, visit the [github issues
  131. page](https://github.com/rebar/rebar3/issues).
  132. General rebar community resources and links:
  133. - [Rebar Mailing List](http://lists.basho.com/pipermail/rebar_lists.basho.com/)
  134. - #rebar on [irc.freenode.net](http://freenode.net/)
  135. - [issues](https://github.com/rebar/rebar3/issues)
  136. - [Documentation](http://www.rebar3.org/v3.0/docs)