-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sbt
66 lines (46 loc) · 1.88 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import VersionHelper.{versionFmt, fallbackVersion}
// Lets me depend on Maven Central artifacts immediately without waiting
resolvers ++= Resolver.sonatypeOssRepos("public")
// Makes sure to increment the version for local development
ThisBuild / version := dynverGitDescribeOutput.value
.mkVersion(out => versionFmt(out, dynverSonatypeSnapshots.value), fallbackVersion(dynverCurrentDate.value))
ThisBuild / dynver := {
val d = new java.util.Date
sbtdynver.DynVer
.getGitDescribeOutput(d)
.mkVersion(out => versionFmt(out, dynverSonatypeSnapshots.value), fallbackVersion(d))
}
enablePlugins(ScalaJSBundlerPlugin)
scalaVersion := Versions.Scala_2_13
crossScalaVersions := Seq(Versions.Scala_3, Versions.Scala_2_13, Versions.Scala_2_12)
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % Versions.ScalaJsDom,
"org.scalatest" %%% "scalatest" % Versions.ScalaTest
)
scalacOptions ++= Seq(
"-deprecation",
"-feature",
"-language:higherKinds",
"-language:implicitConversions",
)
scalacOptions ++= sys.env.get("CI").map { _ =>
val localSourcesPath = (LocalRootProject / baseDirectory).value.toURI
val remoteSourcesPath = s"https://raw.githubusercontent.com/raquo/scala-dom-testutils/${git.gitHeadCommit.value.get}/"
val sourcesOptionName = if (scalaVersion.value.startsWith("2.")) "-P:scalajs:mapSourceURI" else "-scalajs-mapSourceURI"
s"${sourcesOptionName}:$localSourcesPath->$remoteSourcesPath"
}
(Test / scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.CommonJSModule)
})
(Test / requireJsDomEnv) := true
(webpack / version) := Versions.Webpack
(startWebpackDevServer / version) := Versions.WebpackDevServer
(installJsdom / version) := Versions.JsDom
useYarn := true
(Test / parallelExecution) := false
(Compile / fastOptJS / scalaJSLinkerConfig) ~= {
_.withSourceMap(false)
}
(Compile / fullOptJS / scalaJSLinkerConfig) ~= {
_.withSourceMap(false)
}