25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
3.8 KiB

14 년 전
13 년 전
13 년 전
13 년 전
13 년 전
13 년 전
13 년 전
  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. [![Build Status](https://secure.travis-ci.org/basho/rebar.png?branch=master)](http://travis-ci.org/basho/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. Building
  13. --------
  14. Information on building and installing [Erlang/OTP](http://www.erlang.org)
  15. can be found [here](https://github.com/erlang/otp/wiki/Installation)
  16. ([more info](https://github.com/erlang/otp/blob/master/INSTALL.md)).
  17. ### Dependencies
  18. To build rebar you will need a working installation of Erlang R13B03 (or
  19. later).
  20. Should you want to clone the rebar repository, you will also require git.
  21. #### Downloading
  22. You can download a pre-built binary version of rebar from:
  23. https://github.com/basho/rebar/wiki/rebar
  24. #### Building rebar
  25. ```sh
  26. $ git clone git://github.com/basho/rebar.git
  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
  52. give [Vim emulation](http://emacswiki.org/emacs/Evil) ([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. Run checks
  76. ----------
  77. Before you submit a patch, run ``make check`` to execute
  78. the test suite and check for
  79. [xref](http://www.erlang.org/doc/man/xref.html) and
  80. [Dialyzer](http://www.erlang.org/doc/man/dialyzer.html)
  81. warnings. You may have to run ``make clean`` first.
  82. [Dialyzer](http://www.erlang.org/doc/man/dialyzer.html) warnings are compared
  83. against a set of safe-to-ignore warnings found in
  84. [dialyzer_reference](https://raw.github.com/basho/rebar/master/dialyzer_reference).
  85. [xref](http://www.erlang.org/doc/man/xref.html) is run with
  86. [custom queries](https://raw.github.com/basho/rebar/master/rebar.config)
  87. to suppress safe-to-ignore warnings.
  88. It is **strongly recommended** to check the code with
  89. [Tidier](http://tidier.softlab.ntua.gr:20000/tidier/getstarted).
  90. Select all transformation
  91. options and enable **automatic** transformation. If Tidier suggests a transformation,
  92. apply the changes **manually** to the source code. Do not use the code from
  93. the
  94. tarball (*out.tgz*) as it will have white-space changes applied by Erlang's pretty-printer.