第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,也好!若是在任何事上你們觀點都一致,那麼這個世界將變得很無聊。

相關文章
相關標籤/搜索