Skip to content

Commit 30d3d0b

Browse files
committed
Fix #8769: change dottydoc root to docs/ subdirectory
Previously it defaulted to the project root which lead to various issues, notably it meant that the whope project ended up being copied in _site when running `sbt doc`, what's even more fun is that when I tried using sbt 1.4.0-RC1 this caused a compiler crash because it ended up trying to copy a socket file that sbt had created in `target/`. Usincs "docs/" like this still doesn't really make sense when multiple subprojects exist since we'll try using the same directory for all of them, but it's less worse than what we had before and it doesn't seem worth investing more time in dottydoc since it's getting replaced.
1 parent 333ab8e commit 30d3d0b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class ScalaSettings extends Settings.SettingGroup {
187187
"-siteroot",
188188
"site root",
189189
"A directory containing static files from which to generate documentation.",
190-
sys.props("user.dir")
190+
"./docs"
191191
)
192192

193193

doc-tool/src/dotty/tools/dottydoc/DocDriver.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ class DocDriver extends Driver {
5656

5757
if (projectName.isEmpty)
5858
report.error(s"Site project name not set. Use `-project <title>` to set the project name")
59-
else if (!siteRoot.exists || !siteRoot.isDirectory)
60-
report.error(s"Site root does not exist: $siteRoot")
59+
else if (!siteRoot.exists)
60+
report.echo(s"Site root (`-siteroot`) does not exist: $siteRoot, no documentation will be generated.")
61+
else if (!siteRoot.isDirectory)
62+
report.error(s"Site root (`-siteroot`) is not a directory: $siteRoot")
6163
else {
6264
def generateSite(outDir: File, baseUrl: String) =
6365
Site(siteRoot, outDir, projectName, projectVersion, projectUrl, projectLogo, ctx.docbase.packages, baseUrl)

0 commit comments

Comments
 (0)