Skip to content

Commit

Permalink
Scala 2.13.4 (#202)
Browse files Browse the repository at this point in the history
* make changes for 2.13.4:

* update README
  • Loading branch information
jbwheatley authored Dec 4, 2020
1 parent 7e1ef12 commit 4de49f3
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ Scala-Pact is intended for Scala developers who are looking for a better way to

## Latest version is 2.4.0

Scala-Pact now has two branches based on SBT requirements.
Scala-Pact currently only supports [v2 of the pact specification](https://github.com/pact-foundation/pact-specification/tree/version-2). Support for v3 is a future goal of the project.

### Scala-Pact >= 3.0.x

Before this version, the project versioning did not follow semantic versioning. From this point onwards, the version format will be `major.minor.patch`, and it should be noted that the `3` in the version number does *not* correspond to the version supporting v3 of the pact spec (for the time-being, at least).

Scala-Pact now has two branches based on SBT requirements.

#### SBT 1.x compatible (Latest 2.4.0)

All development going forward begins at `2.3.x` and resides on the `master` branch.
For the sake of the maintainer's sanity, version 2.3.x and beyond will only support Scala 2.12 and SBT 1.x or greater.
For the sake of the maintainer's sanity, version 2.3.x and beyond will only support Scala 2.12 and SBT 1.x or greater. The project is currently cross-compiled across scala 2.12.12 and 2.13.4.

#### SBT 0.13.x compatible (Latest 2.2.5)

Expand Down Expand Up @@ -45,7 +51,7 @@ enablePlugins(ScalaPactPlugin)

libraryDependencies ++= Seq(
"com.itv" %% "scalapact-scalatest-suite" % "2.4.0" % "test",
"org.scalatest" %% "scalatest" % "3.0.5" % "test"
"org.scalatest" %% "scalatest" % "3.0.5" % "test"
)
```

Expand All @@ -68,9 +74,9 @@ enablePlugins(ScalaPactPlugin)

libraryDependencies ++= Seq(
"com.itv" %% "scalapact-circe-0-13" % "2.4.0" % "test",
"com.itv" %% "scalapact-http4s-0-21" % "2.4.0" % "test",
"com.itv" %% "scalapact-scalatest" % "2.4.0" % "test",
"org.scalatest" %% "scalatest" % "3.0.5" % "test"
"com.itv" %% "scalapact-http4s-0-21" % "2.4.0" % "test",
"com.itv" %% "scalapact-scalatest" % "2.4.0" % "test",
"org.scalatest" %% "scalatest" % "3.0.5" % "test"
)
```

Expand All @@ -84,7 +90,7 @@ Thanks to the way SBT works, that one plugin line will work in most cases, but i
```scala
libraryDependencies ++= Seq(
"com.itv" %% "scalapact-argonaut-6-2" % "2.4.0",
"com.itv" %% "scalapact-http4s-0-21" % "2.4.0"
"com.itv" %% "scalapact-http4s-0-21" % "2.4.0"
)

addSbtPlugin("com.itv" % "sbt-scalapact-nodeps" % "2.4.0")
Expand Down
7 changes: 5 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def compilerOptionsVersion(scalaVersion: String) =
})

lazy val scalaVersion212: String = "2.12.12"
lazy val scalaVersion213: String = "2.13.3"
lazy val scalaVersion213: String = "2.13.4"
lazy val supportedScalaVersions = List(scalaVersion212, scalaVersion213)

ThisBuild / scalaVersion := scalaVersion212
Expand All @@ -93,7 +93,10 @@ lazy val commonSettings = Seq(
Wart.LeakingSealed,
Wart.Null,
Wart.Var,
Wart.StringPlusAny
Wart.StringPlusAny,
Wart.PlatformDefault,
Wart.ListUnapply,
Wart.GlobalExecutionContext
),
parallelExecution in Test := false,
// javaOptions in Test ++= Seq(
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.3.2
sbt.version = 1.4.4
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.4")

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")

addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.4.10")
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.4.13")

addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.3.0")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ object JsonConversionFunctions extends IJsonConversionFunctions {
case j: Json if j.isObject =>
IrNode(label, jsonObjectToIrNodeList(j, pathToParent)).withPath(pathToParent)

case j: Json if j.isNull =>
IrNode(label, IrNullNode).withPath(pathToParent)

case j: Json if j.isNumber =>
IrNode(label, j.number.flatMap(_.toDouble).map(d => IrNumberNode(d))).withPath(pathToParent)

Expand All @@ -34,6 +31,9 @@ object JsonConversionFunctions extends IJsonConversionFunctions {

case j: Json if j.isString =>
IrNode(label, j.string.map(IrStringNode)).withPath(pathToParent)

case _ =>
IrNode(label, IrNullNode).withPath(pathToParent)
}

private def jsonObjectToIrNodeList(json: Json, pathToParent: IrNodePath): List[IrNode] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ object JsonConversionFunctions extends IJsonConversionFunctions {
case j: Json if j.isObject =>
IrNode(label, jsonObjectToIrNodeList(j, pathToParent)).withPath(pathToParent)

case j: Json if j.isNull =>
IrNode(label, IrNullNode).withPath(pathToParent)

case j: Json if j.isNumber =>
IrNode(label, j.asNumber.map(_.toDouble).map(d => IrNumberNode(d))).withPath(pathToParent)

Expand All @@ -35,6 +32,9 @@ object JsonConversionFunctions extends IJsonConversionFunctions {

case j: Json if j.isString =>
IrNode(label, j.asString.map(IrStringNode)).withPath(pathToParent)

case _ =>
IrNode(label, IrNullNode).withPath(pathToParent)
}

private def jsonObjectToIrNodeList(json: Json, pathToParent: IrNodePath): List[IrNode] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ScalaPactDescription(
* @return [ScalaPactDescription] to allow the builder to continue
*/
def addInteraction(interaction: ScalaPactInteraction): ScalaPactDescription =
new ScalaPactDescription(strict, consumer, provider, sslContextName, interactions :+ interaction)
new ScalaPactDescription(strict, consumer, provider, sslContextName, interaction :: interactions)

def addSslContextForServer(name: String): ScalaPactDescription =
new ScalaPactDescription(strict, consumer, provider, Some(name), interactions)
Expand Down

0 comments on commit 4de49f3

Please sign in to comment.