Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

175 lignes
6.2 KiB

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