2012-11-17 9 views

Odpowiedz

13

Po pierwsze, do tego potrzebna jest Scaladoc2, która jest częścią Scala 2.10.

Jeśli zainstalowany jest 2.10, należy również przekazać do Scaladoc opcję -diagrams, aby wygenerować diagramy. Ale jeśli tak może się zdarzyć, że pojawi się następujący komunikat o błędzie:

Graphviz dot encountered an error when generating the diagram for: 
_root_ 
These are usually spurious errors, but if you notice a persistant error on 
a diagram, please use the -diagrams-debug flag and report a bug with the output. 
Graphviz will be restarted... 

Błąd występuje, ponieważ Scaladoc nie generuje diagramy przez siebie, ale próbuje zadzwonić Graphviz, do wykonania tej pracy. Gdy dodamy flagę -diagrams-debug my dobrze się między innymi dokładny komunikat o błędzie:

The following is the log of the failure: 
    Main thread in _root_: Exception: java.io.IOException: Cannot run program "dot": java.io.IOException: error=2, No such file or directory 

Aby rozwiązać ten problem należy też zainstalować program dot, która jest częścią Graphviz. Po wykonaniu tej czynności powinieneś być w stanie pomyślnie wykonać zadanie scaladoc -diagrams <file>.scala i zobaczyć w rezultacie znacznik "Hierarchia typów" nad paskiem wyszukiwania członków w wygenerowanej dokumentacji.

Wykonywanie scaladoc -help przedstawia dalsze informacje na temat opcji Schematy:

-diagrams         Create inheritance diagrams for classes, traits and packages. 
    -diagrams-dot-path <path>     The path to the dot executable used to generate the inheritance diagrams. Eg: /usr/bin/dot 
    -diagrams-dot-restart <n>     The number of times to restart a malfunctioning dot process before disabling diagrams (default: 5) 
    -diagrams-dot-timeout <n>     The timeout before the graphviz dot util is forcefully closed, in seconds (default: 10) 
    -diagrams-max-classes <n>     The maximum number of superclasses or subclasses to show in a diagram 
    -diagrams-max-implicits <n>     The maximum number of implicitly converted classes to show in a diagram 
Powiązane problemy