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

148 рядки
4.0 KiB

14 роки тому
14 роки тому
14 роки тому
14 роки тому
14 роки тому
14 роки тому
14 роки тому
14 роки тому
14 роки тому
14 роки тому
14 роки тому
14 роки тому
13 роки тому
14 роки тому
  1. rebar
  2. =====
  3. rebar is an Erlang build tool that makes it easy to compile and
  4. test Erlang applications, port drivers and releases.
  5. rebar is a self-contained Erlang script, so it's easy to distribute or even
  6. embed directly in a project. Where possible, rebar uses standard Erlang/OTP
  7. conventions for project structures, thus minimizing the amount of build
  8. configuration work. rebar also provides dependency management, enabling
  9. application writers to easily re-use common libraries from a variety of
  10. locations (git, hg, etc).
  11. Building
  12. --------
  13. Information on building and installing [Erlang/OTP](http://www.erlang.org)
  14. can be found [here](https://github.com/erlang/otp/wiki/Installation)
  15. ([more info](https://github.com/erlang/otp/blob/master/INSTALL.md)).
  16. ### Dependencies
  17. To build rebar you will need a working installation of Erlang R13B03 (or
  18. later).
  19. Should you want to clone the rebar repository, you will also require git.
  20. #### Downloading
  21. Clone the git repository:
  22. ```sh
  23. $ git clone git://github.com/basho/rebar.git
  24. ```
  25. #### Building rebar
  26. ```sh
  27. $ cd rebar
  28. $ ./bootstrap
  29. Recompile: src/getopt
  30. ...
  31. Recompile: src/rebar_utils
  32. ==> rebar (compile)
  33. Congratulations! You now have a self-contained script called "rebar" in
  34. your current working directory. Place this script anywhere in your path
  35. and you can use rebar to build OTP-compliant apps.
  36. ```
  37. Contributing to rebar
  38. =====================
  39. Pull requests and branching
  40. ---------------------------
  41. Use one topic branch per pull request.
  42. Do not commit to master in your fork.
  43. Provide a clean branch without any merge commits from upstream.
  44. Usually you should squash any intermediate commits into the original single commit.
  45. Code style
  46. ----------
  47. Do not introduce trailing whitespace.
  48. Do not mix spaces and tabs.
  49. Do not introduce lines longer than 80 characters.
  50. [erlang-mode (emacs)](http://www.erlang.org/doc/man/erlang.el.html) indentation is preferred.
  51. vi-only users are encouraged to give [Vim emulation](http://emacswiki.org/emacs/Evil)
  52. ([more info](https://gitorious.org/evil/pages/Home)) a try.
  53. Writing Commit Messages
  54. -----------------------
  55. Structure your commit message like this:
  56. <pre>
  57. One line summary (less than 50 characters)
  58. Longer description (wrap at 72 characters)
  59. </pre>
  60. ### Summary
  61. * Less than 50 characters
  62. * What was changed
  63. * Imperative present tense (fix, add, change)
  64. * `Fix bug 123`
  65. * `Add 'foobar' command`
  66. * `Change default timeout to 123`
  67. * No period
  68. ### Description
  69. * Wrap at 72 characters
  70. * Why, explain intention and implementation approach
  71. * Present tense
  72. ### Atomicity
  73. * Break up logical changes
  74. * Make whitespace changes separately
  75. Dialyzer and Tidier
  76. -------------------
  77. Before you submit a patch check for
  78. [xref](http://www.erlang.org/doc/man/xref.html) and
  79. [Dialyzer](http://www.erlang.org/doc/man/dialyzer.html)
  80. warnings.
  81. A successful run of ``make check`` looks like:
  82. ```sh
  83. $ make check
  84. Recompile: src/rebar_core
  85. ==> rebar (compile)
  86. Command 'debug' not understood or not applicable
  87. Congratulations! You now have a self-contained script called "rebar" in
  88. your current working directory. Place this script anywhere in your path
  89. and you can use rebar to build OTP-compliant apps.
  90. make: [xref_warnings] Error 1 (ignored)
  91. make: [dialyzer_warnings] Error 2 (ignored)
  92. ```
  93. [xref](http://www.erlang.org/doc/man/xref.html) and
  94. [Dialyzer](http://www.erlang.org/doc/man/dialyzer.html) warnings are compared
  95. against a set of safe-to-ignore warnings
  96. found in
  97. [dialyzer_reference](https://raw.github.com/tuncer/rebar/maint/dialyzer_reference)
  98. and
  99. [xref_reference](https://raw.github.com/tuncer/rebar/maint/xref_reference).
  100. It is **strongly recommended** to check the code with
  101. [Tidier](http://tidier.softlab.ntua.gr:20000/tidier/getstarted).
  102. Select all transformation options and enable **automatic**
  103. transformation.
  104. If Tidier suggests a transformation apply the changes **manually**
  105. to the source code.
  106. Do not use the code from the tarball (*out.tgz*) as it will have
  107. white-space changes
  108. applied by Erlang's pretty-printer.