From e8d1a32d7baedc3fd1a82c159456f54cd8131c05 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 8 Aug 2023 13:18:22 +0100 Subject: Moved to use Pekko --- .scalafmt.conf | 3 ++- CHANGES.md | 2 ++ README.md | 5 +++-- build.sc | 11 +++++------ server/src/net/usebox/gemini/server/Response.scala | 8 +++++--- server/src/net/usebox/gemini/server/Server.scala | 10 ++++++---- server/test/src/ServerSpec.scala | 4 +++- 7 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index efea3b4..1170b8e 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -10,5 +10,6 @@ rewrite.imports.sort = original rewrite.imports.groups = [ ["java\\..*", "javax\\..*"], ["scala\\..*"], - ["net\\.usebox\\..*"] + ["net\\.usebox\\..*"], + ["org\\.apache\\..*", "pekko\\..*"] ] diff --git a/CHANGES.md b/CHANGES.md index b330147..c784f02 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,8 @@ ## Release 1.3.6 - 2023-08-08 - Updated dependencies. + - Moved to Pekko (a fork of Akka) after Lightbend decided to change their licence model and abandon open source for new releases. + - Updated mill (development) and scalafmt. ## Release 1.3.5 - 2022-12-01 diff --git a/README.md b/README.md index b1de5d7..92f6db2 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ This is a server for the [Gemini](https://gemini.circumlunar.space/) protocol. -It is built using [Scala](https://www.scala-lang.org/) and Akka Streams. The -name tries to link the Gemini *theme* with the fact that the server runs on the +It is built using [Scala](https://www.scala-lang.org/) and [Pekko Streams](https://pekko.apache.org/docs/pekko/current/stream/index.html). + +The name tries to link the Gemini *theme* with the fact that the server runs on the Java Virtual Machine. Some of the **SpaceBeans** features: diff --git a/build.sc b/build.sc index 59dfe2f..d3300e7 100644 --- a/build.sc +++ b/build.sc @@ -1,11 +1,10 @@ -import mill._ -import mill.scalalib._ -import scalafmt._ - +import $ivy.`com.lihaoyi::mill-contrib-buildinfo:$MILL_VERSION` import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.1.4` import de.tobiasroeser.mill.vcs.version.VcsVersion -import $ivy.`com.lihaoyi::mill-contrib-buildinfo:$MILL_VERSION` +import mill._ import mill.contrib.buildinfo.BuildInfo +import mill.scalalib._ +import scalafmt._ object server extends ScalaModule with ScalafmtModule with BuildInfo { def scalaVersion = "2.13.11" @@ -28,7 +27,7 @@ object server extends ScalaModule with ScalafmtModule with BuildInfo { ivy"ch.qos.logback:logback-classic:1.4.9", ivy"com.github.pureconfig::pureconfig:0.17.4", ivy"com.github.scopt::scopt:4.1.0", - ivy"com.typesafe.akka::akka-stream:2.8.3", + ivy"org.apache.pekko::pekko-stream:1.0.1", ivy"org.bouncycastle:bcprov-jdk15to18:1.76", ivy"org.log4s::log4s:1.10.0" ) diff --git a/server/src/net/usebox/gemini/server/Response.scala b/server/src/net/usebox/gemini/server/Response.scala index 9675262..5af0f61 100644 --- a/server/src/net/usebox/gemini/server/Response.scala +++ b/server/src/net/usebox/gemini/server/Response.scala @@ -7,9 +7,11 @@ import scala.util.Try import net.usebox.gemini.server.URIUtils._ -import akka.stream.scaladsl.{FileIO, Source} -import akka.stream.ActorAttributes -import akka.util.ByteString +import org.apache.pekko +import pekko.stream.scaladsl.{FileIO, Source} +import pekko.stream.ActorAttributes +import pekko.util.ByteString + import org.log4s._ sealed trait Response { diff --git a/server/src/net/usebox/gemini/server/Server.scala b/server/src/net/usebox/gemini/server/Server.scala index 3925f12..bd3c66c 100644 --- a/server/src/net/usebox/gemini/server/Server.scala +++ b/server/src/net/usebox/gemini/server/Server.scala @@ -9,10 +9,12 @@ import scala.util.{Success => TrySuccess, Try} import net.usebox.gemini.server.handlers.GeminiHandler -import akka.actor.ActorSystem -import akka.stream._ -import akka.stream.scaladsl._ -import akka.util.ByteString +import org.apache.pekko +import pekko.actor.ActorSystem +import pekko.stream._ +import pekko.stream.scaladsl._ +import pekko.util.ByteString + import org.log4s._ case class Server(conf: ServiceConf) { diff --git a/server/test/src/ServerSpec.scala b/server/test/src/ServerSpec.scala index 800230a..9b6025a 100644 --- a/server/test/src/ServerSpec.scala +++ b/server/test/src/ServerSpec.scala @@ -1,6 +1,8 @@ package net.usebox.gemini.server -import akka.util.ByteString +import org.apache.pekko +import pekko.util.ByteString + import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers -- cgit v1.2.3