简体   繁体   English

有没有办法在 erlang 中使用 rebar3 创建“.ez”文件?

[英]Is there any way create ".ez" file using rebar3 in erlang?

I know that the support for loading code from archive files is experimental .我知道从存档文件加载代码的支持是实验性的

An archive file for an application can, for example, be created like this:例如,应用程序的存档文件可以这样创建:

zip:create("mnesia-4.4.7.ez",
    ["mnesia-4.4.7"],
    [{cwd, code:lib_dir()},
     {compress, all},
     {uncompress,[".beam",".app"]}]).

But is there any way create ".ez" file using rebar3 conveniently?但是有什么方法可以方便地使用 rebar3 创建“.ez”文件吗?

This rebar3 plugin worked for me.这个rebar3 插件对我有用。 Here's the basic steps.这是基本步骤。

  1. Add an entry for rebar3_archive_plugin to the plugins entry of your ~/.config/rebar3/rebar.config file (I showed git below but I think its in hex too).rebar3_archive_plugin的条目添加到 ~/.config/rebar3/rebar.config 文件的plugins条目中(我在下面显示了 git,但我认为它也是十六进制的)。
{plugins, [
  {rebar3_archive_plugin, {git, "git@github.com:deadtrickster/rebar3_archive_plugin.git", {branch, "master"}}}
]}.
  1. Cd to the app directory and run rebar3 archive cd 到 app 目录并运行rebar3 archive

Alternatively, you could add the rebar3_archive_plugin entry to the rebar.config of each app that needs to be archived.或者,您可以将rebar3_archive_plugin条目添加到需要存档的每个应用程序的 rebar.config 中。 For my personal build machine I prefer the first approach because it works for all apps.对于我个人的构建机器,我更喜欢第一种方法,因为它适用于所有应用程序。 However, the alternate approach may be preferable if you are trying to do this from an automated build system or the main rebar.config file isn't in your control.但是,如果您尝试从自动构建系统执行此操作或者主 rebar.config 文件不受您的控制,则替代方法可能更可取。

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

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