You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

181 regels
6.6 KiB

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