第3章 概述

原文链接    https://erlang.mk/guide/overview.htmlhtml

 

Chapter 3. Overview

 

Now that you know how to get started, let’s take a look at what Erlang.mk can do for you.git

如今你已经知道如何开始使用Erlang.mk了,接下来让咱们来看看Erlang.mk能为你作些什么。shell

 

3.1. Building your project

3.1. 构建你的项目

 

Erlang.mk is first and foremost a build tool. It is especially tailored for Erlang developers and follows widely accepted practices in the Erlang community.app

Erlang.mk首先是一个构建工具。它遵循Erlang社区普遍接受的实践,并特别针对Erlang开发人员量身打造,ide

 

Erlang.mk will happily build all Erlang-specific files you throw at it. Other kinds of files too, like C or C++ code when you are working on a NIF or a port driver .svn

Erlang.mk将很是高兴地替你构建你抛给它的特定的Erlang文件。其余类型的文件也能交由Erlang.mk构建,像是当你致力于编写一个NIF或一个端口驱动程序时使用的C或C++代码。工具

 

Erlang.mk embraces the concept of source dependencies . It can fetch dependency source code using a variety of mechanisms, including fetching from Git, Mercurial or SVN.单元测试

Erlang.mk包含源依赖关系的概念。它可使用各类机制包括从git,mercurial或者svn中获取依赖的源代码。测试

 

Erlang.mk will automatically generate releases when applicable. It can also generate escripts .fetch

Erlang.mk会在适用时自动生成发行版,它也能够生成erlang escripts

 

3.2. Exploring the package index

3.2. 扫描包的索引

 

Erlang.mk comes with a built-in package index . It is built as an extension of the dependency system and is meant to be used for discovery purposes.

Erlang.mk带有一个内置的包索引。它被构建为旨在用于发现目标包的依赖系统扩展。

 

No package is ever installed, they are only used as dependencies and are always project-specific. They can be thought of as a shortcut over plain dependencies.

当没有安装任何软件包时,它们始终仅仅做为特定项目的依赖项。能够被认为是一种简单的依赖关系。

 

You can get a list of all packages known to Erlang.mk by using the search target:

你能够经过使用search target来获取Erlang.mk知道的全部包的列表:

$ make search

 

You can also use this target to search across all packages, for example to find all packages related to Cowboy:

你也可使用这个target在全部包中搜索(某个特定的包),例如,查找全部与Cowboy相关的包:

$ make search q=cowboy

 

3.3. Generating documentation

3.3. 生成文档

 

Erlang.mk supports EDoc and Asciidoc.

Erlang.mk支持EDoc和Asciidoc。

 

EDoc generates HTML documentation directly from your source code.

EDoc直接从你的源代码生成HTML文档。

 

While it is convenient, ask yourself: if all the documentation is inside the source code, why not just open the source code directly? That’s where Asciidoc comes in.

虽然方便,可是试想:若是全部文档都在源文件中,为何不直接打开源文件呢?这就是为何须要引入Asciidoc 的缘由。

 

The Asciidoc plugin expects all documentation to be separate from source. It will generate HTML, PDF, man pages and from the documentation you write in the doc/src/ folder in your repository.

Asciidoc插件但愿全部文档都与源文件分开。它将经过你在存储库的/doc/src/ 文件夹下编写的文档生成HTML、PDF、man pages等。

 

3.4. Running tests

3.4. 运行测试

 

Erlang.mk supports a lot of different testing and static analysis tools.

Erlang.mk支持不少种不一样的测试工具和静态分析工具。

 

The make shell command allows you to test your project manually. You can automate these unit tests with EUnit and test your entire system with Common Test . Code coverage can of course be enabled during tests.

make shell 命令容许你手动测试本身的项目。你可使用 EUnit 自动执行这些单元测试,使用 Common Test 测试你的整个系统。固然,代码覆盖率也能够在测试过程当中启用。

 

Erlang.mk comes with features to make your life easier when setting up and using Continuous integration .

为了让你在设置和使用持续集成时更加轻松,Erlang.mk也提供了一些功能支持。

 

On the static analysis side of things, Erlang.mk comes with support for Dialyzer and Xref , to perform success typing analysis and cross referencing of the code.

在静态分析方面,Erlang.mk经过提供对 Dialyzer Xref 的支持,来实现类型分析和代码的交叉引用分析。

 

3.5. Need more?

3.5. 须要更多吗?

 

Not convinced yet? You can read about why you should use Erlang.mk and its history . And if you’re still not convinced after that, it’s OK! The world would be boring if everyone agreed on everything all the time.

还不肯定是否使用Erlang.mk?你能够阅读 为何你应该使用Erlang.mk 及其 历史。若是以后你还不肯定食是否使用Erlang.mk,也好!若是在任何事上你们观点都一致,那么这个世界将变得很无聊。

相关文章
相关标签/搜索