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.

164 lines
5.1 KiB

пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 10 година
пре 14 година
пре 14 година
пре 14 година
  1. rebar
  2. =====
  3. rebar 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/tsloughter/rebar.svg?branch=rebar3)](https://travis-ci.org/tsloughter/rebar)
  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
  13. ====
  14. This is an experimental branch.
  15. ### Commands
  16. | Command | Description |
  17. |----------- |------------ |
  18. | compile | Build project |
  19. | clean | Remove project apps beam files |
  20. | do | Higher-order provider to run multiple tasks in sequence |
  21. | help | Print help for rebar or task |
  22. | new | Create new rebar project from templates |
  23. | pkgs | List available packages |
  24. | release | Build release of project |
  25. | tar | Package release into tarball |
  26. | shell | Run shell with project apps in path |
  27. | update | Update package index |
  28. | upgrade | Fetch latest version of dep |
  29. | version | Print current version of Erlang/OTP and rebar |
  30. The following commands are still in the works.
  31. | Command | Description |
  32. |----------- |------------ |
  33. | eunit | |
  34. | ct | |
  35. ### Missing
  36. * Pre and post hooks
  37. * Compilers besides erlc
  38. ### Changes
  39. * Fetches and builds deps if missing when running any command that relies on them
  40. * Automatically recognizes `apps` and `libs` directory structure
  41. * `escriptize` requires `escript_top_level_app` set in `rebar.config`
  42. * Relx for releases
  43. ### Gone
  44. * Reltool integeration
  45. ### Providers
  46. Providers are the modules that do the work to fulfill a user's command.
  47. Example:
  48. ```erlang
  49. -module(rebar_prv_something).
  50. -behaviour(rebar_provider).
  51. -export([init/1,
  52. do/1]).
  53. -define(PROVIDER, something).
  54. -define(DEPS, []).
  55. %% ===================================================================
  56. %% Public API
  57. %% ===================================================================
  58. -spec init(rebar_state:state()) -> {ok, rebar_state:state()}.
  59. init(State) ->
  60. State1 = rebar_state:add_provider(State, rebar_provider:create([{name, ?PROVIDER},
  61. {module, ?MODULE},
  62. {bare, false},
  63. {deps, ?DEPS},
  64. {example, "rebar dummy"},
  65. {short_desc, "dummy plugin."},
  66. {desc, ""},
  67. {opts, []}])),
  68. {ok, State1}.
  69. -spec do(rebar_state:state()) -> {ok, rebar_state:state()}.
  70. do(State) ->
  71. %% Do something
  72. {ok, State}.
  73. ```
  74. Building
  75. --------
  76. Information on building and installing [Erlang/OTP](http://www.erlang.org) can
  77. be found [here](https://github.com/erlang/otp/wiki/Installation) ([more
  78. info](https://github.com/erlang/otp/blob/master/INSTALL.md)).
  79. ### Dependencies
  80. To build rebar you will need a working installation of Erlang R13B03 (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 rebar from:
  84. https://github.com/rebar/rebar/wiki/rebar
  85. #### Building rebar
  86. ```sh
  87. $ git clone git://github.com/rebar/rebar.git
  88. $ cd rebar
  89. $ ./bootstrap/bootstrap
  90. Recompile: src/getopt
  91. ...
  92. Recompile: src/rebar_utils
  93. ==> rebar (compile)
  94. Congratulations! You now have a self-contained script called "rebar" in
  95. your current working directory. Place this script anywhere in your path
  96. and you can use rebar to build OTP-compliant apps.
  97. ```
  98. Contributing to rebar
  99. =====================
  100. Please refer to [CONTRIBUTING](CONTRIBUTING.md).
  101. Community and Resources
  102. -----------------------
  103. In case of problems that cannot be solved through documentation or examples, you
  104. may want to try to contact members of the community for help. The community is
  105. also where you want to go for questions about how to extend rebar, fill in bug
  106. reports, and so on.
  107. The main place to go for questions is the [rebar mailing
  108. list](http://lists.basho.com/pipermail/rebar_lists.basho.com/). If you need
  109. quick feedback, you can try the #rebar channel on
  110. [irc.freenode.net](http://freenode.net). Be sure to check the
  111. [wiki](https://github.com/rebar/rebar/wiki) first, just to be sure you're not
  112. asking about things with well known answers.
  113. For bug reports, roadmaps, and issues, visit the [github issues
  114. page](https://github.com/rebar/rebar/issues).
  115. General rebar community resources and links:
  116. - [Rebar Mailing List](http://lists.basho.com/pipermail/rebar_lists.basho.com/)
  117. - #rebar on [irc.freenode.net](http://freenode.net/)
  118. - [wiki](https://github.com/rebar/rebar/wiki)
  119. - [issues](https://github.com/rebar/rebar/issues)