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.

163 regels
4.8 KiB

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