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.

161 lines
5.4 KiB

пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 14 година
пре 10 година
пре 14 година
пре 14 година
  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 Pre-Alpha
  13. ====
  14. This is an experimental branch, considered to be pre-alpha, and still
  15. very unstable. Use at your own risk, and expect no support. See
  16. [the related announcement](http://lists.basho.com/pipermail/rebar_lists.basho.com/2014-November/002087.html).
  17. Compatibility with rebar 2.0 has been broken, and features removed to
  18. limit scope.
  19. ### Commands
  20. | Command | Description |
  21. |----------- |------------ |
  22. | compile | Build project |
  23. | clean | Remove project apps beam files |
  24. | ct | Run Common Test suites |
  25. | do | Higher-order provider to run multiple tasks in sequence |
  26. | dialyzer | Run the Dialyzer analyzer on the project |
  27. | eunit | Run eunit tests |
  28. | help | Print help for rebar or task |
  29. | new | Create new rebar project from templates |
  30. | pkgs | List available packages |
  31. | release | Build release of project |
  32. | shell | Run shell with project apps in path |
  33. | tar | Package release into tarball |
  34. | update | Update package index |
  35. | upgrade | Fetch latest version of dep |
  36. | version | Print current version of Erlang/OTP and rebar |
  37. ### Commands still to do
  38. | Command | Description |
  39. |----------- |------------ |
  40. | escriptize | Generate escript of project |
  41. ### Changes
  42. * Fetches and builds deps if missing when running any command that relies on them
  43. * Automatically recognizes `apps` and `lib` directory structure
  44. * Relx for releases
  45. ### Gone
  46. * Reltool integeration
  47. ### Providers
  48. Providers are the modules that do the work to fulfill a user's command.
  49. Example:
  50. ```erlang
  51. -module(rebar_prv_something).
  52. -behaviour(rebar_provider).
  53. -export([init/1,
  54. do/1]).
  55. -define(PROVIDER, something).
  56. -define(DEPS, []).
  57. %% ===================================================================
  58. %% Public API
  59. %% ===================================================================
  60. -spec init(rebar_state:state()) -> {ok, rebar_state:state()}.
  61. init(State) ->
  62. State1 = rebar_state:add_provider(State, rebar_provider:create([{name, ?PROVIDER},
  63. {module, ?MODULE},
  64. {bare, false},
  65. {deps, ?DEPS},
  66. {example, "rebar dummy"},
  67. {short_desc, "dummy plugin."},
  68. {desc, ""},
  69. {opts, []}])),
  70. {ok, State1}.
  71. -spec do(rebar_state:state()) -> {ok, rebar_state:state()}.
  72. do(State) ->
  73. %% Do something
  74. {ok, State}.
  75. ```
  76. Building
  77. --------
  78. 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).
  79. ### Dependencies
  80. To build rebar you will need a working installation of Erlang R15 (or later).
  81. Should you want to clone the rebar repository, you will also require git.
  82. #### Downloading
  83. You can download a pre-built binary version of rebar3 based on the last commit from:
  84. https://s3.amazonaws.com/rebar3/rebar3
  85. #### Building rebar
  86. ```sh
  87. $ git clone git://github.com/tsloughter/rebar.git
  88. $ cd rebar
  89. $ ./bootstrap/bootstrap
  90. ==> rebar (compile)
  91. Congratulations! You now have a self-contained script called "rebar" in
  92. your current working directory. Place this script anywhere in your path
  93. and you can use rebar to build OTP-compliant apps.
  94. ```
  95. Contributing to rebar
  96. =====================
  97. Please refer to [CONTRIBUTING](CONTRIBUTING.md).
  98. Community and Resources
  99. -----------------------
  100. In case of problems that cannot be solved through documentation or examples, you
  101. may want to try to contact members of the community for help. The community is
  102. also where you want to go for questions about how to extend rebar, fill in bug
  103. reports, and so on.
  104. The main place to go for questions is the [rebar mailing
  105. list](http://lists.basho.com/pipermail/rebar_lists.basho.com/). If you need
  106. quick feedback, you can try the #rebar channel on
  107. [irc.freenode.net](http://freenode.net). Be sure to check the
  108. [wiki](https://github.com/rebar/rebar/wiki) first, just to be sure you're not
  109. asking about things with well known answers.
  110. For bug reports, roadmaps, and issues, visit the [github issues
  111. page](https://github.com/rebar/rebar/issues).
  112. General rebar community resources and links:
  113. - [Rebar Mailing List](http://lists.basho.com/pipermail/rebar_lists.basho.com/)
  114. - #rebar on [irc.freenode.net](http://freenode.net/)
  115. - [wiki](https://github.com/rebar/rebar/wiki)
  116. - [issues](https://github.com/rebar/rebar/issues)