11

Is it possible to generate diagrams with Scaladoc and SBT?

I tried to add this line in my build.sbt: scalacOptions in (Compile,doc) := Seq("-diagrams", "-diagrams-debug")

But I receive: Diagram generation running time breakdown:

diagrams model filtering
========================
count:        242 items
total time:   0 ms
average time: 0 ms
maximum time: 0 ms

diagrams model generation
=========================
count:        242 items
total time:   45 ms
average time: 0 ms
maximum time: 11 ms

dot diagram generation
======================
count:        89 items
total time:   24 ms
average time: 0 ms
maximum time: 3 ms

dot process runnning
====================
count:        89 items
total time:   590 ms
average time: 6 ms
maximum time: 512 ms

svg processing
==============
count:        89 items
total time:   269 ms
average time: 3 ms
maximum time: 88 ms

Broken images: 238
Fixed images: 0

How can I get more logs about the "Broken images"?

Thanks.

EDIT:

The command last shows me:

[debug] Calling Scaladoc with arguments:
[debug]         -diagrams
[debug]         -diagrams-debug
[debug]         -d
[debug]         /.../target/scala-2.10/api
[debug]         -bootclasspath
[debug]         /usr/lib/jvm/java-7-openjdk/jre/lib/resources.jar:/usr/lib/jvm/java-7-openjdk/jre/lib/rt.jar:/usr/lib/jvm/java-7-openjdk/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-openjdk/jre/lib/jsse.jar:/usr/lib/jvm/java-7-openjdk/jre/lib/jce.jar:/usr/lib/jvm/java-7-openjdk/jre/lib/charsets.jar:/usr/lib/jvm/java-7-openjdk/jre/lib/rhino.jar:/usr/lib/jvm/java-7-openjdk/jre/lib/jfr.jar:/usr/lib/jvm/java-7-openjdk/jre/classes:/home/thibaud/.sbt/boot/scala-2.10.4/lib/scala-library.jar
[debug]         -classpath
... my classpath and my classes
[info] Main Scala API documentation successful.
[success] Total time: 18 s, completed 23 oct. 2015 15:10:32
Thibaud Dauce
  • 367
  • 4
  • 14
  • 3
    [This answer](http://stackoverflow.com/a/13435475/3165552) describes that [Graphviz](http://www.graphviz.org) must be installed in order to make this work properly, although the provided information doesn't contain any hint on this behalf, maybe this is already the cause of the problem? – isaias-b Oct 24 '15 at 12:05
  • Graphviz is installed on my computer and I can run `dot` from the command line – Thibaud Dauce Nov 05 '15 at 09:09
  • I guess you can not easily get more logs. Digging into [scala.tools.nsc.doc.html.page.diagram.DotDiagramGenerator](https://github.com/scala/scala/blob/v2.10.4/src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala) and DiagramStats from the same package: from line 388 of DotDiagramGenerator and the generated diagrams one can gain the following insight: dot seems to sometimes forget to include the little `c`s, `o`s and `t`s to the left of a template name in the diagrams resulting in an increased broken image count. – Johann-Christoph Jacob Dec 18 '15 at 23:31

1 Answers1

0

Is it possible to generate diagrams with Scaladoc and SBT?

Since this is one of more highly voted questions tagged sbt, I'll try to answer it. I tried using Scala 2.11.8 and 2.12.0-M4, but neither worked for me. There are some problems with Scaladoc diagram generation itself, not sbt. See for example SI-7950: Running ScalaDoc with -diagram fails on OS X 10.9 (Mavericks). I also tried running scaladoc directly, and I still get the similar error messages.

One theory I've heard is that scaladoc is too sensitive to dot warning messages. So there's been a hack of wrapping dot with the following:

#!/bin/bash
/usr/local/bin/dot "$@" 2> >( grep -v  "CoreText performance note:" >&2 )

Using the above script did not work for me. So likely it's not possible at this time.

Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319