钢筋:缺少应用程序目录

rkm*_*max 5 erlang rebar reltool

我正在测试螺纹钢

  • Windows 8 64Bis
  • Erlang 64bits R15B02

我从github代码编译了rebar并创建了一个基本应用程序

$ mkdir testapp; cd testapp
$ mkdir rel
$ rebar create-app appid=testapp
$ echo "{sub_dirs, ["rel"]}." > rebar.config
$ cd rel
$ rebar create-node nodeid=testnode
$ cd -
$ rebar compile
$ rebar generate    
ERROR: generate failed while processing testapp/rel: {'EXIT',{{badmatch,{error,"testapp: : Missing application directory."}
...
Run Code Online (Sandbox Code Playgroud)

我正在阅读reltool文档,但我无法找到有关应用程序目录的任何内容,唯一相关的选项是incl_cond默认情况下由rebar命令定义

SRC/testapp.app.src

{application, testapp,
 [
  {description, ""},
  {vsn, "1"},
  {registered, []},
  {applications, [
                  kernel,
                  stdlib
                 ]},
  {mod, { testapp_app, []}},
  {env, []}
 ]}.
Run Code Online (Sandbox Code Playgroud)

相对/ reltool.config

{sys, [
       {lib_dirs, []},
       {erts, [{mod_cond, derived}, {app_file, strip}]},
       {app_file, strip},
       {rel, "testapp", "1",
        [
         kernel,
         stdlib,
         sasl,
         testapp
        ]},
       {rel, "start_clean", "",
        [
         kernel,
         stdlib
        ]},
       {boot_rel, "testapp"},
       {profile, embedded},
       {incl_cond, derived},
       {mod_cond, derived},
       {excl_archive_filters, [".*"]}, %% Do not archive built libs
       {excl_sys_filters, ["^bin/.*", "^erts.*/bin/(dialyzer|typer)",
                           "^erts.*/(doc|info|include|lib|man|src)"]},
       {excl_app_filters, ["\.gitignore"]},
       {app, testapp, [{mod_cond, app}, {incl_cond, include}]}
      ]}.

{target_dir, "testapp"}.

{overlay, [
           {mkdir, "log/sasl"},
           {copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
           {copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
           {copy, "files/testapp", "bin/testapp"},
           {copy, "files/testapp.cmd", "bin/testapp.cmd"},
           {copy, "files/start_erl.cmd", "bin/start_erl.cmd"},
           {copy, "files/install_upgrade.escript", "bin/install_upgrade.escript"},
           {copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
           {copy, "files/vm.args", "releases/\{\{rel_vsn\}\}/vm.args"}
          ]}.
Run Code Online (Sandbox Code Playgroud)

Jak*_* M. 7

在我的情况下,我不得不修改默认rel/reltool.config

   {lib_dirs, []},
Run Code Online (Sandbox Code Playgroud)

   {lib_dirs, ["../../"]},
Run Code Online (Sandbox Code Playgroud)

我项目的布局是:

Makefile
ebin/   
rebar.config
rel/    
src/
Run Code Online (Sandbox Code Playgroud)


Ali*_*lin 4

这可能对你有帮助(如果原始链接消失,请在下面引用)

但不完全确定 R15B01 之后的版本发生这种变化的原因是什么。

感谢 Siri,R15B01 中的 reltool 包含了一个非常有用的功能。

许多 Erlang 项目使用以下结构:
./src/foo.app.src
./src/foo.erl
./rel/reltool.config

当您想在 rel/reltool.config 中引用应用程序 foo 时,您之前有三个选择:
* 项目本地 libs/ 或 apps/ 目录
* 不安全的 {lib_dirs, "../.."} reltool.config 设置
* rebar_reltool_link fake_lib_dir 插件

从 R15B01 开始,您现在要做的就是 在 reltool.config 中为不在 lib_dirs 中的应用程序指定
{app, foo, [{incl_cond, include}, {lib_dir, ".."}]} 。

虽然 R15B01 仍在开发中,但该功能已经完成,可以在 otp.git maint 分支中使用。