Skip to content

Commit fe2f43b

Browse files
authored
Merge pull request #26 from UdashFramework/use-bundler
Bundler only build for SJS 1.0 with autopublish
2 parents 1d7b4f9 + 4acb8d5 commit fe2f43b

File tree

16 files changed

+110
-111
lines changed

16 files changed

+110
-111
lines changed

.travis.yml

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,36 @@
1-
language: scala
21
dist: trusty
3-
2+
language: scala
43
jdk: openjdk11
5-
64
scala:
75
- 2.13.1
86

9-
before_script:
10-
- "export DISPLAY=:99.0"
11-
- "sh -e /etc/init.d/xvfb start"
12-
- sleep 3 # give xvfb some time to start
13-
# Instal google-chrome
14-
- export CHROME_BIN=/usr/bin/google-chrome
15-
- sudo apt-get update
16-
- sudo apt-get install -y libappindicator1 fonts-liberation
17-
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
18-
- sudo dpkg -i google-chrome*.deb
19-
# Install Selenium chromedriver
20-
- wget http://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip
21-
- unzip chromedriver_linux64.zip -d selenium-bin
22-
- export PATH=$PWD/selenium-bin:$PATH
7+
jobs:
8+
include:
9+
- stage: test
10+
script:
11+
- sbt +test +publishLocal
12+
- cd example && sbt compileStatics
13+
- stage: release
14+
if: tag =~ ^v
15+
script:
16+
- openssl aes-256-cbc -K $encrypted_f00a6d0a0202_key -iv $encrypted_f00a6d0a0202_iv
17+
-in travis/travis.gpg.enc -out travis/travis.gpg -d
18+
- gpg --import travis/travis.gpg
19+
- test $TRAVIS_PULL_REQUEST = "false" && sbt +publishSigned sonatypeBundleRelease
20+
21+
before_cache:
22+
- rm -fv $HOME/.ivy2/.sbt.ivy.lock
23+
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
24+
- find $HOME/.sbt -name "*.lock" -print -delete
25+
26+
cache:
27+
directories:
28+
- "$HOME/.ivy2/cache"
29+
- "$HOME/.m2"
30+
- "$HOME/.cache"
31+
- "$HOME/.sbt"
2332

24-
script:
25-
- sbt +test +publishLocal
26-
- cd example && sbt compile jquery-global-demo/fullOptJS jquery-bundler-demo/compileStatics
33+
env:
34+
global:
35+
- secure: rG9cHG3au9EUYQSJKHAsMxws3IW/tSxG1Y/xbuW2Ri1JVr6L6c9ig8gYj4Hju5KkVvxXejb1/8bYCoZEP1vZpNeSkNordHECp0l+i9mI5ZFo5RN3vMCq4/0xWEQTdZ7c3BjN+pn4veDJ+W8cHFXgivC9tsX7FEbksz4bFVIm1knvz5r7HN4ntgQUeLwY/J9EpKSr/TYZsnEcf8aH9q6tvTLqcfYAR6ggs68Kc2qJ5sII0rj3vP2NANjTLuvdkPSe3i/9KCDRDr9KIoVsam4LfFDG8YXSNWBP3OQU86DF19V0brt6WGGX6G5V2dyjlHyyUy0GBFJOlPmfkEL8ylOprGy1OPw40ZPRbtzpbztFlVmgJoO3UcKIWlyB8umz0M9A+E3Of3P9mTnskAe366VPSq8R/G3kxc7ictZDQH7hgf2nKqlFQNXCJkBqynWRlC0HQ31izrACqNmmYdwQspUnAFVOEFSmfXu8sPVyOSQhHT4IG+xgG4KCKdC8Cv4buOFDzj4z0DRnfJwR71KvxA9KGhUtMZXXqfdZANThHMV1bsi3S3UPQKqRg62aja4+I7lzbwrPRbkDPsl0eTdULF39jIMnbfjC2TqeCgfG+tpel0DBMBOuuESvTVFVX38HSgK1QNhSAAu1nrVIFtZQbKDZLOm7hCgfOJO6v65R3PgIFFI=
36+
- secure: wjX1uXAYdNxpUr1nz9cQ96cgJI3wUqJ7hIQlHwtg1gLJJtgdf6STSTbAm1IKMb0Ouytc2muC1H8jhBbv94tyZh2/NI7IDk7OY2wcLobH2Jh/wnDEAAcATIhqR/oFtSdqr0umr1HDevUPIBU/ZFViCPribnCQ/Rxn8jttguGd3Ho1k1dxzJ9pEiET66nU8CnW0j8g1Nkg540xFPff0Q+1C7+3akU03KwLnh8C0KR1oGhT354IhocLtFKWPuD9GTXAiA6qcOZ0cmUlv8jwHhWyJ6dmVkOlv873nGPrFaWEDPepNkGaAz2TYjkeFS0YS8q1zbd7YM0opnQd8TJCnFddyzc09+1d5RMAJVWdKOKVjrbDwvKaNWfEHW6GXJ83xm8cbo3dCREfL7UTKjejkQTRgmj2BdrZVRB9xs+XKZpZi0ECVbIrwik9tyYoiuSHe96yNN3Ma56Q4x094ZTvsccjy7pET4FCpNwrFu0aD+HFPerWB/xlr9ILz7sWy99r4eafS+O2eidoQnPIHAHZ+z/k9ExQedKUzTxO/skgrf1FvswrY7cpfnNApOhCSKm8C5NfMB5BC7M7OsYqDIhIwfs/Q3J9gw18F4fa9czpnduVzkpQUGdZ2vtS+oxDGICB7uaxkRq7HudHHElhz4w9qEOIMpTJjICPa38Hr/fKGxpuhKE=

