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.

113 lines
3.0 KiB

преди 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. Indentation
  35. -----------
  36. To have consistent indentation we have vi modeline/emacs local variable
  37. headers in rebar's source files. This works automatically with vi.
  38. With Emacs you have to declare <code>'erlang-indent-level</code>
  39. set to <code>4</code>
  40. as a safe local variable value. If not configured Emacs will prompt
  41. you to save this as part of custom-set-variables:
  42. '(safe-local-variable-values (quote ((erlang-indent-level . 4))))
  43. You can also tell Emacs to ignore file variables:
  44. (setq enable-local-variables nil
  45. enable-local-eval nil)
  46. Writing Commit Messages
  47. -----------------------
  48. One line summary (< 50 characters)
  49. Longer description (wrap at 72 characters)
  50. ### Summary
  51. * Less than 50 characters
  52. * What was changed
  53. * Imperative present tense (fix, add, change)
  54. > Fix bug 123
  55. > Add 'foobar' command
  56. > Change default timeout to 123
  57. * No period
  58. ### Description
  59. * Wrap at 72 characters
  60. * Why, explain intention and implementation approach
  61. * Present tense
  62. ### Atomicity
  63. * Break up logical changes
  64. * Make whitespace changes separately
  65. Dialyzer and Tidier
  66. -------------------
  67. Before you submit a patch check for discrepancies with
  68. [Dialyzer](http://www.erlang.org/doc/man/dialyzer.html):
  69. <pre>
  70. $ cd rebar/
  71. $ ./bootstrap debug
  72. $ dialyzer ebin -Wunmatched_returns -Werror_handling -Wrace_conditions -Wunderspecs
  73. </pre>
  74. It is **strongly recommended** to check the code with
  75. [Tidier](http://tidier.softlab.ntua.gr:20000/tidier/getstarted).
  76. Select all transformation options and enable **automatic**
  77. transformation.
  78. If Tidier suggests a transformation apply the changes **manually**
  79. to the source code.
  80. Do not use the code from the tarball (*out.tgz*) as it will have
  81. white-space changes
  82. applied by Erlang's pretty-printer.