<div dir="ltr">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):<div><br></div><div><a href="https://github.com/jpgneves/iota/blob/master/src/iota_scanner.erl">https://github.com/jpgneves/iota/blob/master/src/iota_scanner.erl</a><br>
</div><div><br></div><div>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).</div>
<div><br></div><div>My code could probably get a nice dose of simplification, but at least it's known to work AFAIK.</div></div><div class="gmail_extra"><br clear="all"><div>--<br>João Neves</div>
<br><br><div class="gmail_quote">2014-04-15 13:42 GMT+02:00 Oscar Felipe <span dir="ltr"><<a href="mailto:groovenino@gmail.com" target="_blank">groovenino@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">Hi All,<br></div><div style="font-family:arial,sans-serif;font-size:13px">I can successfully import the dependencies I need in my node importing them manually with -pa as following:</div>
<div style="font-family:arial,sans-serif;font-size:13px">erl -pa ebin deps/*/ebin /path/to/release/*/ebin</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
Then I start xref and add a release without errors.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Whereas when I start a node and try to add the path in this way :</div>
<div style="font-family:arial,sans-serif;font-size:13px">code:add_patha("ebin"),</div><div style="font-family:arial,sans-serif;font-size:13px">Libs = filelib:wildcard("/path/to/release/*/ebin"),</div>
<div style="font-family:arial,sans-serif;font-size:13px">
Deps = filelib:wildcard("deps/*/ebin"),</div><div style="font-family:arial,sans-serif;font-size:13px">code:add_pathsa(Libs ++ Deps)</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
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. </div><div style="font-family:arial,sans-serif;font-size:13px">After that I also tried to add the directories to xref without success:</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">xref:start(xr),</div><div style="font-family:arial,sans-serif;font-size:13px">[xref:add_directory(xr,D) || D <- Libs ++ Deps].</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">What do I am missing to provide all the paths that xref needs to start? </div><div style="font-family:arial,sans-serif;font-size:13px">
I really appreciate any help you can provide,</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">[Oscar]</div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>