Skip to content

Commit

Permalink
Scala 2.13.0-M4
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Jun 19, 2018
1 parent 9a36e85 commit 6150fc4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dist: trusty
scala:
- 2.11.12
- 2.12.6
- 2.13.0-M3
- 2.13.0-M4
jdk:
- oraclejdk8
- openjdk8
Expand Down
24 changes: 12 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ lazy val library: Project = module("unfiltered")(
dependsOnInTest(filterProjectId),
libraryDependencies ++= Seq(
"commons-codec" % "commons-codec" % commonsCodecVersion,
specs2Dep % "test",
specs2Dep.value % "test",
"org.scalacheck" %% "scalacheck" % scalacheckVersion % "test",
),
libraryDependencies ++= {
Expand Down Expand Up @@ -66,7 +66,7 @@ lazy val agents = module("agents")(
srcPath = "unfiltered/request"
).settings(
description := "User-Agent request matchers",
libraryDependencies ++= Seq(servletApiDep) ++ integrationTestDeps
libraryDependencies ++= Seq(servletApiDep) ++ integrationTestDeps.value
).dependsOn(
library,
scalatest % "test",
Expand All @@ -79,7 +79,7 @@ lazy val uploads = module("uploads")(
description := "Generic support for multi-part uploads",
libraryDependencies ++= Seq(
"commons-io" % "commons-io" % commonsIoVersion
) ++ integrationTestDeps
) ++ integrationTestDeps.value
).dependsOn(library, specs2 % "test")

lazy val filterUploads = module("filter-uploads")(
Expand All @@ -89,11 +89,11 @@ lazy val filterUploads = module("filter-uploads")(
libraryDependencies ++= Seq(
servletApiDep,
"commons-fileupload" % "commons-fileupload" % commonsFileUploadVersion
) ++ integrationTestDeps
) ++ integrationTestDeps.value
).dependsOn(uploads, filters, specs2 % "test")

lazy val util = module("util")().settings(
libraryDependencies += specs2Dep % "test"
libraryDependencies += specs2Dep.value % "test"
)

lazy val jetty = module("jetty")().settings(
Expand All @@ -108,7 +108,7 @@ lazy val nettyServer = module("netty-server")(
).settings(
description := "Netty server embedding module",
dependsOnSpecs2InTest,
libraryDependencies ++= integrationTestDeps
libraryDependencies ++= integrationTestDeps.value
).dependsOn(netty, util)

lazy val netty = module("netty")().settings(
Expand All @@ -117,39 +117,39 @@ lazy val netty = module("netty")().settings(
libraryDependencies ++= {
("io.netty" % "netty-codec-http" % nettyVersion) +:
("io.netty" % "netty-handler" % nettyVersion) +:
integrationTestDeps
integrationTestDeps.value
}
).dependsOn(library)

lazy val specs2: Project = module(specs2ProjectId)().settings(
description := "Facilitates testing Unfiltered servers with Specs2",
libraryDependencies ++= {
specs2Dep :: okHttp
specs2Dep.value :: okHttp
}
).dependsOn(filters, jetty, nettyServer)

lazy val scalatest = module(scalatestProjectId)().settings(
description := "Facilitates testing Unfiltered servers with ScalaTest",
libraryDependencies ++= okHttp :+ "org.scalatest" %% "scalatest" % scalatestVersion
libraryDependencies ++= okHttp :+ "org.scalatest" %% "scalatest" % scalatestVersion.value
).dependsOn(filters, jetty, nettyServer)

lazy val json4s = module("json4s")(
srcPath = "unfiltered"
).settings(
description := "Json4s request matchers and response functions",
libraryDependencies ++= {
Seq("org.json4s" %% "json4s-native" % json4sVersion) ++ integrationTestDeps
Seq("org.json4s" %% "json4s-native" % json4sVersion) ++ integrationTestDeps.value
}
).dependsOn(library, filters % "test", specs2 % "test")

lazy val websockets = module("netty-websockets")().settings(
description := "WebSockets plan support using Netty",
libraryDependencies ++= integrationTestDeps,
libraryDependencies ++= integrationTestDeps.value,
libraryDependencies += "com.ning" % "async-http-client" % asyncHttpClientVersion % "test"
).dependsOn(nettyServer, specs2 % "test")

lazy val nettyUploads = module("netty-uploads")().settings(
description := "Uploads plan support using Netty",
libraryDependencies ++= integrationTestDeps,
libraryDependencies ++= integrationTestDeps.value,
parallelExecution in Test := false
).dependsOn(nettyServer, uploads, specs2 % "test")
2 changes: 1 addition & 1 deletion filter/src/test/scala/PlanSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ object PlanSpec extends Specification with unfiltered.specs2.jetty.Served {
http(host / "filter5" / "cplan").as_string must_== "Plan C"
}
"filter must extract query string" in {
http(host / "query" / "qplan" <<? Map("foo"->"bar", "baz"->"boom")).as_string must_== "foo=bar&baz=boom"
http(host / "query" / "qplan" <<? new Map.Map2("foo", "bar", "baz", "boom")).as_string must_== "foo=bar&baz=boom"
}
}
}
23 changes: 19 additions & 4 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import sbt._
import sbt._, Keys._

object Dependencies {
val servletApiDep = "javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided"

val specs2Dep = "org.specs2" %% "specs2-core" % "4.2.0"
val specs2Dep = Def.setting {
val v = CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v >= 13 =>
"4.3.0"
case _ =>
"4.2.0"
}
"org.specs2" %% "specs2-core" % v
}

def okHttp = "com.squareup.okhttp3" % "okhttp" % "3.10.0" :: Nil

def integrationTestDeps = (specs2Dep :: okHttp) map { _ % "test" }
def integrationTestDeps = Def.setting((specs2Dep.value :: okHttp) map { _ % "test" })

val commonsCodecVersion = "1.11"
val scalacheckVersion = "1.14.0"
Expand All @@ -16,7 +24,14 @@ object Dependencies {
val commonsFileUploadVersion = "1.3.3"
val jettyVersion = "9.4.8.v20171121"
val nettyVersion = "4.1.13.Final"
val scalatestVersion = "3.0.5-M1"
val scalatestVersion = Def.setting {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v >= 13 =>
"3.0.6-SNAP1"
case _ =>
"3.0.5-M1"
}
}
val json4sVersion = "3.5.4"
val asyncHttpClientVersion = "1.8.17"
val scribeJavaVersion = "3.3.0"
Expand Down
2 changes: 1 addition & 1 deletion project/common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object Common {
val settings: Seq[Setting[_]] = Defaults.coreDefaultSettings ++ Seq(
organization := "ws.unfiltered",

crossScalaVersions := Seq("2.13.0-M3", Scala212, "2.11.12"),
crossScalaVersions := Seq("2.13.0-M4", Scala212, "2.11.12"),

scalaVersion := Scala212,

Expand Down

0 comments on commit 6150fc4

Please sign in to comment.