[erlang-questions] xref: adding directories dinamically

João Neves sevenjp@REDACTED
Tue Apr 15 14:56:54 CEST 2014

You might get some clues from what I do in iota here (scan/2 and
get_applications/2 are probably the only functions you'll be interested in):


You might notice I'm adding the applications to xref *before* I even add
the ebin directories to the code path. Unfortunately I don't have enough
information to help you directly, but at a first glance I don't see
anything obviously wrong (though I might be missing it, it's been a while
since I played around with this).

My code could probably get a nice dose of simplification, but at least it's
known to work AFAIK.

João Neves

2014-04-15 13:42 GMT+02:00 Oscar Felipe <groovenino@REDACTED>:

> Hi All,
> I can successfully import the dependencies I need in my node importing
> them manually with -pa as following:
> erl -pa ebin deps/*/ebin /path/to/release/*/ebin
> Then I start xref and add a release without errors.
> Whereas when I start a node and try to add the path in this way :
> code:add_patha("ebin"),
> Libs = filelib:wildcard("/path/to/release/*/ebin"),
>  Deps = filelib:wildcard("deps/*/ebin"),
> code:add_pathsa(Libs ++ Deps)
> This does not work, despite that file:get_cwd() gives the same result as
> when I load the libraries manually including the paths with -pa flag.
> After that I also tried to add the directories to xref without success:
> xref:start(xr),
> [xref:add_directory(xr,D) || D <- Libs ++ Deps].
> What do I am missing to provide all the paths that xref needs to start?
> I really appreciate any help you can provide,
> [Oscar]
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140415/55f6bdfd/attachment.htm>

More information about the erlang-questions mailing list