第12章 OTP版本管理

原文链接  https://erlang.mk/guide/kerl.html

 

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.

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

 

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.

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

 

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中的一个关键问题。

 

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.

所有官方 Erlang/OTP 版本的README文件都可以在erlang.org上找到。 要获得补丁版本的相关信息,您需要订阅erlang-questions邮件列表

 

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.

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不会自动为你扩展它们。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值