Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

167 рядки
5.8 KiB

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