Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

179 Zeilen
6.5 KiB

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