Skip to content

Commit 4d3bc7e

Browse files
authored
Merge pull request #131 from kapkaev/scala_2.13
support scala 2.13
2 parents 26a7f65 + 0f21c40 commit 4d3bc7e

File tree

8 files changed

+32
-26
lines changed

8 files changed

+32
-26
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ before_install:
1010
language: scala
1111

1212
scala:
13-
- 2.12.3
14-
- 2.11.11
13+
- 2.13.0
14+
- 2.12.8
15+
- 2.11.12
1516

1617
jdk:
1718
- oraclejdk8
@@ -29,4 +30,4 @@ cache:
2930
before_cache:
3031
# Tricks to avoid unnecessary cache updates
3132
- find $HOME/.ivy2 -name "ivydata-*.properties" -delete
32-
- find $HOME/.sbt -name "*.lock" -delete
33+
- find $HOME/.sbt -name "*.lock" -delete

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ There are separate artifacts available for these libraries:
2323

2424
```scala
2525
libraryDependencies ++= Seq(
26-
"com.whisk" %% "docker-testkit-scalatest" % "0.9.8" % "test",
27-
"com.whisk" %% "docker-testkit-impl-spotify" % "0.9.8" % "test")
26+
"com.whisk" %% "docker-testkit-scalatest" % "0.9.9" % "test",
27+
"com.whisk" %% "docker-testkit-impl-spotify" % "0.9.9" % "test")
2828
```
2929

3030
**docker-java**
3131

3232
```scala
3333
libraryDependencies ++= Seq(
34-
"com.whisk" %% "docker-testkit-scalatest" % "0.9.8" % "test",
35-
"com.whisk" %% "docker-testkit-impl-docker-java" % "0.9.8" % "test")
34+
"com.whisk" %% "docker-testkit-scalatest" % "0.9.9" % "test",
35+
"com.whisk" %% "docker-testkit-impl-docker-java" % "0.9.9" % "test")
3636
```
3737

3838
You don't necessarily have to use `scalatest` dependency as demonstrated above.

build.sbt

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
lazy val commonSettings = Seq(
22
organization := "com.whisk",
3-
version := "0.9.8",
4-
scalaVersion := "2.12.3",
5-
crossScalaVersions := Seq("2.12.3", "2.11.11", "2.10.6"),
3+
version := "0.9.9",
4+
scalaVersion := "2.13.0",
5+
crossScalaVersions := Seq("2.13.0", "2.12.8", "2.11.12"),
66
scalacOptions ++= Seq("-feature", "-deprecation"),
77
fork in Test := true,
88
licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
@@ -90,7 +90,7 @@ lazy val scalatest =
9090
.settings(
9191
name := "docker-testkit-scalatest",
9292
libraryDependencies ++=
93-
Seq("org.scalatest" %% "scalatest" % "3.0.4",
93+
Seq("org.scalatest" %% "scalatest" % "3.0.8",
9494
"ch.qos.logback" % "logback-classic" % "1.2.1" % "test",
9595
"org.postgresql" % "postgresql" % "9.4.1210" % "test")
9696
)
@@ -102,7 +102,7 @@ lazy val specs2 =
102102
.settings(
103103
name := "docker-testkit-specs2",
104104
libraryDependencies ++=
105-
Seq("org.specs2" %% "specs2-core" % "3.8.6",
105+
Seq("org.specs2" %% "specs2-core" % "4.5.1",
106106
"ch.qos.logback" % "logback-classic" % "1.2.1" % "test",
107107
"org.postgresql" % "postgresql" % "9.4.1210" % "test")
108108
)
@@ -115,12 +115,8 @@ lazy val config =
115115
name := "docker-testkit-config",
116116
libraryDependencies ++=
117117
Seq(
118-
"com.iheart" %% "ficus" % "1.4.1",
119-
"org.scalatest" %% "scalatest" % "3.0.4" % "test"
120-
),
121-
publish := scalaVersion map {
122-
case x if x.startsWith("2.10") => {}
123-
case _ => publish.value
124-
}
118+
"com.iheart" %% "ficus" % "1.4.7",
119+
"org.scalatest" %% "scalatest" % "3.0.8" % "test"
120+
)
125121
)
126122
.dependsOn(core, testkitDockerJavaImpl)

config/src/main/scala/com/whisk/docker/config/DockerTypesafeConfig.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ object DockerTypesafeConfig extends DockerKitDockerJava {
6060
`memory-reservation`: Option[Long]) {
6161

6262
def toDockerContainer(): DockerContainer = {
63-
val bindPorts = `port-maps`.fold(EmptyPortBindings) { _.values.map(_.asTuple).toMap } mapValues {
64-
maybeHostPort =>
65-
DockerPortMapping(maybeHostPort)
66-
}
63+
val bindPorts = `port-maps`.fold(EmptyPortBindings) { _.values.map(_.asTuple).toMap }.toSeq.map {
64+
case (internalPort, maybeHostPort) =>
65+
internalPort -> DockerPortMapping(maybeHostPort)
66+
}.toMap
6767

6868
val readyChecker = `ready-checker`.fold[DockerReadyChecker](AlwaysReady) { _.toReadyChecker }
6969

core/src/main/scala/com/whisk/docker/DockerContainer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ case class DockerContainer(image: String,
4545
def withEntrypoint(entrypoint: String*) = copy(entrypoint = Some(entrypoint))
4646

4747
def withPorts(ps: (Int, Option[Int])*) =
48-
copy(bindPorts = ps.toMap.mapValues(hostPort => DockerPortMapping(hostPort)))
48+
copy(bindPorts = ps.map { case (internalPort, hostPort) => internalPort -> DockerPortMapping(hostPort) }.toMap)
4949

5050
def withPortMapping(ps: (Int, DockerPortMapping)*) = copy(bindPorts = ps.toMap)
5151

core/src/main/scala/com/whisk/docker/DockerContainerManager.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class DockerContainerManager(containers: Seq[DockerContainer], executor: DockerC
1414
private implicit val dockerExecutor = executor
1515

1616
private val dockerStatesMap: Map[DockerContainer, DockerContainerState] =
17-
containers.map(c => c -> new DockerContainerState(c))(collection.breakOut)
17+
containers.map(c => c -> new DockerContainerState(c)).toMap
1818

1919
val states = dockerStatesMap.values.toList
2020

notes/0.9.9.markdown

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#scala #docker #integration-testing
2+
3+
## Highlights
4+
5+
* add cross-compilation for scala [2.13.0](https://github.com/scala/scala/releases/tag/v2.13.0)
6+
* updated [sbt](https://github.com/sbt/sbt) to 1.2.8
7+
* updated [scalatest](https://github.com/scalatest/scalatest) to 3.0.8
8+
* updated [specs2-core](https://github.com/etorreborre/specs2) to 4.5.1
9+
* updated [ficus](https://github.com/iheartradio/ficus) to 1.4.7

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.0.1
1+
sbt.version=1.2.8

0 commit comments

Comments
 (0)