typelevel / sbt-typelevel

Let sbt work for you.
https://typelevel.org/sbt-typelevel/
Apache License 2.0
170 stars 47 forks source link

`sbt 'doc'` task is broken when the project root directory contains a `.` #618

Closed CJSmith-0141 closed 1 year ago

CJSmith-0141 commented 1 year ago

I had a project located at surreal.scala that I have since moved to absurd.

When this project still had a name with a period in it, the doc task was broken on my local machine and then was fixed when I moved it to a new directory without a period.

I think that, if any change in this plugin is even needed (maybe it's an sbt bug) the line would be here: https://github.com/typelevel/sbt-typelevel/blob/main/settings/src/main/scala/org/typelevel/sbt/TypelevelSettingsPlugin.scala#L216

Maybe related, but probably not: https://github.com/sbt/sbt/issues/7192

armanbilge commented 1 year ago

Adding some additional info:

[error] missing argument for option -sourcepath
[info]   scaladoc -help  gives more information
[info] Skipping unused scalacOptions: -Werror, -Wvalue-discard, -Ykind-projector
[error] (coreJVM / Compile / doc) DottyDoc Compilation Failed
[error] Total time: 1 s, completed Jul 29, 2023, 5:36:16 PM

It's also possible that this is a dottydoc bug. Would be interesting to see if Scaladoc for Scala 2 has the same problem.

CJSmith-0141 commented 1 year ago

Ok I was able to reproduce this with help from @armanbilge and narrowed it down to a bug with dottydoc

gh repo clone typelevel/cats cats.scala && cd cats.scala
sbt '++ 3' doc

You'll be greeted with may may variations of this error

[info] Main Scala API documentation to /home/tazato/cats.scala/kernel/.jvm/target/scala-3.3.0/api...
[error] missing argument for option -sourcepath
[info]   scaladoc -help  gives more information
[info] Skipping unused scalacOptions: -Ykind-projector, -source

Being that this appears to be a bug with dotty doc I'll close this issue. Thank you for the help narrowing this down!