[erlang-questions] xref: adding directories dinamically
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.
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 :
> 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: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,
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions