Created
October 30, 2010 14:00
-
-
Save alexeyr/655324 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(moddeps). | |
-compile(export_all). | |
write_to(Filename) -> | |
xref:start(s), | |
xref:add_directory(s, "ebin"), | |
{ok, Calls} = xref:q(s, "XC"), | |
Mods = [{From, To} || {{From,_,_}, {To,_,_}} <- Calls], | |
A2L = fun atom_to_list/1, | |
file:write_file(Filename, | |
["graph G { \n" | |
, [[$\t, A2L(From), " -- ", A2L(To), " ; ", $\n] | |
|| {From, To} <- Mods] | |
, " }\n"]). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since second argument of
write_file
isiodata()
, this should work as well.