Skip to content

Default to Scala3doc #10762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ final case class SbtCommunityProject(
++ s"++$compilerVersion!; "

override val testCommand = s"$baseCommand$sbtTestCommand"
override val publishCommand = if sbtPublishCommand eq null then null else s"$baseCommand$sbtPublishCommand"
override val publishCommand = if sbtPublishCommand eq null then null else
val disableDocCommand =
if sbtDocCommand eq null then "" else "set every useScala3doc := false;"
s"$baseCommand$disableDocCommand$sbtPublishCommand"
override val docCommand =
if sbtDocCommand eq null then null else
val cmd = if sbtDocCommand.startsWith(";") then sbtDocCommand else s";$sbtDocCommand"
Expand Down
6 changes: 5 additions & 1 deletion sbt-dotty/sbt-test/sbt-dotty/scala3doc/build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
scalaVersion := sys.props("plugin.scalaVersion")

useScala3doc := true
lazy val assertUsingScala3doc = taskKey[Unit]("")

assertUsingScala3doc := {
assert(useScala3doc.value)
}
1 change: 1 addition & 0 deletions sbt-dotty/sbt-test/sbt-dotty/scala3doc/test
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
> assertUsingScala3doc
> doc

5 changes: 4 additions & 1 deletion sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,10 @@ object DottyPlugin extends AutoPlugin {

// Configuration for the doctool
resolvers ++= (if(!useScala3doc.value) Nil else Seq(Resolver.jcenterRepo)),
useScala3doc := false,
useScala3doc := {
val v = scalaVersion.value
v.startsWith("3.0.0") && !v.startsWith("3.0.0-M1") && !v.startsWith("3.0.0-M2")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More future-proof:

Suggested change
v.startsWith("3.0.0") && !v.startsWith("3.0.0-M1") && !v.startsWith("3.0.0-M2")
v.startsWith("3") && !v.startsWith("3.0.0-M1") && !v.startsWith("3.0.0-M2")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setting is going to disappear with 3.0.0, there's no need for this.

},
// We need to add doctool classes to the classpath so they can be called
scalaInstance in doc := Def.taskDyn {
if (isDotty.value)
Expand Down