Skip to content

Commit 64fc19f

Browse files
authored
Merge pull request #72 from sparsetech/feat/deps
Build: Update dependencies
2 parents 19a1b0d + 9e491c6 commit 64fc19f

22 files changed

+71
-113
lines changed

.drone.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ steps:
66
commands:
77
- apk add --no-cache yarn
88
- yarn add jsdom object-sizeof
9+
# Patch Bloop version to support Scala.js 1.0
10+
- apk add --no-cache curl && curl -L https://github.com/scalacenter/bloop/releases/download/v1.4.0-RC1/install.py | python - -d /usr/bin/ -v 1.4.0-RC1-229-b7c15aa9 || true
911
- blp-server &
1012
- seed --build=build211.toml bloop
1113
- bloop compile pine-native
12-
- bloop test pine-jvm pine-js
14+
- bloop test pine-jvm
1315
- sleep 5 # Synchronise analysis.bin files, otherwise rm might fail
1416
- rm -rf .bloop build
1517
- seed --build=build212.toml bloop

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ install:
1515

1616
# See https://github.com/scala-js/scala-js/issues/2642
1717
script:
18-
sbt 'set parallelExecution in ThisBuild := false' pineJS2_11/test pineJVM2_11/test pineNative2_11/test pineJS2_12/test pineJVM2_12/test pineJS2_13/test pineJVM2_13/test
18+
sbt 'set parallelExecution in ThisBuild := false' pineJVM2_11/test pineNative2_11/test pineJS2_12/test pineJVM2_12/test pineJS2_13/test pineJVM2_13/test
1919

2020
# From http://www.scala-sbt.org/0.13/docs/Travis-CI-with-sbt.html
2121
# Use container-based infrastructure

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ Pine is a functional HTML5 and XML library for the Scala platform. It supports p
2323
* DSL for attaching/detaching events
2424

2525
## Compatibility
26-
| Back end | Scala versions |
27-
|:---------------|:-----------------|
28-
| JVM | 2.11, 2.12, 2.13 |
29-
| JavaScript (1) | 2.11, 2.12, 2.13 |
30-
| Native | 2.11 |
26+
| Platform | Platform version | Scala versions |
27+
|:-------------|:-----------------|:-----------------------------|
28+
| JVM | | 2.11 (T), 2.12 (T), 2.13 (L) |
29+
| Scala.js | 1.0 | 2.12 (T), 2.13 (L) |
30+
| Scala Native | 0.4.0-M2 | 2.11 (T) |
3131

32-
* (1) Adds support for browser DOM
32+
* (T): Typelevel Scala
33+
* (L): Lightbend Scala
3334

