【问题标题】:Why doesn't rebar compile my files?为什么 rebar 不编译我的文件?
【发布时间】:2015-11-30 12:13:45
【问题描述】:

自从我完成任何 Erlang 以来已经有一段时间了,我想重新使用它并使用 rebar 来完成它。我有一个简单的模块测试组合,我已经验证可以编译,但是当我尝试通过 rebar 编译它时,没有任何反应:

PS C:\Users\Magnus\Programming\binlog_parser_demo> rebar co -vv
DEBUG: Consult config file "c:/Users/Magnus/Programming/binlog_parser_demo/rebar.config"
DEBUG: Rebar location: "c:/Users/Magnus/Programming/rebar/rebar"
DEBUG: is_rel_dir(C:/Users/Magnus/Programming/binlog_parser_demo) -> false
DEBUG: Available deps: []
DEBUG: Missing deps  : []
DEBUG: Plugins requested while processing C:/Users/Magnus/Programming/binlog_parser_demo: []
DEBUG: Predirs: []
==> binlog_parser_demo (compile)
DEBUG: Matched required ERTS version: 7.0 -> .*
DEBUG: Matched required OTP release: 18 -> .*
DEBUG: Min OTP version unconfigured
DEBUG: Postdirs: []
PS C:\Users\Magnus\Programming\binlog_parser_demo> ls -r

    Directory: C:\Users\Magnus\Programming\binlog_parser_demo

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----               3/9     15:42            src
d----               3/9     14:42            test

    Directory: C:\Users\Magnus\Programming\binlog_parser_demo\src

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---               3/9     14:43       2293 binlog_parser_demo.erl

Directory: C:\Users\Magnus\Programming\binlog_parser_demo\test

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---               3/9     14:51       2662 binlog_parser_demo_tests.erl

我做错了什么?文件结构是我在运行模板rebar create template=simplemod modid=binlog_parser_demo 时得到的(并用我的旧预写文件替换了生成的文件)。我已经验证erlc 在路径中并且可用,并且erlc 在独立运行时可以正常编译文件。

【问题讨论】:

  • 很高兴知道:许多 Erlang 商店正在远离螺纹钢,并开始使用 Erlang.mk 并取得了巨大成功。这可以节省您的时间和精力。

标签: erlang rebar


【解决方案1】:

您需要将.app.src 文件添加到您的src 目录来定义您的应用程序。内容可能类似于以下内容,但您需要对其进行调整以使其适合您的情况。

{application, binlog_parser, [
    {description, "Binlog Parser"},
    {vsn, "0.1"},
    {registered, []},
    {applications, [kernel, stdlib]}
]}.

更多信息请参见the rebar "Getting Started" docs

【讨论】:

  • 这确实是问题所在。我很生气钢筋在运行时没有抱怨这一点。
猜你喜欢
  • 2013-12-26
  • 1970-01-01
  • 2019-06-24
  • 2013-02-08
  • 1970-01-01
  • 2022-01-04
  • 2013-01-03
  • 2014-03-13
  • 1970-01-01
相关资源
最近更新 更多