1 Star 0 Fork 0

chuanyuer / rebar3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

Rebar3

Build Status Windows build status

  1. What is Rebar3?
  2. Why Rebar3?
  3. Should I Use Rebar3?
  4. Getting Started
  5. Documentation
  6. Features
  7. Migrating from rebar2
  8. Additional Resources

What is Rebar3

Rebar3 is an Erlang tool that makes it easy to create, develop, and release Erlang libraries, applications, and systems in a repeatable manner.

Rebar3 will:

  • respect and enforce standard Erlang/OTP conventions for project structure so they are easily reusable by the community;
  • manage source dependencies and Erlang packages while ensuring repeatable builds;
  • handle build artifacts, paths, and libraries such that standard development tools can be used without a headache;
  • adapt to projects of all sizes on almost any platform;
  • treat documentation as a feature, and errors or lack of documentation as a bug.

Rebar3 is also a self-contained Erlang script. It is easy to distribute or embed directly in a project. Tasks or behaviours can be modified or expanded with a plugin system flexible enough that even other languages on the Erlang VM will use it as a build tool.

Why Rebar3

Rebar3 is the spiritual successor to rebar 2.x, which was the first usable build tool for Erlang that ended up seeing widespread community adoption. It however had several shortcomings that made it difficult to use with larger projects or with teams with users new to Erlang.

Rebar3 was our attempt at improving over the legacy of Rebar 2.x, providing the features we felt it was missing, and to provide a better environment in which newcomers joining our teams could develop.

Should I use Rebar3?

If your main language for your system is Erlang, that you value repeatable builds and want your various tools to integrate together, we do believe Rebar3 is the best experience you can get.

Getting Started

A getting started guide is maintained on the official documentation website, but installing rebar3 can be done by any of the ways described below

Latest stable compiled version:

$ wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3

From Source (assuming you have a full Erlang install):

$ git clone https://github.com/erlang/rebar3.git
$ cd rebar3
$ ./bootstrap

Stable versions can also be obtained from the releases page.

The rebar3 escript can also extract itself with a run script under the user's home directory:

$ ./rebar3 local install
===> Extracting rebar3 libs to ~/.cache/rebar3/lib...
===> Writing rebar3 run script ~/.cache/rebar3/bin/rebar3...
===> Add to $PATH for use: export PATH=$PATH:~/.cache/rebar3/bin

To keep it up to date after you've installed rebar3 this way you can use rebar3 local upgrade which fetches the latest nightly and extracts to the same place as above.

Rebar3 may also be available on various OS-specific package managers such as FreeBSD Ports. Those are maintained by the community and Rebar3 maintainers themselves are generally not involved in that process.

If you do not have a full Erlang install, we using erln8 or kerl. For binary packages use those provided by Erlang Solutions, but be sure to choose the "Standard" download option or you'll have issues building projects.

Documentation

Rebar3 documentation is maintained on http://www.rebar3.org/docs

Features

Rebar3 supports the following features or tools by default, and may provide many others via the plugin ecosystem:

features Description
Command composition Rebar3 allows multiple commands to be run in sequence by calling rebar3 do <task1>,<task2>,...,<taskN>.
Command dependencies Rebar3 commands know their own dependencies. If a test run needs to fetch dependencies and build them, it will do so.
Command namespaces Allows multiple tools or commands to share the same name.
Compiling Build the project, including fetching all of its dependencies by calling rebar3 compile
Clean up artifacts Remove the compiled beam files from a project with rebar3 clean or just remove the _build directory to remove all compilation artifacts
Code Coverage Various commands can be instrumented to accumulate code coverage data (such as eunit or ct). Reports can be generated with rebar3 cover
Common Test The test framework can be run by calling rebar3 ct
Dependencies Rebar3 maintains local copies of dependencies on a per-project basis. They are fetched deterministically, can be locked, upgraded, fetched from source, packages, or from local directories. See Dependencies on the documentation website. Call rebar3 tree to show the whole dependency tree.
Documentation Print help for rebar3 itself (rebar3 help) or for a specific task (rebar3 help <task>). Full reference at www.rebar3.org.
Dialyzer Run the Dialyzer analyzer on the project with rebar3 dialyzer. Base PLTs for each version of the language will be cached and reused for faster analysis
Edoc Generate documentation using edoc with rebar3 edoc
Escript generation Rebar3 can be used to generate escripts providing an easy way to run all your applications on a system where Erlang is installed
Eunit The test framework can be run by calling rebar3 eunit
Locked dependencies Dependencies are going to be automatically locked to ensure repeatable builds. Versions can be changed with rebar3 upgrade or rebar3 upgrade <app>, or locks can be released altogether with rebar3 unlock.
Packages Hex packages can be listed with rebar3 pkgs. They can be used as dependencies, will be cached locally for faster usage, and a local index will be used and updated with rebar3 update.
Path While paths are managed automatically, you can print paths to the current build directories with rebar3 path.
Plugins Rebar3 can be fully extended with plugins. List or upgrade plugins by using the plugin namespace (rebar3 plugins).
Profiles Rebar3 can have subconfiguration options for different profiles, such as test or prod. These allow specific dependencies or compile options to be used in specific contexts. See Profiles in the docs.
Releases Rebar3 supports building releases with the relx tool, providing a way to ship fully self-contained Erlang systems. Release update scripts for live code updates can also be generated.
Shell A full shell with your applications available can be started with rebar3 shell. From there, call tasks as r3:do(compile) to automatically recompile and reload the code without interruption
Tarballs Releases can be packaged into tarballs ready to be deployed.
Templates Configurable templates ship out of the box (try rebar3 new for a list or rebar3 new help <template> for a specific one). Custom templates are also supported, and plugins can also add their own.
Unstable namespace We use a namespace to provide commands that are still in flux, allowing to test more experimental features we are working on. See rebar3 unstable.
Xref Run cross-reference analysis on the project with xref by calling rebar3 xref.

Migrating From rebar2

The grievances we had with Rebar 2.x were not fixable without breaking compatibility in some very important ways.

A full guide titled From Rebar 2.x to Rebar3 is provided on the documentation website.

Notable modifications include mandating a more standard set of directory structures, changing the handling of dependencies, moving some compilers (such as C, Diameter, ErlyDTL, or ProtoBuffs) to plugins rather than maintaining them in core rebar, and moving release builds from reltool to relx.

Additional Resources

In the case of problems that cannot be solved through documentation or examples, you may want to try to contact members of the community for help. The community is also where you want to go for questions about how to extend rebar, fill in bug reports, and so on.

The main place to go for questions is the rebar mailing list. If you need quick feedback, you can try the #rebar channel on irc.freenode.net. Be sure to check the documentation first, just to be sure you're not asking about things with well-known answers.

For bug reports, roadmaps, and issues, visit the github issues page.

General rebar community resources and links:

To contribute to rebar3, please refer to CONTRIBUTING.

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS

简介

暂无描述 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/baiyunxue/rebar3.git
git@gitee.com:baiyunxue/rebar3.git
baiyunxue
rebar3
rebar3
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891