Skip to content

Commit 7d12397

Browse files
committed
fix sbt-dotty doc on sbt 1.5
1 parent 295e4d4 commit 7d12397

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

sbt-dotty/sbt-test/sbt-dotty/scaladoc/build.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ lazy val assertUsingScaladoc = taskKey[Unit]("")
55
assertUsingScaladoc := {
66
assert(useScaladoc.value)
77
}
8+
9+
TaskKey[Unit]("checkScaladocOptions") := {
10+
val options = (doc / scalacOptions).value
11+
assert(options.count(_ == "-project") == 1)
12+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
> assertUsingScaladoc
2+
> checkScaladocOptions
23
> doc
3-

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,9 @@ object DottyPlugin extends AutoPlugin {
464464
else Def.task { originalSources }
465465
}.value,
466466
scalacOptions ++= {
467-
if (isDotty.value) {
467+
val isSbt15 = VersionNumber(sbtVersion.value)
468+
.matchesSemVer(SemanticSelector(">=1.5.0-M1"))
469+
if (isDotty.value && !isSbt15) {
468470
val projectName =
469471
if (configuration.value == Compile)
470472
name.value

0 commit comments

Comments
 (0)