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

135 рядки
3.7 KiB

14 роки тому
14 роки тому
14 роки тому
14 роки тому
14 роки тому
14 роки тому
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 can be found
  14. in the `INSTALL.md` document.
  15. ### Dependencies
  16. To build rebar you will need a working installation of Erlang R13B03 (or
  17. later).
  18. Should you want to clone the rebar repository, you will also require git.
  19. #### Downloading
  20. Clone the git repository:
  21. $ git clone git://github.com/basho/rebar.git
  22. #### Building rebar
  23. $ cd rebar/
  24. $ ./bootstrap
  25. Recompile: src/getopt
  26. ...
  27. Recompile: src/rebar_utils
  28. ==> rebar (compile)
  29. Congratulations! You now have a self-contained script called "rebar" in
  30. your current working directory. Place this script anywhere in your path
  31. and you can use rebar to build OTP-compliant apps.
  32. Contributing to rebar
  33. =====================
  34. Coding style
  35. ------------
  36. Do not introduce trailing whitespace.
  37. Do not introduce lines longer than 80 characters.
  38. ### Indentation
  39. To have consistent indentation we have vi modeline/emacs local variable
  40. headers in rebar's source files. This works automatically with vi.
  41. With Emacs you have to declare <code>'erlang-indent-level</code>
  42. set to <code>4</code>
  43. as a safe local variable value. If not configured Emacs will prompt
  44. you to save this as part of custom-set-variables:
  45. '(safe-local-variable-values (quote ((erlang-indent-level . 4))))
  46. You can also tell Emacs to ignore file variables:
  47. (setq enable-local-variables nil
  48. enable-local-eval nil)
  49. Writing Commit Messages
  50. -----------------------
  51. Structure your commit message like this:
  52. <pre>
  53. One line summary (less than 50 characters)
  54. Longer description (wrap at 72 characters)
  55. </pre>
  56. ### Summary
  57. * Less than 50 characters
  58. * What was changed
  59. * Imperative present tense (fix, add, change)
  60. > Fix bug 123
  61. > Add 'foobar' command
  62. > Change default timeout to 123
  63. * No period
  64. ### Description
  65. * Wrap at 72 characters
  66. * Why, explain intention and implementation approach
  67. * Present tense
  68. ### Atomicity
  69. * Break up logical changes
  70. * Make whitespace changes separately
  71. Dialyzer and Tidier
  72. -------------------
  73. Before you submit a patch check for discrepancies with
  74. [Dialyzer](http://www.erlang.org/doc/man/dialyzer.html):
  75. <pre>
  76. $ cd rebar/
  77. $ ./bootstrap debug
  78. $ dialyzer ebin -Wunmatched_returns -Werror_handling -Wrace_conditions -Wunderspecs
  79. </pre>
  80. The following discrepancies are known and safe to ignore:
  81. <pre>
  82. rebar_templater.erl:249: The call rebar_templater:consult(
  83. Cont1::erl_scan:return_cont(),'eof',
  84. Acc::[any()])
  85. contains an opaque term as 1st argument when terms
  86. of different types are expected in these positions
  87. rebar_utils.erl:144: Call to missing or unexported function escript:foldl/3
  88. rebar_utils.erl:165: The created fun has no local return
  89. </pre>
  90. It is **strongly recommended** to check the code with
  91. [Tidier](http://tidier.softlab.ntua.gr:20000/tidier/getstarted).
  92. Select all transformation options and enable **automatic**
  93. transformation.
  94. If Tidier suggests a transformation apply the changes **manually**
  95. to the source code.
  96. Do not use the code from the tarball (*out.tgz*) as it will have
  97. white-space changes
  98. applied by Erlang's pretty-printer.