How to merge documentation from SBT multi-projects?
Asked Answered
H

1

10

I am generating the ScalaDoc HTML files for some SBT projects (in a Multi-Project configuration). If I execute doc in the SBT console, the documentation is generated nicely, but it is deployed in a standalone directory for each project. Since all the projects are quite related each other (in terms of package names), I would like to generate a unique ScalaDoc directory as output. It worths mentioning that I can not put all the sources together because of the dual compilation process required by some involved macros. Is there any workaround to do so?

Humber answered 16/4, 2013 at 14:51 Comment(2)
Hi Jesús! Have you looked at github.com/sbt/sbt-unidoc, a "sbt plugin to unify scaladoc/javadoc across multiple projects"? Disclaimer: I never tried it out, and I think it just simplifies running scaladoc on all sources at once; they document that it's compatible with -Ymacro-no-expand.Mainspring
I add it to my backlog, because it seems really interesting for our case. Thanks!Humber
N
4

Unfortunately, scaladoc doesn't work with separate compilation since it cannot merge generated documentation. The docs have to be generated for all sources at once. The solution to the macro problem is to use -Ymacro-no-expand to not expand macros during scaladoc generation. See also https://issues.scala-lang.org/browse/SI-6812

Nitride answered 17/4, 2013 at 15:20 Comment(1)
I didn't find that Scala issue! Thanks Mark.Humber

© 2022 - 2024 — McMap. All rights reserved.