From 6d955cd67f4378da9df29462537ce933bea7eea8 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Tue, 30 Jun 2020 16:32:39 -0700 Subject: [PATCH 1/3] bump Scala and sbt versions --- .travis.yml | 5 ++--- project/build.properties | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c214874..c402d2f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,8 @@ language: scala scala: - 2.11.12 - - 2.12.10 - - 2.13.1 + - 2.12.11 + - 2.13.3 env: - ADOPTOPENJDK=8 @@ -20,6 +20,5 @@ script: ./build.sh notifications: email: - - adriaan.moors@lightbend.com - seth.tisue@lightbend.com - andy@hicks.net diff --git a/project/build.properties b/project/build.properties index a82bb05e..0837f7a1 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.3.7 +sbt.version=1.3.13 From 48f972fded98fa1d4c5744253bce9dc92ed30d81 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Tue, 30 Jun 2020 16:33:43 -0700 Subject: [PATCH 2/3] move to ScalaTest 3.2 (and narrower dependencies) --- build.sbt | 5 ++++- src/test/scala/scala/swing/Issue73.scala | 5 +++-- src/test/scala/scala/swing/Issue97.scala | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index c6e67800..26f1c77b 100644 --- a/build.sbt +++ b/build.sbt @@ -7,7 +7,10 @@ lazy val swing = project.in(file(".")) scalaModuleMimaPreviousVersion := Some("2.1.0"), // set the prompt (for this build) to include the project id. shellPrompt in ThisBuild := { state => Project.extract(state).currentRef.project + "> " }, - libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % Test, + libraryDependencies ++= Seq( + "org.scalatest" %% "scalatest-flatspec" % "3.2.0" % Test, + "org.scalatest" %% "scalatest-shouldmatchers" % "3.2.0" % Test, + ), // Adds a `src/main/scala-2.13+` source directory for Scala 2.13 and newer // and a `src/main/scala-2.13-` source directory for Scala version older than 2.13 unmanagedSourceDirectories in Compile += { diff --git a/src/test/scala/scala/swing/Issue73.scala b/src/test/scala/scala/swing/Issue73.scala index b2260100..4af18e22 100644 --- a/src/test/scala/scala/swing/Issue73.scala +++ b/src/test/scala/scala/swing/Issue73.scala @@ -1,8 +1,9 @@ package scala.swing -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -class Issue73 extends FlatSpec with Matchers { +class Issue73 extends AnyFlatSpec with Matchers { "Enumerations" should "not contain duplicate ids" in { // the initializers of any of these will through an // assertion error if an enumeration `Value` id is used twice. diff --git a/src/test/scala/scala/swing/Issue97.scala b/src/test/scala/scala/swing/Issue97.scala index f2ba52cf..95103abd 100644 --- a/src/test/scala/scala/swing/Issue97.scala +++ b/src/test/scala/scala/swing/Issue97.scala @@ -2,7 +2,8 @@ package scala.swing import java.util.concurrent.TimeUnit -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers import scala.concurrent.duration.Duration import scala.concurrent.{Await, Future, Promise} @@ -10,7 +11,7 @@ import scala.swing.event.{UIElementHidden, UIElementMoved, UIElementResized, UIE import scala.util.control.NonFatal // Note: `AsyncFlatSpec` has issues with swallowing errors and returning early. -class Issue97 extends FlatSpec with Matchers { +class Issue97 extends AnyFlatSpec with Matchers { case class Count(shown: Int = 0, hidden: Int = 0, moved: Int = 0, resized: Int = 0) def countEvents(): Future[Count] = { From 0c0edb62027d3a236e37c18a2705d0699fb307f0 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Tue, 30 Jun 2020 16:34:55 -0700 Subject: [PATCH 3/3] use slash style consistently in build definition --- build.sbt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index 26f1c77b..bdc99963 100644 --- a/build.sbt +++ b/build.sbt @@ -6,15 +6,15 @@ lazy val swing = project.in(file(".")) OsgiKeys.exportPackage := Seq(s"scala.swing.*;version=${version.value}"), scalaModuleMimaPreviousVersion := Some("2.1.0"), // set the prompt (for this build) to include the project id. - shellPrompt in ThisBuild := { state => Project.extract(state).currentRef.project + "> " }, + ThisBuild / shellPrompt := { state => Project.extract(state).currentRef.project + "> " }, libraryDependencies ++= Seq( "org.scalatest" %% "scalatest-flatspec" % "3.2.0" % Test, "org.scalatest" %% "scalatest-shouldmatchers" % "3.2.0" % Test, ), // Adds a `src/main/scala-2.13+` source directory for Scala 2.13 and newer // and a `src/main/scala-2.13-` source directory for Scala version older than 2.13 - unmanagedSourceDirectories in Compile += { - val sourceDir = (sourceDirectory in Compile).value + Compile / unmanagedSourceDirectories += { + val sourceDir = (Compile / sourceDirectory).value CrossVersion.partialVersion(scalaVersion.value) match { case Some((2, n)) if n >= 13 => sourceDir / "scala-2.13+" case _ => sourceDir / "scala-2.13-" @@ -25,15 +25,15 @@ lazy val swing = project.in(file(".")) lazy val examples = project.in(file("examples")) .dependsOn(swing) .settings( - scalaVersion := (scalaVersion in swing).value, - fork in run := true, + scalaVersion := (swing / scalaVersion).value, + run / fork := true, fork := true ) lazy val uitest = project.in(file("uitest")) .dependsOn(swing) .settings( - scalaVersion := (scalaVersion in swing).value, - fork in run := true, + scalaVersion := (swing / scalaVersion).value, + run / fork := true, fork := true )