erlang >如何:将不同项目中的特定应用程序用作dep

ar7v8xwq  于 2022-12-08  发布在  Erlang
关注(0)|答案(1)|浏览(130)

I'm trying to compile my app (app_1) with a dep from another project (proj2) which has some apps (e.g. app_a, app_b, app_c...).
proj2 is has an apps folder in which there are the said apps (app_a etc.).
I'm trying to get app_a, but it also depends on app_b. Whatever I do, I cannot seem to get it to work.
Using this in rebar.config of app_1:

{deps, [{proj2, {git, "git://github.com/scm/pr/proj2", {branch, "master"}}}]}.

I get

Dependency failure: source for proj2 does not contain a recognizable project and can not be built

Similar attempts with app_a instead of proj2, adding the /apps/app_a path etc. do not help. Running rebar3 3.12.0.
Any help would be appreciated in how is it possible. Thanks

bjg7j2ky

bjg7j2ky1#

With rebar3 3.12.0, I don't think this is possible. You might be able to get it to work by using a rebar3.config.script file that downloads the dependency manually before putting it somewhere rebar3 can find it.
rebar3 3.14.0 introduced a git_subdir dependency type, which would look something like this:

{deps, [{proj2, {git_subdir, "git://github.com/scm/pr", {branch, "master"}, "proj2"}}]}.

This is mentioned in an example in the documentation on dependencies , but there aren't many details about it.
So if you're able to upgrade to a newer rebar3 version, it might be worth trying.

相关问题