Skip to content

Commit 3c18f6b

Browse files
authored
Merge pull request #10762 from dotty-staging/default-to-scala3doc
Default to Scala3doc
2 parents d85cc74 + 0fd03ff commit 3c18f6b

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ final case class SbtCommunityProject(
155155
++ s"++$compilerVersion!; "
156156

157157
override val testCommand = s"$baseCommand$sbtTestCommand"
158-
override val publishCommand = if sbtPublishCommand eq null then null else s"$baseCommand$sbtPublishCommand"
158+
override val publishCommand = if sbtPublishCommand eq null then null else
159+
val disableDocCommand =
160+
if sbtDocCommand eq null then "" else "set every useScala3doc := false;"
161+
s"$baseCommand$disableDocCommand$sbtPublishCommand"
159162
override val docCommand =
160163
if sbtDocCommand eq null then null else
161164
val cmd = if sbtDocCommand.startsWith(";") then sbtDocCommand else s";$sbtDocCommand"
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
scalaVersion := sys.props("plugin.scalaVersion")
22

3-
useScala3doc := true
3+
lazy val assertUsingScala3doc = taskKey[Unit]("")
4+
5+
assertUsingScala3doc := {
6+
assert(useScala3doc.value)
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
> assertUsingScala3doc
12
> doc
23

sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,10 @@ object DottyPlugin extends AutoPlugin {
367367

368368
// Configuration for the doctool
369369
resolvers ++= (if(!useScala3doc.value) Nil else Seq(Resolver.jcenterRepo)),
370-
useScala3doc := false,
370+
useScala3doc := {
371+
val v = scalaVersion.value
372+
v.startsWith("3.0.0") && !v.startsWith("3.0.0-M1") && !v.startsWith("3.0.0-M2")
373+
},
371374
// We need to add doctool classes to the classpath so they can be called
372375
scalaInstance in doc := Def.taskDyn {
373376
if (isDotty.value)

0 commit comments

Comments
 (0)