Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

172 wiersze
5.8 KiB

10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
10 lat temu
  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)
  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 (git, hg, etc).
  12. 3.0 Alpha-4
  13. ====
  14. [DOCUMENTATION](http://www.rebar3.org/v3.0/docs)
  15. This is a preliminary branch, considered to be alpha, and still
  16. very unstable. Use at your own risk, but please do report bugs
  17. and issues encountered and we'll try to resolve problems as
  18. soon as possible.
  19. Compatibility with rebar 2.0 has been broken, and features removed to
  20. limit scope.
  21. ### Commands
  22. | Command | Description |
  23. |----------- |------------ |
  24. | as | Higher-order provider to run multiple tasks in sequence as certain profiles |
  25. | compile | Build project |
  26. | clean | Remove project apps beam files |
  27. | cover | Generate coverage info from data compiled by `eunit --cover` or `ct --cover` |
  28. | ct | Run Common Test suites |
  29. | do | Higher-order provider to run multiple tasks in sequence |
  30. | dialyzer | Run the Dialyzer analyzer on the project |
  31. | edoc | Generate documentation using edoc |
  32. | eunit | Run eunit tests |
  33. | escriptize | Generate escript of project |
  34. | help | Print help for rebar or task |
  35. | new | Create new rebar project from templates |
  36. | pkgs | List available packages |
  37. | release | Build release of project |
  38. | shell | Run shell with project apps in path |
  39. | tar | Package release into tarball |
  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. ### Changes
  45. * Fetches and builds deps if missing when running any command that relies on them
  46. * Automatically recognizes `apps` and `lib` directory structure
  47. * Relx for releases
  48. ### Gone
  49. * Reltool integeration
  50. ### Providers
  51. Providers are the modules that do the work to fulfill a user's command.
  52. Example:
  53. ```erlang
  54. -module(rebar_prv_something).
  55. -behaviour(rebar_provider).
  56. -export([init/1,
  57. do/1,
  58. format_error/1]).
  59. -define(PROVIDER, something).
  60. -define(DEPS, []).
  61. %% ===================================================================
  62. %% Public API
  63. %% ===================================================================
  64. -spec init(rebar_state:state()) -> {ok, rebar_state:state()}.
  65. init(State) ->
  66. State1 = rebar_state:add_provider(State, rebar_provider:create([{name, ?PROVIDER},
  67. {module, ?MODULE},
  68. {bare, false},
  69. {deps, ?DEPS},
  70. {example, "rebar dummy"},
  71. {short_desc, "dummy plugin."},
  72. {desc, ""},
  73. {opts, []}])),
  74. {ok, State1}.
  75. -spec do(rebar_state:state()) -> {ok, rebar_state:state()}.
  76. do(State) ->
  77. %% Do something
  78. {ok, State}.
  79. -spec format_error(any()) -> iolist().
  80. format_error(Reason) ->
  81. io_lib:format("~p", [Reason]).
  82. ```
  83. Building
  84. --------
  85. Recommended installation of [Erlang/OTP](http://www.erlang.org) is binary packages from [Erlang Solutions](https://www.erlang-solutions.com/downloads/download-erlang-otp). For source it is recommended you use [erln8](http://metadave.github.io/erln8/) or [kerl](https://github.com/yrashk/kerl).
  86. ### Dependencies
  87. To build rebar you will need a working installation of Erlang R15 (or later).
  88. Should you want to clone the rebar repository, you will also require git.
  89. #### Downloading
  90. You can download a pre-built binary version of rebar3 based on the last commit from:
  91. https://s3.amazonaws.com/rebar3/rebar3
  92. #### Bootstrapping rebar3
  93. ```sh
  94. $ git clone https://github.com/rebar/rebar3
  95. $ cd rebar3
  96. $ ./bootstrap
  97. ```
  98. ### Developing on rebar3
  99. When developing you can simply run `escriptize` to build your changes but the new escript is under `_build/default/bin/rebar3`
  100. ```sh
  101. $ ./rebar3 escriptize
  102. $ _build/default/bin/rebar3
  103. ```
  104. Contributing to rebar
  105. =====================
  106. Please refer to [CONTRIBUTING](CONTRIBUTING.md).
  107. Community and Resources
  108. -----------------------
  109. In case of problems that cannot be solved through documentation or examples, you
  110. may want to try to contact members of the community for help. The community is
  111. also where you want to go for questions about how to extend rebar, fill in bug
  112. reports, and so on.
  113. The main place to go for questions is the [rebar mailing
  114. list](http://lists.basho.com/pipermail/rebar_lists.basho.com/). If you need
  115. quick feedback, you can try the #rebar channel on
  116. [irc.freenode.net](http://freenode.net). Be sure to check the
  117. [wiki](https://github.com/rebar/rebar/wiki) first, just to be sure you're not
  118. asking about things with well known answers.
  119. For bug reports, roadmaps, and issues, visit the [github issues
  120. page](https://github.com/rebar/rebar/issues).
  121. General rebar community resources and links:
  122. - [Rebar Mailing List](http://lists.basho.com/pipermail/rebar_lists.basho.com/)
  123. - #rebar on [irc.freenode.net](http://freenode.net/)
  124. - [wiki](https://github.com/rebar/rebar/wiki)
  125. - [issues](https://github.com/rebar/rebar/issues)