Git子模块和钢筋

ska*_*tek 3 git erlang mochiweb git-submodules rebar

我的应用程序使用Mochiweb.据我所知,rebar当我运行时从Github获取最新版本make,因为有一行rebar.config:

{deps, [
  {mochiweb, ".*",
   {git, "git://github.com/mochi/mochiweb.git", "master"}}
Run Code Online (Sandbox Code Playgroud)

我的应用程序有一个VCS,它是git.所以,基本上我在另一个内部有一个git存储库:

myapp
 .git
 deps
  mochiweb
   .git
 src
 etc
Run Code Online (Sandbox Code Playgroud)

我知道在另一个内部添加一个git存储库并不是一个好主意(git add .).应该使用Git子模块功能.

所以,我将deps/mochiweb目录作为子模块添加到主git存储库中.

问题是当另一个开发人员克隆他必须的主存储库initupdate子模块时,为了得到deps/mochiweb(否则它将是空的).

如果开发人员make在克隆主存储库后立即运行,则Makefile会显示以下内容:

ERROR: Dependency dir deps/mochiweb failed application validation with reason:

{missing_app_file,"deps/mochiweb"}

make: *** [all] Error 1
Run Code Online (Sandbox Code Playgroud)

我的问题是:在Erlang应用程序的deps中添加另一个应用程序以允许其他开发人员在不使用git子模块的情况下轻松更新的正确方法是什么?

Rob*_*loi 5

将另一个应用程序添加到Erlang应用程序的deps中的正确方法是什么,以允许其他开发人员在不使用git子模块的情况下轻松更新?

将应用程序添加到rebar.config并使用:

./rebar update-deps
Run Code Online (Sandbox Code Playgroud)

用于更新.第一次,你需要使用:

./rebar get-deps
Run Code Online (Sandbox Code Playgroud)

请参阅:https://github.com/basho/rebar/wiki/Rebar-commands

现在,回到你的错误.

我的感觉是你在你的deps中有一个(几乎)空的mochiweb目录,可能是因为玩Git子模块.当你运行get-deps命令时,rebar会默默地丢弃mochiweb,因为目录已经在那里了.但它期望一个OTP应用程序并查找该mochiweb.app文件,该文件不存在(该目录为空).因此,错误.如果我的解释是正确的,你可以简单地做:

rm -rf deps/mochiweb
./rebar get-deps
Run Code Online (Sandbox Code Playgroud)

看看你的rebar.config会有所帮助.