第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不會自動爲你擴展它們。

相關文章
相關標籤/搜索