2015-09-04 38 views
2

自從我完成Erlang之後已經有一段時間了,我想回到它並使用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可以在獨立運行時編譯文件。

+0

相關知識:許多Erlang商店正在脫離螺紋鋼,並已開始使用[Erlang.mk](https://github.com/ninenines/erlang.mk),取得了巨大成功。這可以爲您節省時間和精力。 – Dave

回答

2

你需要添加一個.app.src文件到你的src目錄來定義你的應用程序。內容可能類似於以下內容,但您需要對其進行調整以使其適合您的情況。

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

查看the rebar "Getting Started" docs瞭解更多信息。

+0

確實是這個問題。我很惱火,螺紋鋼在運行時沒有抱怨。 – Fylke

相關問題