Skip to content

Commit

Permalink
Merge pull request #96 from sphereio/scala_2.13
Browse files Browse the repository at this point in the history
cross-compile on scala 2.11, 2.12 and 2.13
  • Loading branch information
yanns authored Mar 20, 2019
2 parents af973db + 3543550 commit 578eded
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
scala:
- 2.11.12
- 2.12.8
- 2.13.0-M5

jdk:
- oraclejdk8
Expand Down
8 changes: 8 additions & 0 deletions benchmarks/src/main/scala/json/FromJsonBenchmark.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@ class FromJsonBenchmark {
/* on local mac
jmh:run
*** scala 2.12 ***
Benchmark Mode Cnt Score Error Units
FromJsonBenchmark.listReader thrpt 10 66,286 ± 1,025 ops/s
FromJsonBenchmark.parseFromStringToCaseClass thrpt 10 12,974 ± 0,333 ops/s
FromJsonBenchmark.seqReader thrpt 10 66,626 ± 1,235 ops/s
FromJsonBenchmark.vectorReader thrpt 10 67,702 ± 2,501 ops/s
*** scala 2.13 ***
Benchmark Mode Cnt Score Error Units
FromJsonBenchmark.listReader thrpt 10 58,223 ± 1,198 ops/s
FromJsonBenchmark.parseFromStringToCaseClass thrpt 10 12,929 ± 0,094 ops/s
FromJsonBenchmark.seqReader thrpt 10 59,705 ± 1,311 ops/s
FromJsonBenchmark.vectorReader thrpt 10 62,816 ± 0,750 ops/s
*/

@Benchmark
Expand Down
5 changes: 5 additions & 0 deletions benchmarks/src/main/scala/json/ParseJsonBenchmark.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ class ParseJsonBenchmark {
/* on local mac
jmh:run
*** scala 2.12 ***
Benchmark Mode Cnt Score Error Units
ParseJsonBenchmark.parseFromStringToJValue thrpt 10 85,322 ± 1,073 ops/s
*** scala 2.13 ***
Benchmark Mode Cnt Score Error Units
ParseJsonBenchmark.parseFromStringToJValue thrpt 10 78,121 ± 0,408 ops/s
*/

@Benchmark
Expand Down
8 changes: 8 additions & 0 deletions benchmarks/src/main/scala/json/ToJsonBenchmark.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ class ToJsonBenchmark {
/* on local mac
jmh:run
*** scala 2.12 ***
Benchmark Mode Cnt Score Error Units
ToJsonBenchmark.listWriter thrpt 10 68,770 ± 1,157 ops/s
ToJsonBenchmark.seqWriter thrpt 10 65,792 ± 1,191 ops/s
ToJsonBenchmark.serializeCaseClassToString thrpt 10 39,142 ± 0,574 ops/s
ToJsonBenchmark.vectorWriter thrpt 10 64,359 ± 2,162 ops/s
*** scala 2.13 ***
Benchmark Mode Cnt Score Error Units
ToJsonBenchmark.listWriter thrpt 10 71,097 ± 1,392 ops/s
ToJsonBenchmark.seqWriter thrpt 10 56,812 ± 1,715 ops/s
ToJsonBenchmark.serializeCaseClassToString thrpt 10 53,280 ± 0,993 ops/s
ToJsonBenchmark.vectorWriter thrpt 10 54,754 ± 1,563 ops/s
*/

@Benchmark
Expand Down
7 changes: 3 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ lazy val publishSettings = Seq(

lazy val standardSettings = Defaults.coreDefaultSettings ++ publishSettings ++ Seq(
organization := "io.sphere",
scalaVersion := "2.12.8",
crossScalaVersions := Seq("2.11.12", "2.12.8"),
scalaVersion := "2.13.0-M5",
crossScalaVersions := Seq("2.11.12", "2.12.8", scalaVersion.value),
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html")),
logBuffered := false,
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"-feature",
"-Ypartial-unification" // SI-2712
"-feature"
),
javacOptions ++= Seq("-deprecation", "-Xlint:unchecked", "-source", "1.7", "-target", "1.7"),
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oDF"),
Expand Down
1 change: 1 addition & 0 deletions json/src/main/scala/io/sphere/json/FromJSON.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import cats.data.Validated.{Invalid, Valid}
import cats.instances.list._
import cats.syntax.apply._
import cats.syntax.traverse._
import io.sphere.json.field
import io.sphere.util.{BaseMoney, HighPrecisionMoney, LangTag, Money}
import org.json4s.JsonAST._
import org.joda.time._
Expand Down
3 changes: 2 additions & 1 deletion json/src/test/scala/io/sphere/json/JSONSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import cats.data.Validated.{Invalid, Valid}
import cats.data.ValidatedNel
import cats.syntax.apply._
import org.json4s.JsonAST._
import io.sphere.json.field
import io.sphere.json.generic._
import io.sphere.util.Money
import org.joda.time._
Expand Down Expand Up @@ -355,4 +356,4 @@ object TestSubjectBase {

jsonTypeSwitch[TestSubjectBase, TestSubjectCategoryA, TestSubjectCategoryB](Nil)
}
}
}

0 comments on commit 578eded

Please sign in to comment.