11import org .openqa .selenium .chrome .ChromeOptions
2- import org .openqa .selenium .remote .DesiredCapabilities
3- import org .scalajs .jsenv .selenium .SeleniumJSEnv
42
53name := " udash-jquery"
64
75inThisBuild(Seq (
8- version := " 2 .0.1 " ,
6+ version := " 3 .0.0-SNAPSHOT " ,
97 organization := " io.udash" ,
10- scalaVersion := " 2.12.6 " ,
11- crossScalaVersions := Seq (" 2.11.12" , " 2.12.6 " ),
8+ scalaVersion := " 2.12.7 " ,
9+ crossScalaVersions := Seq (" 2.11.12" , " 2.12.7 " ),
1210 scalacOptions ++= Seq (
1311 " -feature" ,
1412 " -deprecation" ,
@@ -20,35 +18,25 @@ inThisBuild(Seq(
2018 " -language:experimental.macros" ,
2119 " -Xfuture" ,
2220 " -Xfatal-warnings" ,
23- " -Xlint:_" ,
21+ " -Xlint:_"
2422 ),
2523 scalacOptions ++= {
26- if (CrossVersion .partialVersion((root / scalaVersion).value).contains(( 2 , 12 )) ) Seq (
24+ if (scalaBinaryVersion.value == " 2.12 " ) Seq (
2725 " -Ywarn-unused:_,-explicits,-implicits" ,
2826 " -Ybackend-parallelism" , " 4" ,
2927 " -Ycache-plugin-class-loader:last-modified" ,
3028 " -Ycache-macro-class-loader:last-modified"
3129 ) else Seq .empty
32- },
30+ }
3331))
3432
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- }
46-
4733val commonJSSettings = Seq (
4834 Compile / emitSourceMaps := true ,
4935 Test / parallelExecution := false ,
5036 Test / scalaJSStage := FastOptStage ,
51- Test / jsEnv := new SeleniumJSEnv (browserCapabilities),
37+ // ScalaJSBundlerPlugin does not work with scalajs-env-selenium:
38+ // https://github.com/scalacenter/scalajs-bundler/issues/89
39+ // Test / jsEnv := new SeleniumJSEnv(browserCapabilities),
5240 scalacOptions += {
5341 val localDir = (ThisBuild / baseDirectory).value.toURI.toString
5442 val githubDir = " https://raw.githubusercontent.com/UdashFramework/scala-js-jquery"
@@ -57,15 +45,17 @@ val commonJSSettings = Seq(
5745 scalacOptions += " -P:scalajs:sjsDefinedByDefault" ,
5846)
5947
60- libraryDependencies ++= Seq (
61- " org.scala-js" %%% " scalajs-dom" % " 0.9.6" ,
62- " org.scalatest" %%% " scalatest" % " 3.0.5" % Test ,
63- " com.lihaoyi" %%% " scalatags" % " 0.6.7" % Test
64- )
48+ lazy val root = project.in(file(" ." ))
49+ .enablePlugins(ScalaJSBundlerPlugin )
50+ .settings(
51+ commonJSSettings,
6552
66- jsDependencies +=
67- " org.webjars" % " jquery" % " 3.3.1" % Test / " 3.3.1/jquery.js" minified " 3.3.1/jquery.min.js"
53+ libraryDependencies ++= Seq (
54+ " org.scala-js" %%% " scalajs-dom" % " 0.9.6" ,
55+ " org.scalatest" %%% " scalatest" % " 3.0.5" % Test ,
56+ " com.lihaoyi" %%% " scalatags" % " 0.6.7" % Test
57+ ),
6858
69- lazy val root = project.in(file( " . " ))
70- .enablePlugins( ScalaJSPlugin )
71- .settings(commonJSSettings )
59+ Compile / npmDependencies += " jquery " -> " 3.3.1 " ,
60+ Test / requiresDOM := true
61+ )
0 commit comments