|
| 1 | +import org.openqa.selenium.chrome.ChromeOptions |
| 2 | +import org.openqa.selenium.remote.DesiredCapabilities |
| 3 | +import org.scalajs.jsenv.selenium.SeleniumJSEnv |
1 | 4 |
|
2 | 5 | name := "udash-jquery"
|
3 | 6 |
|
4 |
| -version := "1.1.1" |
5 |
| -organization := "io.udash" |
6 |
| -scalaVersion := "2.12.2" |
7 |
| -crossScalaVersions := Seq("2.11.11", "2.12.2") |
8 |
| -scalacOptions in ThisBuild ++= Seq( |
9 |
| - "-feature", |
10 |
| - "-deprecation", |
11 |
| - "-unchecked", |
12 |
| - "-language:implicitConversions", |
13 |
| - "-language:existentials", |
14 |
| - "-language:dynamics", |
15 |
| - "-Xfuture", |
16 |
| - "-Xfatal-warnings", |
17 |
| - CrossVersion.partialVersion(scalaVersion.value).collect { |
18 |
| - // WORKAROUND https://github.com/scala/scala/pull/5402 |
19 |
| - case (2, 12) => "-Xlint:-unused,_" |
20 |
| - }.getOrElse("-Xlint:_") |
21 |
| -) |
| 7 | +inThisBuild(Seq( |
| 8 | + version := "1.2.0", |
| 9 | + organization := "io.udash", |
| 10 | + scalaVersion := "2.12.6", |
| 11 | + crossScalaVersions := Seq("2.11.12", "2.12.6"), |
| 12 | + scalacOptions ++= Seq( |
| 13 | + "-feature", |
| 14 | + "-deprecation", |
| 15 | + "-unchecked", |
| 16 | + "-language:implicitConversions", |
| 17 | + "-language:existentials", |
| 18 | + "-language:dynamics", |
| 19 | + "-language:postfixOps", |
| 20 | + "-language:experimental.macros", |
| 21 | + "-Xfuture", |
| 22 | + "-Xfatal-warnings", |
| 23 | + "-Xlint:_", |
| 24 | + ), |
| 25 | + scalacOptions ++= { |
| 26 | + if (CrossVersion.partialVersion((root / scalaVersion).value).contains((2, 12))) Seq( |
| 27 | + "-Ywarn-unused:_,-explicits,-implicits", |
| 28 | + "-Ybackend-parallelism", "4", |
| 29 | + "-Ycache-plugin-class-loader:last-modified", |
| 30 | + "-Ycache-macro-class-loader:last-modified" |
| 31 | + ) else Seq.empty |
| 32 | + }, |
| 33 | +)) |
| 34 | + |
| 35 | +// Settings for JS tests run in browser |
| 36 | +val browserCapabilities: DesiredCapabilities = { |
| 37 | + // requires ChromeDriver: https://sites.google.com/a/chromium.org/chromedriver/ |
| 38 | + val capabilities = DesiredCapabilities.chrome() |
| 39 | + capabilities.setCapability(ChromeOptions.CAPABILITY, { |
| 40 | + val options = new ChromeOptions() |
| 41 | + options.addArguments("--headless", "--disable-gpu") |
| 42 | + options |
| 43 | + }) |
| 44 | + capabilities |
| 45 | +} |
22 | 46 |
|
23 |
| -jsEnv in Test := new org.scalajs.jsenv.selenium.SeleniumJSEnv(org.scalajs.jsenv.selenium.Firefox()) |
| 47 | +val commonJSSettings = Seq( |
| 48 | + Compile / emitSourceMaps := true, |
| 49 | + Test / parallelExecution := false, |
| 50 | + Test / scalaJSStage := FastOptStage, |
| 51 | + Test / jsEnv := new SeleniumJSEnv(browserCapabilities), |
| 52 | + scalacOptions += { |
| 53 | + val localDir = (ThisBuild / baseDirectory).value.toURI.toString |
| 54 | + val githubDir = "https://raw.githubusercontent.com/UdashFramework/scala-js-jquery" |
| 55 | + s"-P:scalajs:mapSourceURI:$localDir->$githubDir/v${version.value}/" |
| 56 | + }, |
| 57 | + scalacOptions += "-P:scalajs:sjsDefinedByDefault", |
| 58 | +) |
24 | 59 |
|
25 | 60 | libraryDependencies ++= Seq(
|
26 |
| - "org.scala-js" %%% "scalajs-dom" % "0.9.2", |
27 |
| - "org.scalatest" %%% "scalatest" % "3.0.3" % Test, |
28 |
| - "com.lihaoyi" %%% "scalatags" % "0.6.5" % Test |
| 61 | + "org.scala-js" %%% "scalajs-dom" % "0.9.5", |
| 62 | + "org.scalatest" %%% "scalatest" % "3.0.5" % Test, |
| 63 | + "com.lihaoyi" %%% "scalatags" % "0.6.7" % Test |
29 | 64 | )
|
30 | 65 |
|
31 | 66 | jsDependencies +=
|
32 |
| - "org.webjars" % "jquery" % "3.2.1" / "3.2.1/jquery.js" minified "3.2.1/jquery.min.js" |
33 |
| - |
34 |
| -requiresDOM in Test := true |
| 67 | + "org.webjars" % "jquery" % "3.3.1" / "3.3.1/jquery.js" minified "3.3.1/jquery.min.js" |
35 | 68 |
|
36 | 69 | lazy val root = project.in(file("."))
|
37 | 70 | .enablePlugins(ScalaJSPlugin)
|
| 71 | + .settings(commonJSSettings) |
0 commit comments