Rebar3 不是 "including" 我的非应用程序部门
Rebar3 not "including" my non-application deps
我有简单的功能:
do_stuff(_Whatever) ->
jiffy:decode(<<"{\"foo\": \"bar\"}">>).
如您所见,它依赖于库 jiffy。所以我在 rebar.config
:
中添加了它
{deps, [
{cowboy, {git, "https://github.com/ninenines/cowboy", {tag, "2.0.0-pre.1"}}},
{jiffy, {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}}
]}.
{relx, [{release, { myapp, "0.1.0" },
[vizcerl,
sasl
]},
%{sys_config, "./config/sys.config"},
%{vm_args, "./config/vm.args"},
{dev_mode, true},
{include_erts, false},
{extended_start_script, true}]
}.
但是当我 运行 rebar3 run
和程序执行该操作时,我收到错误消息,指出该函数未定义。
编辑:
我 运行 rebar3 tree
检查 dep 是否被识别,结果如下:
└─ myapp─0.1.0 (project app)
├─ cowboy─2.0.0-pre.1 (git repo)
│ ├─ cowlib─1.0.0 (git repo)
│ └─ ranch─1.0.0 (git repo)
└─ jiffy─0.14.8 (git repo)
jiffy 需要一个不属于 rebar 的端口编译器插件。您可以在 rebar.config 中按如下方式配置它:
{plugins, [
{ pc, {git, "git@github.com:blt/port_compiler.git", {branch, "master"}}}
]}.
{overrides,
[{override, jiffy, [
{plugins, [pc]},
{artifacts, ["priv/jiffy.so"]},
{provider_hooks, [
{post,
[
{compile, {pc, compile}},
{clean, {pc, clean}}
]
}]
}
]}
]}.
我有简单的功能:
do_stuff(_Whatever) ->
jiffy:decode(<<"{\"foo\": \"bar\"}">>).
如您所见,它依赖于库 jiffy。所以我在 rebar.config
:
{deps, [
{cowboy, {git, "https://github.com/ninenines/cowboy", {tag, "2.0.0-pre.1"}}},
{jiffy, {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}}
]}.
{relx, [{release, { myapp, "0.1.0" },
[vizcerl,
sasl
]},
%{sys_config, "./config/sys.config"},
%{vm_args, "./config/vm.args"},
{dev_mode, true},
{include_erts, false},
{extended_start_script, true}]
}.
但是当我 运行 rebar3 run
和程序执行该操作时,我收到错误消息,指出该函数未定义。
编辑:
我 运行 rebar3 tree
检查 dep 是否被识别,结果如下:
└─ myapp─0.1.0 (project app)
├─ cowboy─2.0.0-pre.1 (git repo)
│ ├─ cowlib─1.0.0 (git repo)
│ └─ ranch─1.0.0 (git repo)
└─ jiffy─0.14.8 (git repo)
jiffy 需要一个不属于 rebar 的端口编译器插件。您可以在 rebar.config 中按如下方式配置它:
{plugins, [
{ pc, {git, "git@github.com:blt/port_compiler.git", {branch, "master"}}}
]}.
{overrides,
[{override, jiffy, [
{plugins, [pc]},
{artifacts, ["priv/jiffy.so"]},
{provider_hooks, [
{post,
[
{compile, {pc, compile}},
{clean, {pc, clean}}
]
}]
}
]}
]}.