-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
49 lines (45 loc) · 1.53 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import org.scalajs.sbtplugin.ScalaJSPluginInternal
name := "scalajs testing and more"
lazy val root = project.in(file(".")).
aggregate(crossJS, crossJVM).
settings(
publish := {},
publishLocal := {}
)
lazy val cross = crossProject.in(file(".")).
settings(
name := "example",
version := "0.1-SNAPSHOT",
scalaVersion := "2.11.7",
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % "3.0.0-M15" % "test"
)
)
.jvmSettings(
// Add JVM-specific settings here
)
.jsSettings(
libraryDependencies ++= Seq(
Dependencies.scalajsdom.value,
Dependencies.tests.scalajsenvs),
scalaJSStage in Global := FastOptStage,
jsDependencies += RuntimeDOM % "test",
jsEnv in Test := new CustomPhantomJSEnv(
env = Map(
"var1" -> "kuku",
"var2" -> "shmuku"
),
classLoader = scalaJSPhantomJSClassLoader.value
)
)
.configs(TestSettings.ItTest) // 1
.settings(inConfig(Test)(TestSettings.testSettings):_*) // 2
.settings(inConfig(TestSettings.ItTest)(Defaults.testTasks):_*) // 3
.jsSettings(inConfig(TestSettings.ItTest)(ScalaJSPluginInternal.scalaJSTestSettings):_*) // 4
.settings(inConfig(TestSettings.ItTest)(TestSettings.itTestSettings):_*) // 5
.jsSettings(
unmanagedSourceDirectories in TestSettings.ItTest ++=
CrossType.Full.sharedSrcDir(baseDirectory.value, "test").toSeq :+
CrossType.Full.jsDir(baseDirectory.value).getParentFile / "src" / "test" / "scala") // 6
lazy val crossJVM = cross.jvm
lazy val crossJS = cross.js