简体   繁体   English

如何创建一个不是Erlang OTP应用程序的钢筋模块?

[英]How to create a rebar module that is not an Erlang OTP app?

Is it possible to use rebar to create a simple project module skeleton that is not based on an OTP application ? 是否可以使用rebar创建一个基于OTP应用程序的简单项目模块框架? Overall I want to use that project structure to become a library for other rebar generated applications. 总的来说,我想使用该项目结构成为其他钢筋生成的应用程序的库。

The structure should be as follows: 结构应如下:

/myprojectlib 
     /src
     /ebin
     /deps

The idea is to use it on the deps section of a rebar.config file: 我的想法是在rebar.config文件的deps部分使用它:

{ deps, [myprojectlib] }.

At the moment, because myprojectlib is not a rebar project (and an OTP app) the rebar compilation fails with the message that it cannot identify myprojectlib, even if it is in the /deps directory of the target folder. 目前,由于myprojectlib不是钢筋项目(和OTP应用程序),因此钢筋编译失败,并显示无法识别myprojectlib的消息,即使它位于目标文件夹的/ deps目录中。 I checked further and it appears that the deps of the rebar.config file only accepts other rebar projects, hence my need to create a simple rebar project which is not an OTP application. 我进一步检查了,似乎rebar.config文件的deps只接受其他rebar项目,因此我需要创建一个不是OTP应用程序的简单rebar项目。

Erlang libraries are apps. Erlang库是应用程序。 They are however called library apps. 然而,它们被称为库应用程序。

You can create a sample library app with rebar create-lib libid=myprojectlib . 您可以使用rebar create-lib libid=myprojectlib创建示例库应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM