From ed44da4a15ec2629b682479c13611783ece40cdb Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Fri, 1 Sep 2023 10:16:10 -0700 Subject: [PATCH 1/8] sbt 1.9.4 (was 1.7.2) --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 563a014..3040987 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.7.2 +sbt.version=1.9.4 From 6b511a1263ab5a91704013983a07df5a024df353 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Fri, 1 Sep 2023 10:17:32 -0700 Subject: [PATCH 2/8] remove Scalariform, it is obsolete/unmaintained --- project/Formatting.scala | 27 --------------------------- project/plugins.sbt | 2 -- 2 files changed, 29 deletions(-) delete mode 100644 project/Formatting.scala diff --git a/project/Formatting.scala b/project/Formatting.scala deleted file mode 100644 index b7d3a9a..0000000 --- a/project/Formatting.scala +++ /dev/null @@ -1,27 +0,0 @@ -import sbt._ - -import com.typesafe.sbt.SbtScalariform -import com.typesafe.sbt.SbtScalariform.ScalariformKeys - -object Formatting extends AutoPlugin { - override def trigger: PluginTrigger = AllRequirements - override def requires: Plugins = SbtScalariform - - override def projectSettings: Seq[_root_.sbt.Def.Setting[_]] = formatSettings - - lazy val formatSettings = Seq( - Compile / ScalariformKeys.preferences := formattingPreferences, - Test / ScalariformKeys.preferences := formattingPreferences - ) - - import scalariform.formatter.preferences._ - - def formattingPreferences: FormattingPreferences = - FormattingPreferences() - .setPreference(RewriteArrowSymbols, false) - .setPreference(AlignParameters, true) - .setPreference(AlignSingleLineCaseStatements, true) - .setPreference(DanglingCloseParenthesis, Preserve) - .setPreference(DoubleIndentConstructorArguments, true) - .setPreference(SpacesAroundMultiImports, true) -} diff --git a/project/plugins.sbt b/project/plugins.sbt index ba74639..d4312f7 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,3 +1 @@ -addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.2") - addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") From b29aa51555b5bcfb34d19bf2e0437b3294307c12 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Fri, 1 Sep 2023 10:18:49 -0700 Subject: [PATCH 3/8] Scala 2.13.11 (was .10) --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 15ed59e..7daf93a 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,4 @@ -scalaVersion := "2.13.10" +scalaVersion := "2.13.11" scalacOptions ++= Seq("-deprecation", "-feature") resolvers += "Akka library repository".at("https://repo.akka.io/maven") From 96230411afd444fd3262ea76c826749710a4ec2e Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Fri, 1 Sep 2023 10:19:28 -0700 Subject: [PATCH 4/8] use latest akka-http and akka-stream versions --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 7daf93a..5c13d1d 100644 --- a/build.sbt +++ b/build.sbt @@ -4,6 +4,6 @@ scalacOptions ++= Seq("-deprecation", "-feature") resolvers += "Akka library repository".at("https://repo.akka.io/maven") libraryDependencies ++= Seq( - "com.typesafe.akka" %% "akka-http" % "10.1.15", - "com.typesafe.akka" %% "akka-stream" % "2.6.20", + "com.typesafe.akka" %% "akka-http" % "10.5.2", + "com.typesafe.akka" %% "akka-stream" % "2.8.4", ) From cc6b71ac1a14a1982650b0c77131ea37a6d3777e Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Fri, 1 Sep 2023 10:25:57 -0700 Subject: [PATCH 5/8] fix warnings --- src/main/scala/akka/http/webgoat/BootWebGoat.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/scala/akka/http/webgoat/BootWebGoat.scala b/src/main/scala/akka/http/webgoat/BootWebGoat.scala index 14d1f30..f267fad 100644 --- a/src/main/scala/akka/http/webgoat/BootWebGoat.scala +++ b/src/main/scala/akka/http/webgoat/BootWebGoat.scala @@ -2,21 +2,21 @@ package akka.http.webgoat import akka.actor.ActorSystem import akka.http.scaladsl.Http -import akka.stream.ActorMaterializer +import akka.stream.Materializer import scala.util.Failure import scala.util.Success import scala.util.control.NonFatal object BootWebGoat extends App { - implicit val system = ActorSystem() - implicit val mat = ActorMaterializer() + implicit val system: ActorSystem = ActorSystem() import system.dispatcher try { val bindingF = Http() - .bindAndHandle(Routes.root, "localhost", 8080) + .newServerAt("localhost", 8080) + .bindFlow(Routes.root) bindingF.onComplete { case Success(binding) => From fe510bf262955e98b64127599d17c5b6b4c3e3b5 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Fri, 1 Sep 2023 10:27:28 -0700 Subject: [PATCH 6/8] add JDK 20 to CI matrix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b01104..52eea83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - java: [8, 11, 17] + java: [8, 11, 17, 20] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 8b13e2f53685b80e06a0d55880fa7eea0923677b Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Fri, 1 Sep 2023 10:29:49 -0700 Subject: [PATCH 7/8] bump GitHub Actions versions --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52eea83..3d162c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,9 @@ jobs: java: [8, 11, 17, 20] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: coursier/cache-action@v6 - - uses: actions/setup-java@v2 + - uses: actions/setup-java@v3 with: distribution: temurin java-version: ${{matrix.java}} From 5072a93050fb6e628bd2ea46be366640875d1fd6 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Fri, 1 Sep 2023 10:31:00 -0700 Subject: [PATCH 8/8] crossbuild for Scala 3 --- .github/workflows/ci.yml | 3 ++- build.sbt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d162c7..bc31603 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ jobs: fail-fast: false matrix: java: [8, 11, 17, 20] + scala: [2.13.x, 3.x] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -19,4 +20,4 @@ jobs: distribution: temurin java-version: ${{matrix.java}} - name: Test - run: sbt test + run: sbt ++${{matrix.scala}} test diff --git a/build.sbt b/build.sbt index 5c13d1d..9750cd0 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,5 @@ -scalaVersion := "2.13.11" +crossScalaVersions := Seq("2.13.11", "3.3.0") +scalaVersion := crossScalaVersions.value.head scalacOptions ++= Seq("-deprecation", "-feature") resolvers += "Akka library repository".at("https://repo.akka.io/maven")