第3章 概述

原文连接    https://erlang.mk/guide/overview.html

 

Chapter 3. Overview

 

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

现在你已经知道如何开始使用Erlang.mk了,接下来让我们来看看Erlang.mk能为你做些什么。

 

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.

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

 

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 .

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 .

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,也好!如果在任何事上大家观点都一致,那么这个世界将变得很无聊。

 

转载于:https://my.oschina.net/u/258912/blog/1601114

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值