diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2be1deda4826..e98a7808656f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -282,9 +282,12 @@ jobs: - name: Add SBT proxy repositories run: cp -vf .github/workflows/repositories /root/.sbt/ ; true - - name: Test + - name: Test sbt 1.4.x run: ./project/scripts/sbt "sbt-dotty/scripted; sbt-community-build/scripted" + - name: Test sbt 1.5.x + run: ./project/scripts/sbt "set \`sbt-dotty\`/scriptedSbt := \"1.5.0-RC1\"; sbt-dotty/scripted sbt-dotty/*" + test_java8: runs-on: [self-hosted, Linux] container: diff --git a/sbt-dotty/sbt-test/sbt-dotty/scaladoc/build.sbt b/sbt-dotty/sbt-test/sbt-dotty/scaladoc/build.sbt index 628e6ef687dc..87e6de42040f 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/scaladoc/build.sbt +++ b/sbt-dotty/sbt-test/sbt-dotty/scaladoc/build.sbt @@ -1,7 +1,15 @@ scalaVersion := sys.props("plugin.scalaVersion") -lazy val assertUsingScaladoc = taskKey[Unit]("") - -assertUsingScaladoc := { +TaskKey[Unit]("assertUsingScaladoc") := { assert(useScaladoc.value) } + +TaskKey[Unit]("checkScaladocOptions") := { + val options = (Compile / doc / scalacOptions).value + assert(options.count(_ == "-project") == 1) +} + +TaskKey[Unit]("checkHtmlFiles") := { + val helloHtml = (Compile / doc / target).value / "api" / "hello.html" + assert(helloHtml.exists) +} diff --git a/sbt-dotty/sbt-test/sbt-dotty/scaladoc/test b/sbt-dotty/sbt-test/sbt-dotty/scaladoc/test index 62f36e165df0..58bf06a4c940 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/scaladoc/test +++ b/sbt-dotty/sbt-test/sbt-dotty/scaladoc/test @@ -1,3 +1,4 @@ > assertUsingScaladoc +> checkScaladocOptions > doc - +> checkHtmlFiles diff --git a/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala b/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala index d92f54937094..82e3727ac952 100644 --- a/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala +++ b/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala @@ -464,7 +464,10 @@ object DottyPlugin extends AutoPlugin { else Def.task { originalSources } }.value, scalacOptions ++= { - if (isDotty.value) { + // From sbt 1.5 scaladoc is natively supported, and so the scalacOptions are already set. + val isSbt15 = VersionNumber(sbtVersion.value) + .matchesSemVer(SemanticSelector(">=1.5.0-M1")) + if (isDotty.value && !isSbt15) { val projectName = if (configuration.value == Compile) name.value