第12章 OTP版本管理

原文连接  https://erlang.mk/guide/kerl.htmlhtml

 

Chapter 12. OTP version management

 

Erlang.mk comes with integrated support for Kerl, a shell script that automates the downloading, building and installing of Erlang/OTP. It can be used to easily build a specific Erlang/OTP version (with or without custom build options) or maintain different versions side by side.git

Erlang.mk集成了对Kerl的支持,Kerl是一个能够自动下载、构建和安装 Erlang/OTP 的shell脚本。 它能够用来轻松构建一个特定的 Erlang/OTP 版本(不管是否有自定义构建选项)或同时维护不一样的版本。github

 

12.1. Erlang versions

12.1. Erlang的版本格式

 

Erlang.mk uses the Git tags from Erlang/OTP to identify OTP versions. The most recent tag at the time of writing is OTP-20.0.4, which is a patch release of OTP-20.0. A patch release is a non-official release containing a few fixes on top of the official release.shell

Erlang.mk使用 Erlang/OTP 的Git标签来识别OTP版本。 在编写本文时,最新标签是OTP-20.0.4,它是OTP-20.0的补丁版本。 修补发行版是在正式发行版上包含一些补丁的非官方发行版。ide

 

Older versions used a slightly different versioning scheme and tag format, for example: OTP_R16B03. Beware though, there also was an OTP_R16B03-1 release that fixed a critical issue in the initial release.测试

较早的版本使用稍微不一样的版本方案和标签格式,例如:OTP_R16B03,可是要当心,还有一个OTP_R16B03-1的发行版,它修复了OTP_R16B03中的一个关键问题。ui

 

The README file for all official Erlang/OTP releases can be found on erlang.org. To obtain information about patch releases when they are released you need to be subscribed to the erlang-questions mailing list.this

全部官方 Erlang/OTP 版本的README文件均可以在erlang.org上找到。 要得到补丁版本的相关信息,您须要订阅erlang-questions邮件列表spa

 

12.2. OTP version pinning

12.2. 指定OTP版本

Erlang.mk can use a specific version of Erlang/OTP when interacting with your project. This can be very useful when you are working with a team because you can define the version you need in the Makefile and Erlang.mk will ensure this version is used by everyone in your team.code

Erlang.mk能够为你的项目指定特定版本的 Erlang/OTP。 这对于团队工做可能很是有用,由于你能够在Makefile中定义你须要的版本,Erlang.mk将确保你的团队中的每一个人都使用这个版本的 Erlang/OTP。

 

To pin the version all you need to do is to set the ERLANG_OTP variable in your Makefile before including Erlang.mk. For example, to use OTP-20.0.4:

要指定 Erlang/OTP 版本,你只须要在Makefile包含 Erlang.mk 前设置 ERLANG_OTP 变量。例如,要使用OTP-20.0.4:

ERLANG_OTP = OTP-20.0.4

include erlang.mk

 

The next time you run make Erlang.mk will build and use the version you configured.

下一次运行 make Erlang.mk 时会构建并使用你配置的版本。

 

Note that there has been reports that this functionality is not compatible with the .ONESHELL feature from GNU Make.

请注意,有报告称这个功能与GNU Make的  .ONESHELL 功能不兼容。

 

12.3. Continuous integration

12.3. 持续集成

 

Erlang.mk can automatically test your project against many different Erlang/OTP versions. This functionality is documented in the Continuous integration chapter.

Erlang.mk能够在许多不一样 Erlang/OTP 版本上对你的项目进行自动测试。 该功能在“持续集成”一章中介绍。

 

12.4. Configuring Kerl

12.4. 配置Kerl

 

All of the Kerl variables can be configured directly in the Makefile. All you need to do is to export them. For example, to change the installation directory for the Erlang/OTP versions managed by Kerl, you could add the following to your Makefile:

全部Kerl变量均可以直接在Makefile中配置,你只需导出它们便可。 例如,要更改由Kerl管理的 Erlang/OTP 版本的安装目录,能够将如下内容添加到你的Makefile中:

export KERL_INSTALL_DIR = $(CURDIR)/erlang

 

When configuring paths like this, always make sure to provide an absolute path in the value. Erlang.mk will NOT expand them automatically for you.

当像这样配置路径时,必定要确保赋值是绝对路径。 Erlang.mk不会自动为你扩展它们。

相关文章
相关标签/搜索