Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

180 строки
6.5 KiB

10 лет назад
9 лет назад
9 лет назад
10 лет назад
10 лет назад
10 лет назад
9 лет назад
10 лет назад
10 лет назад
10 лет назад
10 лет назад
10 лет назад
10 лет назад
10 лет назад
9 лет назад
9 лет назад
10 лет назад
9 лет назад
9 лет назад
10 лет назад
10 лет назад
10 лет назад
10 лет назад
10 лет назад
10 лет назад
10 лет назад
10 лет назад
9 лет назад
10 лет назад
10 лет назад
10 лет назад
10 лет назад
14 лет назад
10 лет назад
10 лет назад
14 лет назад
10 лет назад
9 лет назад
9 лет назад
9 лет назад
9 лет назад
  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-2
  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. | pkgs | List available packages |
  32. | plugins | List or upgrade plugins |
  33. | release | Build release of project |
  34. | relup | Creates relup from 2 releases |
  35. | report | Report on environment and versions for bug reports |
  36. | shell | Run shell with project apps in path |
  37. | tar | Package release into tarball |
  38. | tree | Print dependency tree |
  39. | unlock | Unlock dependencies |
  40. | update | Update package index |
  41. | upgrade | Fetch latest version of dep |
  42. | version | Print current version of Erlang/OTP and rebar |
  43. | xref | Run cross reference analysis on the project |
  44. A more complete list can be found on the [docs page](http://www.rebar3.org/v3.0/docs/commands)
  45. ### Changes
  46. #### Since Rebar 2.x
  47. * Fetches and builds deps if missing when running any command that relies on them
  48. * Automatically recognizes `apps` and `lib` directory structure
  49. * Relx for releases and relups
  50. * deterministic builds and conflict resolution
  51. * New plugin handling mechanism
  52. * New hook mechanism
  53. * Support for packages
  54. * A ton more
  55. ### Gone
  56. * Reltool integeration
  57. * Quickcheck integration (moved to [a plugin](http://www.rebar3.org/v3.0/docs/using-available-plugins#quickcheck))
  58. * C code compiling (moved to [a plugin](http://www.rebar3.org/v3.0/docs/using-available-plugins#port-compiler) or hooks)
  59. ### Providers
  60. Providers are the modules that do the work to fulfill a user's command.
  61. Example:
  62. ```erlang
  63. -module(rebar_prv_something).
  64. -behaviour(rebar_provider).
  65. -export([init/1,
  66. do/1,
  67. format_error/1]).
  68. -define(PROVIDER, something).
  69. -define(DEPS, []).
  70. %% ===================================================================
  71. %% Public API
  72. %% ===================================================================
  73. -spec init(rebar_state:state()) -> {ok, rebar_state:state()}.
  74. init(State) ->
  75. State1 = rebar_state:add_provider(State, rebar_provider:create([{name, ?PROVIDER},
  76. {module, ?MODULE},
  77. {bare, false},
  78. {deps, ?DEPS},
  79. {example, "rebar dummy"},
  80. {short_desc, "dummy plugin."},
  81. {desc, ""},
  82. {opts, []}])),
  83. {ok, State1}.
  84. -spec do(rebar_state:state()) -> {ok, rebar_state:state()}.
  85. do(State) ->
  86. %% Do something
  87. {ok, State}.
  88. -spec format_error(any()) -> iolist().
  89. format_error(Reason) ->
  90. io_lib:format("~p", [Reason]).
  91. ```
  92. Building
  93. --------
  94. 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.
  95. ### Dependencies
  96. To build rebar you will need a working installation of Erlang R15 (or later).
  97. Should you want to clone the rebar repository, you will also require git.
  98. #### Downloading
  99. You can download a pre-built binary version of rebar3 based on the last commit from:
  100. https://s3.amazonaws.com/rebar3/rebar3
  101. #### Bootstrapping rebar3
  102. ```sh
  103. $ git clone https://github.com/rebar/rebar3
  104. $ cd rebar3
  105. $ ./bootstrap
  106. ```
  107. ### Developing on rebar3
  108. When developing you can simply run `escriptize` to build your changes but the new escript is under `_build/default/bin/rebar3`
  109. ```sh
  110. $ ./rebar3 escriptize
  111. $ _build/default/bin/rebar3
  112. ```
  113. Contributing to rebar
  114. =====================
  115. Please refer to [CONTRIBUTING](CONTRIBUTING.md).
  116. Community and Resources
  117. -----------------------
  118. In case of problems that cannot be solved through documentation or examples, you
  119. may want to try to contact members of the community for help. The community is
  120. also where you want to go for questions about how to extend rebar, fill in bug
  121. reports, and so on.
  122. The main place to go for questions is the [rebar mailing
  123. list](http://lists.basho.com/pipermail/rebar_lists.basho.com/). If you need
  124. quick feedback, you can try the #rebar channel on
  125. [irc.freenode.net](http://freenode.net). Be sure to check the
  126. [documentation](http://www.rebar3.org/v3.0/docs) first, just to be sure you're not
  127. asking about things with well known answers.
  128. For bug reports, roadmaps, and issues, visit the [github issues
  129. page](https://github.com/rebar/rebar3/issues).
  130. General rebar community resources and links:
  131. - [Rebar Mailing List](http://lists.basho.com/pipermail/rebar_lists.basho.com/)
  132. - #rebar on [irc.freenode.net](http://freenode.net/)
  133. - [issues](https://github.com/rebar/rebar3/issues)
  134. - [Documentation](http://www.rebar3.org/v3.0/docs)