On Mon, 3 Jun 2013 14:04:25 -0700 (PDT)
bewan...@gmail.com wrote:
> I knew Project.graphSettings can show the graphs of sbt settings. Is there
> a way to create .dot files for scala classes and files?
>
> The incremental compiler uses Relations internal to invalidate sources. How
> can I get the relations of classes and generate a .dot file?
The DotGraph object has some convenience methods for generating dot files from Relations. This is not an official, documented API, but it should be straightforward. You can get the Relations from the result of `compile`. For example,
$ sbt
> console-project
> val (_, analysis) = runTask(compile in Compile, currentState)
> DotGraph.sources(analysis.relations, file("dot"), Nil)
$ dot -Tpng -osrcDeps.png dot/int-source-deps
The Nil argument is the list of source directories, which is used to relativize the file paths. When unspecified, as here, the graph just has the source file name.
-Mark
> We have troubles in a play project. Usually one file change will propagate
> to all files recompilation. If we can get the graph of all classes, we can
> figure out how to make classes decoupled and won't recompile every file.
>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
simple-build-t...@googlegroups.com.
> To post to this group, send email to
simple-b...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/simple-build-tool?hl=en.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>