Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

166 righe
5.7 KiB

10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
10 anni fa
  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. [DOCUMENTATION](http://www.rebar3.org/v3.0/docs)
  15. This is an experimental branch, considered to be pre-alpha, and still
  16. very unstable. Use at your own risk, and expect no support. See
  17. [the related announcement](http://lists.basho.com/pipermail/rebar_lists.basho.com/2014-November/002087.html).
  18. Compatibility with rebar 2.0 has been broken, and features removed to
  19. limit scope.
  20. ### Commands
  21. | Command | Description |
  22. |----------- |------------ |
  23. | as | Higher-order provider to run multiple tasks in sequence as certain profiles |
  24. | compile | Build project |
  25. | clean | Remove project apps beam files |
  26. | ct | Run Common Test suites |
  27. | do | Higher-order provider to run multiple tasks in sequence |
  28. | dialyzer | Run the Dialyzer analyzer on the project |
  29. | edoc | Generate documentation using edoc |
  30. | eunit | Run eunit tests |
  31. | help | Print help for rebar or task |
  32. | new | Create new rebar project from templates |
  33. | pkgs | List available packages |
  34. | release | Build release of project |
  35. | shell | Run shell with project apps in path |
  36. | tar | Package release into tarball |
  37. | update | Update package index |
  38. | upgrade | Fetch latest version of dep |
  39. | version | Print current version of Erlang/OTP and rebar |
  40. | xref | Run cross reference analysis on the project |
  41. ### Commands still to do
  42. | Command | Description |
  43. |----------- |------------ |
  44. | escriptize | Generate escript of project |
  45. ### Changes
  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
  49. ### Gone
  50. * Reltool integeration
  51. ### Providers
  52. Providers are the modules that do the work to fulfill a user's command.
  53. Example:
  54. ```erlang
  55. -module(rebar_prv_something).
  56. -behaviour(rebar_provider).
  57. -export([init/1,
  58. do/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. ```
  80. Building
  81. --------
  82. 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).
  83. ### Dependencies
  84. To build rebar you will need a working installation of Erlang R15 (or later).
  85. Should you want to clone the rebar repository, you will also require git.
  86. #### Downloading
  87. You can download a pre-built binary version of rebar3 based on the last commit from:
  88. https://s3.amazonaws.com/rebar3/rebar3
  89. #### Building rebar
  90. ```sh
  91. $ git clone https://github.com/rebar/rebar3
  92. $ cd rebar
  93. $ ./bootstrap/bootstrap
  94. ==> rebar (compile)
  95. Congratulations! You now have a self-contained script called "rebar" in
  96. your current working directory. Place this script anywhere in your path
  97. and you can use rebar to build OTP-compliant apps.
  98. ```
  99. Contributing to rebar
  100. =====================
  101. Please refer to [CONTRIBUTING](CONTRIBUTING.md).
  102. Community and Resources
  103. -----------------------
  104. In case of problems that cannot be solved through documentation or examples, you
  105. may want to try to contact members of the community for help. The community is
  106. also where you want to go for questions about how to extend rebar, fill in bug
  107. reports, and so on.
  108. The main place to go for questions is the [rebar mailing
  109. list](http://lists.basho.com/pipermail/rebar_lists.basho.com/). If you need
  110. quick feedback, you can try the #rebar channel on
  111. [irc.freenode.net](http://freenode.net). Be sure to check the
  112. [wiki](https://github.com/rebar/rebar/wiki) first, just to be sure you're not
  113. asking about things with well known answers.
  114. For bug reports, roadmaps, and issues, visit the [github issues
  115. page](https://github.com/rebar/rebar/issues).
  116. General rebar community resources and links:
  117. - [Rebar Mailing List](http://lists.basho.com/pipermail/rebar_lists.basho.com/)
  118. - #rebar on [irc.freenode.net](http://freenode.net/)
  119. - [wiki](https://github.com/rebar/rebar/wiki)
  120. - [issues](https://github.com/rebar/rebar/issues)