3435
## Examples
3536
```scala
@@ -52,7 +53,7 @@ Pine makes use of a language extension called *literal types*, see [SIP-23](http
5253

5354
### 2.13 onwards
5455
```scala
55-
scalaVersion := "2.13.0"
56+
scalaVersion := "2.<version>"
5657
libraryDependencies += scalaOrganization.value % "scala-reflect" % scalaVersion.value
5758
```
5859

@@ -79,8 +80,8 @@ addCompilerPlugin("org.scala-native" % "nscplugin" % nativeVersion cross CrossVe
7980

8081
### Dependencies
8182
```scala
82-
libraryDependencies += "tech.sparse" %% "pine" % "0.1.3" // JVM
83-
libraryDependencies += "tech.sparse" %%% "pine" % "0.1.3" // JavaScript, Native
83+
libraryDependencies += "tech.sparse" %% "pine" % "<version>" // JVM
84+
libraryDependencies += "tech.sparse" %%% "pine" % "<version>" // JavaScript, Native
8485
```
8586

8687
## Links

build.sbt

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ val V = new {
55
val paradise = "2.1.1"
66
val scala2_11 = "2.11.11-bin-typelevel-4"
77
val scala2_12 = "2.12.4-bin-typelevel-4"
8-
val scala2_13 = "2.13.1"
9-
val scalaTest = "3.0.8"
10-
val scalaTestNative = "3.2.0-SNAP10"
11-
val scalaCheck = "1.14.0"
12-
val scalaCheckNative = "1.14.1"
13-
val scalaJsDom = "0.9.7"
8+
val scala2_13 = "2.13.3"
9+
val scalaTest = "3.2.2"
10+
val scalaCheck = "1.14.3"
11+
val scalaJsDom = "1.1.0"
1412
}
1513

1614
ThisBuild / scalaVersion := V.scala2_13
@@ -25,6 +23,9 @@ val commonSettings = nocomma {
2523
libraryDependencies ++= Seq(
2624
scalaOrganization.value % "scala-reflect" % scalaVersion.value % "provided",
2725
scalaOrganization.value % "scala-compiler" % scalaVersion.value % "provided",
26+
27+
"org.scalatest" %%% "scalatest" % V.scalaTest % "test",
28+
"org.scalacheck" %%% "scalacheck" % V.scalaCheck % "test"
2829
)
2930

3031
scalacOptions ++= Seq(
@@ -44,7 +45,6 @@ val commonSettings = nocomma {
4445
"-Xlint:inaccessible", // Warn about inaccessible types in method signatures.
4546
"-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`.
4647
"-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id.
47-
"-Xlint:nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'.
4848
"-Xlint:nullary-unit", // Warn when nullary methods return Unit.
4949
"-Xlint:option-implicit", // Option.apply used implicit view.
5050
"-Xlint:package-object-classes", // Class or object defined in package object.
@@ -59,7 +59,7 @@ val commonSettings = nocomma {
5959

6060
val Pre13Settings = nocomma {
6161
scalaOrganization := "org.typelevel"
62-
62+
6363
scalacOptions ++= Seq(
6464
"-Xfuture", // Turn on future language features.
6565
"-Xlint:by-name-right-associative", // By-name parameter of right associative operator.
@@ -72,7 +72,7 @@ val Pre13Settings = nocomma {
7272
"-Ywarn-nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'.
7373
"-Ywarn-nullary-unit", // Warn when nullary methods return Unit.
7474
)
75-
75+
7676
addCompilerPlugin("org.scalamacros" %% "paradise" % V.paradise cross CrossVersion.patch)
7777
}
7878

@@ -98,18 +98,11 @@ val Scala13Settings = Post11Settings ++ nocomma {
9898
scalacOptions += "-Ymacro-annotations"
9999
}
100100

101-
val JvmSettings = nocomma {
102-
libraryDependencies ++= Seq(
103-
"org.scalatest" %% "scalatest" % V.scalaTest % "test",
104-
"org.scalacheck" %% "scalacheck" % V.scalaCheck % "test",
105-
)
106-
}
101+
val JvmSettings = Seq()
107102

108103
val JsSettings = nocomma {
109104
libraryDependencies ++= Seq(
110-
"org.scalatest" %%% "scalatest" % V.scalaTest % "test",
111-
"org.scalacheck" %%% "scalacheck" % V.scalaCheck % "test",
112-
"org.scala-js" %%% "scalajs-dom" % V.scalaJsDom,
105+
"org.scala-js" %%% "scalajs-dom" % V.scalaJsDom
113106
)
114107

115108
// We need to remove and re-add this if working under the typelevel compiler
@@ -123,11 +116,6 @@ val JsSettings = nocomma {
123116
}
124117

125118
val NativeSettings = nocomma {
126-
libraryDependencies ++= Seq(
127-
"org.scalatest" %%% "scalatest" % V.scalaTestNative % "test",
128-
"com.github.lolgab" %%% "scalacheck" % V.scalaCheckNative % "test"
129-
)
130-
131119
libraryDependencies ~= (_.filterNot(_.name == "nscplugin"))
132120
addCompilerPlugin("org.scala-native" % "nscplugin" % nativeVersion cross CrossVersion.patch)
133121

@@ -145,7 +133,6 @@ lazy val pine = (projectMatrix in file("."))
145133
.jvmPlatform( Seq(V.scala2_11), JvmSettings ++ Scala11Settings)
146134
.jsPlatform( Seq(V.scala2_13), JsSettings ++ Scala13Settings)
147135
.jsPlatform( Seq(V.scala2_12), JsSettings ++ Scala12Settings)
148-
.jsPlatform( Seq(V.scala2_11), JsSettings ++ Scala11Settings)
149136
.nativePlatform( Seq(V.scala2_11), NativeSettings ++ Pre13Settings)
150137

151138
// root settings. src/ is handled by sbt-projectmatrix

build211.toml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[project]
22
scalaVersion = "2.11.11-bin-typelevel-4"
3-
scalaJsVersion = "0.6.28"
4-
scalaNativeVersion = "0.3.7"
3+
scalaNativeVersion = "0.4.0-M2"
54
scalaOptions = [
65
"-deprecation", # Emit warning and location for usages of deprecated APIs.
76
"-encoding", "utf-8", # Specify character encoding used by source files.
@@ -31,7 +30,7 @@ scalaOptions = [
3130
"-Ywarn-numeric-widen", # Warn when numerics are widened.
3231

3332
### pre-13 options ###
34-
33+
3534
"-Xfuture", # Turn on future language features.
3635
"-Xlint:by-name-right-associative", # By-name parameter of right associative operator.
3736
"-Xlint:unsound-match", # Pattern match may not be typesafe.
@@ -52,45 +51,28 @@ testFrameworks = [
5251
[module.pine]
5352
root = "src/main/scala"
5453
sources = ["src/main/scala"]
55-
targets = ["js", "jvm", "native"]
54+
targets = ["jvm", "native"]
5655

5756
[module.pine.test]
5857
sources = ["src/test/scala"]
59-
targets = ["js", "jvm"]
58+
targets = ["jvm"]
6059
scalaDeps = [
61-
["org.scalatest" , "scalatest" , "3.0.8" ],
62-
["org.scalacheck", "scalacheck", "1.14.0"]
60+
["org.scalatest" , "scalatest" , "3.2.2" ],
61+
["org.scalacheck", "scalacheck", "1.14.3"]
6362
]
6463

6564
[module.pine.jvm]
6665
root = "src/main/scala-jvm"
6766
sources = ["src/main/scala-jvm"]
6867

69-
[module.pine.js]
70-
root = "src/main/scala-js"
71-
sources = ["src/main/scala-js"]
72-
scalaDeps = [
73-
["org.scala-js", "scalajs-dom", "0.9.7"]
74-
]
75-
76-
[module.pine.test.js]
77-
jsdom = true
78-
sources = ["src/test/scala-js"]
79-
8068
[module.pine-bench]
8169
moduleDeps = ["pine"]
8270
root = "src/bench"
8371
sources = ["src/bench/shared"]
84-
targets = ["js", "jvm"]
8572

8673
[module.pine-bench.jvm]
8774
root = "src/bench/jvm"
8875
sources = ["src/bench/jvm"]
8976
javaDeps = [
9077
["org.openjdk.jol", "jol-core", "0.13"]
9178
]
92-
93-
[module.pine-bench.js]
94-
root = "src/bench/js"
95-
sources = ["src/bench/js"]
96-
moduleKind = "commonjs"

build212.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
scalaVersion = "2.12.4-bin-typelevel-4"
3-
scalaJsVersion = "0.6.28"
3+
scalaJsVersion = "1.0.1"
44
scalaOptions = [
55
"-deprecation", # Emit warning and location for usages of deprecated APIs.
66
"-encoding", "utf-8", # Specify character encoding used by source files.
@@ -42,7 +42,7 @@ scalaOptions = [
4242
# "-Ywarn-value-discard" # Warn when non-Unit expression results are unused.
4343

4444
### pre-13 options ###
45-
45+
4646
"-Xfuture", # Turn on future language features.
4747
"-Xlint:by-name-right-associative", # By-name parameter of right associative operator.
4848
"-Xlint:unsound-match", # Pattern match may not be typesafe.
@@ -69,8 +69,8 @@ targets = ["js", "jvm"]
6969
sources = ["src/test/scala"]
7070
targets = ["js", "jvm"]
7171
scalaDeps = [
72-
["org.scalatest" , "scalatest" , "3.0.8" ],
73-
["org.scalacheck", "scalacheck", "1.14.0"]
72+
["org.scalatest" , "scalatest" , "3.1.1" ],
73+
["org.scalacheck", "scalacheck", "1.14.3"]
7474
]
7575

7676
[module.pine.jvm]
@@ -81,7 +81,7 @@ sources = ["src/main/scala-jvm"]
8181
root = "src/main/scala-js"
8282
sources = ["src/main/scala-js"]
8383
scalaDeps = [
84-
["org.scala-js", "scalajs-dom", "0.9.7"]
84+
["org.scala-js", "scalajs-dom", "1.1.0"]
8585
]
8686

8787
[module.pine.test.js]

build213.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
2-
scalaVersion = "2.13.0"
3-
scalaJsVersion = "0.6.28"
2+
scalaVersion = "2.13.2"
3+
scalaJsVersion = "1.0.1"
44
scalaOptions = [
55
"-deprecation", # Emit warning and location for usages of deprecated APIs.
66
"-encoding", "utf-8", # Specify character encoding used by source files.
@@ -18,7 +18,6 @@ scalaOptions = [
1818
"-Xlint:inaccessible", # Warn about inaccessible types in method signatures.
1919
"-Xlint:infer-any", # Warn when a type argument is inferred to be `Any`.
2020
"-Xlint:missing-interpolator", # A string literal appears to be missing an interpolator id.
21-
"-Xlint:nullary-override", # Warn when non-nullary `def f()' overrides nullary `def f'.
2221
"-Xlint:nullary-unit", # Warn when nullary methods return Unit.
2322
"-Xlint:option-implicit", # Option.apply used implicit view.
2423
"-Xlint:package-object-classes", # Class or object defined in package object.
@@ -55,8 +54,8 @@ targets = ["js", "jvm"]
5554
sources = ["src/test/scala"]
5655
targets = ["js", "jvm"]
5756
scalaDeps = [
58-
["org.scalatest" , "scalatest" , "3.0.8" ],
59-
["org.scalacheck", "scalacheck", "1.14.0"]
57+
["org.scalatest" , "scalatest" , "3.1.1" ],
58+
["org.scalacheck", "scalacheck", "1.14.3"]
6059
]
6160

6261
[module.pine.jvm]
@@ -67,7 +66,7 @@ sources = ["src/main/scala-jvm"]
6766
root = "src/main/scala-js"
6867
sources = ["src/main/scala-js"]
6968
scalaDeps = [
70-
["org.scala-js", "scalajs-dom", "0.9.7"]
69+
["org.scala-js", "scalajs-dom", "1.1.0"]
7170
]
7271

7372
[module.pine.test.js]

project/plugins.sbt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ logLevel := Level.Warn
44
// see http://eed3si9n.com/removing-commas-with-sbt-nocomma
55
addSbtPlugin("com.eed3si9n" % "sbt-nocomma" % "0.1.0")
66
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.3.0")
7-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28")
8-
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.7")
7+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.2.0")
8+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0-M2")
99

10+
libraryDependencies += "org.scala-js" %% "scalajs-env-jsdom-nodejs" % "1.1.0"

src/bench/js/pine/bench/PlatformBench.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import pine.dom._
77
import pine.bench.BenchUtil._
88

99
class PlatformBench extends BenchmarkSuite with TreeBench {
10-
val isNodeJs = js.isUndefined(org.scalajs.dom.window)
10+
val isNodeJs = js.typeOf(js.Dynamic.global.window) == "undefined"
1111

1212
if (isNodeJs) println("[warn] Ignoring all tests requiring DOM access")
1313
else {
@@ -17,7 +17,7 @@ class PlatformBench extends BenchmarkSuite with TreeBench {
1717
org.scalajs.dom.document.body.appendChild(rendered)
1818
DOM.render { implicit ctx => ref := "test" }
1919
org.scalajs.dom.document.body.removeChild(rendered)
20-
numberOfNodes(depth) -> ()
20+
numberOfNodes(depth) -> (())
2121
}
2222

2323
bench("Render as DOM node", depths, measureMemory = false) { depth =>

src/bench/js/pine/bench/PlatformUtil.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ object SizeOf extends js.Object {
1212

1313
object PlatformUtil {
1414
def cliArgs(): List[String] =
15-
if (js.isUndefined(js.Dynamic.global.process)) List()
15+
if (js.typeOf(js.Dynamic.global.process) == "undefined") List()
1616
else js.Dynamic.global.process.argv.asInstanceOf[js.Array[String]].toList.drop(2)
1717
def format(value: Double): String = value.toFixed(1)
1818
def measure(obj: Any): Long =

0 commit comments

Comments
 (0)