Add condition preventing errors on 3.0.0. Add scripted test for running doc on Scala.js project

This commit is contained in:
Filip Zybała 2021-05-27 14:56:47 +02:00
parent fcab06bd3d
commit 236f419f88
5 changed files with 40 additions and 1 deletions

View File

@ -2107,7 +2107,11 @@ object Defaults extends BuildCommon {
val projectName = name.value
if (ScalaArtifacts.isScala3(sv)) {
val project = if (config == Compile) projectName else s"$projectName-$config"
compileOptions ++ Seq("-project", project)
if (scalaVersion.value.startsWith("3.0.0")) {
Seq("-project", project)
} else {
compileOptions ++ Seq("-project", project)
}
} else compileOptions
},
(TaskZero / key) := {

View File

@ -0,0 +1,12 @@
val scala3Version = "3.0.1-RC1-bin-20210525-8f3fdf5-NIGHTLY"
enablePlugins(ScalaJSPlugin)
lazy val root = project
.in(file("."))
.settings(
name := "scala3-simple",
version := "0.1.0",
scalaVersion := scala3Version,
)

View File

@ -0,0 +1 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1")

View File

@ -0,0 +1,21 @@
package test
import scala.scalajs.js
final case class RouteLocation(loc: String, state: js.UndefOr[js.Any])
object RouteLocation:
def apply(loc: String): RouteLocation = RouteLocation(loc, js.undefined)
/**
* ```scala sc:compile
* import scala.scalajs.js
* final case class RouteLocation(loc: String, state: js.UndefOr[js.Any])
*
*
* object RouteLocation:
* def apply(loc: String): RouteLocation = RouteLocation(loc, js.undefined)
* ```
*/
case class Test(s: String)

View File

@ -0,0 +1 @@
> doc