build.sbt

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
name := "udash-jquery"
44

55
inThisBuild(Seq(
6-
version := "3.0.2",
6+
version := sys.env.get("TRAVIS_TAG").filter(_.startsWith("v")).map(_.drop(1)).getOrElse("3.0.0-SNAPSHOT"),
77
organization := "io.udash",
8+
cancelable := true,
89
))
910

1011
val commonSettings = Seq(
1112
scalaVersion := "2.13.1",
12-
crossScalaVersions := Seq("2.12.10", "2.13.1"),
13+
crossScalaVersions := Seq("2.12.11", "2.13.1"),
1314
scalacOptions ++= Seq(
1415
"-feature",
1516
"-deprecation",
@@ -26,21 +27,51 @@ val commonSettings = Seq(
2627
"-Ycache-plugin-class-loader:last-modified",
2728
"-Ycache-macro-class-loader:last-modified",
2829
),
30+
autoAPIMappings := true,
31+
publishMavenStyle := true,
32+
publishArtifact in Test := false,
33+
pomIncludeRepository := { _ => false },
34+
35+
publishTo := sonatypePublishToBundle.value,
36+
37+
credentials in Global += Credentials(
38+
"Sonatype Nexus Repository Manager",
39+
"oss.sonatype.org",
40+
sys.env.getOrElse("SONATYPE_USERNAME", ""),
41+
sys.env.getOrElse("SONATYPE_PASSWORD", "")
42+
),
43+
44+
pomExtra := {
45+
<url>https://github.com/UdashFramework/scala-js-jquery</url>
46+
<licenses>
47+
<license>
48+
<name>Apache v.2 License</name>
49+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
50+
<distribution>repo</distribution>
51+
</license>
52+
</licenses>
53+
<scm>
54+
<url>git@github.com:UdashFramework/scala-js-jquery.git</url>
55+
<connection>scm:git@github.com:UdashFramework/scala-js-jquery.git</connection>
56+
</scm>
57+
<developers>
58+
<developer>
59+
<id>avsystem</id>
60+
<name>AVSystem</name>
61+
<url>http://www.avsystem.com/</url>
62+
</developer>
63+
</developers>
64+
}
2965
)
3066

3167
val commonJSSettings = Seq(
32-
Compile / emitSourceMaps := true,
3368
Test / parallelExecution := false,
3469
Test / scalaJSStage := FastOptStage,
35-
// ScalaJSBundlerPlugin does not work with scalajs-env-selenium:
36-
// https://github.com/scalacenter/scalajs-bundler/issues/89
37-
// Test / jsEnv := new SeleniumJSEnv(browserCapabilities),
3870
scalacOptions += {
3971
val localDir = (ThisBuild / baseDirectory).value.toURI.toString
4072
val githubDir = "https://raw.githubusercontent.com/UdashFramework/scala-js-jquery"
4173
s"-P:scalajs:mapSourceURI:$localDir->$githubDir/v${version.value}/"
4274
},
43-
scalacOptions += "-P:scalajs:sjsDefinedByDefault",
4475
)
4576

4677
lazy val root = project.in(file("."))
@@ -50,9 +81,9 @@ lazy val root = project.in(file("."))
5081
commonJSSettings,
5182

5283
libraryDependencies ++= Seq(
53-
"org.scala-js" %%% "scalajs-dom" % "0.9.7",
54-
"org.scalatest" %%% "scalatest" % "3.0.8" % Test,
55-
"com.lihaoyi" %%% "scalatags" % "0.7.0" % Test
84+
"org.scala-js" %%% "scalajs-dom" % "0.9.8",
85+
"org.scalatest" %%% "scalatest" % "3.1.1" % Test,
86+
"com.lihaoyi" %%% "scalatags" % "0.8.6" % Test
5687
),
5788

5889
Compile / npmDependencies += "jquery" -> "3.3.1",

example/build.sbt

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name := "jquery-demo"
22

33
inThisBuild(Seq(
4-
version := "3.0.1",
4+
version := "3.0.2",
55
organization := "io.udash",
66
))
77

88
val commonSettings = Seq(
99
scalaVersion := "2.12.10",
10-
crossScalaVersions := Seq("2.12.10"), //todo 2.13
10+
crossScalaVersions := Seq("2.12.10"), //todo 2.13 & SJS 1.0 with Udash 0.9
1111
scalacOptions ++= Seq(
1212
"-feature",
1313
"-deprecation",
@@ -33,46 +33,10 @@ val root = project.in(file("."))
3333
.enablePlugins(ScalaJSPlugin)
3434
.settings(commonSettings)
3535

36-
val `jquery-global-demo` = project.in(file("global-demo"))
37-
.enablePlugins(ScalaJSPlugin)
38-
.settings(
39-
commonSettings,
40-
41-
jsDependencies ++= Dependencies.jsDeps.value,
42-
43-
sourceDirsSettings(_.getParentFile),
44-
45-
/* move these files out of target/. */
46-
Compile / fullOptJS / crossTarget := generatedGlobalDir,
47-
Compile / fastOptJS / crossTarget := generatedGlobalDir,
48-
Compile / packageJSDependencies / crossTarget := generatedGlobalDir,
49-
Compile / packageMinifiedJSDependencies / crossTarget := generatedGlobalDir,
50-
51-
Compile / fastOptJS := (Compile / fastOptJS).dependsOn(copyAssets).value,
52-
Compile / fullOptJS := (Compile / fullOptJS).dependsOn(copyAssets).value,
53-
54-
scalaJSUseMainModuleInitializer := true,
55-
56-
copyAssets := {
57-
IO.copyFile(
58-
sourceDirectory.value / "main/assets/index.html",
59-
generatedGlobalDir / "index.html"
60-
)
61-
},
62-
63-
Compile / fastOptJS / artifactPath :=
64-
(Compile / fastOptJS / crossTarget).value / "scripts" / "frontend-impl.js",
65-
Compile / fullOptJS / artifactPath :=
66-
(Compile / fullOptJS / crossTarget).value / "scripts" / "frontend-impl.js",
67-
Compile / packageJSDependencies / artifactPath :=
68-
(Compile / packageJSDependencies / crossTarget).value / "scripts" / "frontend-deps.js",
69-
Compile / packageMinifiedJSDependencies / artifactPath :=
70-
(Compile / packageMinifiedJSDependencies / crossTarget).value / "scripts" / "frontend-deps.js"
71-
)
72-
73-
val generatedBundlerDir = file("generated/bundler")
36+
val generatedBundlerDir = file("generated")
7437
val compileStatics = taskKey[Unit]("Compiles all static files.")
75-
val `jquery-bundler-demo` = project.in(file("bundler-demo"))
38+
39+
val example = project.in(file("."))
7640
.enablePlugins(ScalaJSBundlerPlugin)
7741
.settings(
7842
commonSettings,

example/global-demo/src/main/assets/index.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

example/project/Dependencies.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
21
import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._
32
import sbt._
43

54
object Dependencies {
6-
val udashCoreVersion = "0.8.1"
5+
val udashCoreVersion = "0.8.3"
76
val udashJQueryVersion = "3.0.2"
87

98
val deps = Def.setting(Seq[ModuleID](
109
"io.udash" %%% "udash-core" % udashCoreVersion,
1110
"io.udash" %%% "udash-jquery" % udashJQueryVersion
1211
))
13-
14-
val jsDeps = Def.setting(Seq[org.scalajs.sbtplugin.JSModuleID](
15-
"org.webjars" % "jquery" % "3.3.1" / "3.3.1/jquery.js" minified "3.3.1/jquery.min.js"
16-
))
1712
}

example/project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# suppress inspection "UnusedProperty"
2-
sbt.version=1.3.2
2+
sbt.version=1.3.8

example/project/plugins.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
logLevel := Level.Warn
22

3-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.29")
4-
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.15.0-0.6")
3+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32")
4+
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler-sjs06" % "0.17.0")

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# suppress inspection "UnusedProperty"
2-
sbt.version=1.3.2
2+
sbt.version=1.3.8

project/plugins.sbt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
logLevel := Level.Warn
22

3-
libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "0.3.0"
3+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.1")
4+
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.17.0")
45

5-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.29")
6-
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.15.0-0.6")
6+
// Deployment configuration
7+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
8+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1")

src/test/scala/io/udash/wrappers/jquery_test/DomManipulationTest.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package io.udash.wrappers.jquery_test
22

3-
import org.scalatest.{Matchers, WordSpec}
3+
import org.scalatest.matchers.should.Matchers
4+
import org.scalatest.wordspec.AnyWordSpec
5+
6+
class DomManipulationTest extends AnyWordSpec with Matchers {
47

5-
class DomManipulationTest extends WordSpec with Matchers {
68
import io.udash.wrappers.jquery._
79
import scalatags.JsDom.all._
810

src/test/scala/io/udash/wrappers/jquery_test/EventsHandlingTest.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
package io.udash.wrappers.jquery_test
2+
13
import org.scalajs.dom.Element
24
import org.scalajs.dom.html.Input
3-
import org.scalatest.{Matchers, WordSpec}
5+
import org.scalatest.matchers.should.Matchers
6+
import org.scalatest.wordspec.AnyWordSpec
47

5-
class EventsHandlingTest extends WordSpec with Matchers {
6-
import io.udash.wrappers.jquery._
8+
class EventsHandlingTest extends AnyWordSpec with Matchers {
79

10+
import io.udash.wrappers.jquery._
811
import scalatags.JsDom.all._
912

1013
class C(i: Int)

src/test/scala/io/udash/wrappers/jquery_test/MiscellaneousTest.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package io.udash.wrappers.jquery_test
22

3-
import org.scalatest.{Matchers, WordSpec}
3+
import org.scalatest.matchers.should.Matchers
4+
import org.scalatest.wordspec.AnyWordSpec
45

5-
class MiscellaneousTest extends WordSpec with Matchers {
6-
import io.udash.wrappers.jquery._
6+
class MiscellaneousTest extends AnyWordSpec with Matchers {
77

8+
import io.udash.wrappers.jquery._
89
import scalatags.JsDom.all._
910

1011
class C(i: Int)
@@ -45,7 +46,8 @@ class MiscellaneousTest extends WordSpec with Matchers {
4546
}
4647

4748
"serialize objects to URL query string" in {
48-
import scala.scalajs.js, js.JSConverters._
49+
import scala.scalajs.js
50+
import js.JSConverters._
4951
jQ.param(js.Dynamic.literal("a" -> Seq(1, 2, 3).toJSArray, "b" -> "c")) should be("a%5B%5D=1&a%5B%5D=2&a%5B%5D=3&b=c")
5052
}
5153
}

src/test/scala/io/udash/wrappers/jquery_test/SelectorsTest.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package io.udash.wrappers.jquery_test
22

3-
import org.scalatest.{Matchers, WordSpec}
3+
import org.scalatest.matchers.should.Matchers
4+
import org.scalatest.wordspec.AnyWordSpec
5+
6+
class SelectorsTest extends AnyWordSpec with Matchers {
47

5-
class SelectorsTest extends WordSpec with Matchers {
68
import io.udash.wrappers.jquery._
79
import scalatags.JsDom.all._
810

src/test/scala/io/udash/wrappers/jquery_test/TraversingTest.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package io.udash.wrappers.jquery_test
22

3-
import org.scalatest.{Matchers, WordSpec}
3+
import org.scalatest.matchers.should.Matchers
4+
import org.scalatest.wordspec.AnyWordSpec
45

5-
class TraversingTest extends WordSpec with Matchers {
6-
import io.udash.wrappers.jquery._
6+
class TraversingTest extends AnyWordSpec with Matchers {
77

8+
import io.udash.wrappers.jquery._
89
import scalatags.JsDom.all._
910

1011
"jQuery" should {

travis/travis.gpg.enc

3.63 KB
Binary file not shown.

0 commit comments

Comments
 (0)