Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

173 rindas
5.8 KiB

pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
pirms 10 gadiem
  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 Alpha-5
  13. ====
  14. [DOCUMENTATION](http://www.rebar3.org/v3.0/docs)
  15. This is a preliminary branch, considered to be alpha, and still
  16. very unstable. Use at your own risk, but please do report bugs
  17. and issues encountered and we'll try to resolve problems as
  18. soon as possible.
  19. Compatibility with rebar 2.0 has been broken, and features removed to
  20. limit scope.
  21. ### Commands
  22. | Command | Description |
  23. |----------- |------------ |
  24. | as | Higher-order provider to run multiple tasks in sequence as certain profiles |
  25. | compile | Build project |
  26. | clean | Remove project apps beam files |
  27. | cover | Generate coverage info from data compiled by `eunit --cover` or `ct --cover` |
  28. | ct | Run Common Test suites |
  29. | do | Higher-order provider to run multiple tasks in sequence |
  30. | dialyzer | Run the Dialyzer analyzer on the project |
  31. | edoc | Generate documentation using edoc |
  32. | eunit | Run eunit tests |
  33. | escriptize | Generate escript of project |
  34. | help | Print help for rebar or task |
  35. | new | Create new rebar project from templates |
  36. | pkgs | List available packages |
  37. | release | Build release of project |
  38. | report | Report on environment and versions for bug reports |
  39. | shell | Run shell with project apps in path |
  40. | tar | Package release into tarball |
  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. ### 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. format_error/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. -spec format_error(any()) -> iolist().
  81. format_error(Reason) ->
  82. io_lib:format("~p", [Reason]).
  83. ```
  84. Building
  85. --------
  86. 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).
  87. ### Dependencies
  88. To build rebar you will need a working installation of Erlang R15 (or later).
  89. Should you want to clone the rebar repository, you will also require git.
  90. #### Downloading
  91. You can download a pre-built binary version of rebar3 based on the last commit from:
  92. https://s3.amazonaws.com/rebar3/rebar3
  93. #### Bootstrapping rebar3
  94. ```sh
  95. $ git clone https://github.com/rebar/rebar3
  96. $ cd rebar3
  97. $ ./bootstrap
  98. ```
  99. ### Developing on rebar3
  100. When developing you can simply run `escriptize` to build your changes but the new escript is under `_build/default/bin/rebar3`
  101. ```sh
  102. $ ./rebar3 escriptize
  103. $ _build/default/bin/rebar3
  104. ```
  105. Contributing to rebar
  106. =====================
  107. Please refer to [CONTRIBUTING](CONTRIBUTING.md).
  108. Community and Resources
  109. -----------------------
  110. In case of problems that cannot be solved through documentation or examples, you
  111. may want to try to contact members of the community for help. The community is
  112. also where you want to go for questions about how to extend rebar, fill in bug
  113. reports, and so on.
  114. The main place to go for questions is the [rebar mailing
  115. list](http://lists.basho.com/pipermail/rebar_lists.basho.com/). If you need
  116. quick feedback, you can try the #rebar channel on
  117. [irc.freenode.net](http://freenode.net). Be sure to check the
  118. [wiki](https://github.com/rebar/rebar/wiki) first, just to be sure you're not
  119. asking about things with well known answers.
  120. For bug reports, roadmaps, and issues, visit the [github issues
  121. page](https://github.com/rebar/rebar/issues).
  122. General rebar community resources and links:
  123. - [Rebar Mailing List](http://lists.basho.com/pipermail/rebar_lists.basho.com/)
  124. - #rebar on [irc.freenode.net](http://freenode.net/)
  125. - [wiki](https://github.com/rebar/rebar/wiki)
  126. - [issues](https://github.com/rebar/rebar/issues)