Skip to content

Commit 812e624

Browse files
committed
Update scala-library to 3.3.3
migrate akka to pekko
1 parent 398e47f commit 812e624

File tree

6 files changed

+31
-25
lines changed

6 files changed

+31
-25
lines changed

.scalafmt.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version = "3.8.3"
2-
runner.dialect = scala213
2+
runner.dialect = scala3

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# akka-http-example
1+
# pekko-http-example
22

33
[![Test](https://github.com/yokra9/akka-http-example/actions/workflows/Test.yml/badge.svg)](https://github.com/yokra9/akka-http-example/actions/workflows/Test.yml)
44

@@ -17,12 +17,16 @@ sbt run
1717
# テストを実施
1818
sbt test
1919

20-
# カバレッジを測定してレポートを出力 (target/scala-2.13/scoverage-report/)
20+
# カバレッジを測定してレポートを出力
2121
sbt clean coverage test coverageReport
2222

2323
# Docker イメージのビルド
24-
sbt docker:publishLocal
24+
sbt Docker/publishLocal
2525

2626
# Dockerfile 生成のみ (target/docker/stage)
27-
sbt docker:stage
27+
sbt Docker/stage
28+
29+
# 手動ビルドとコンテナの開始
30+
docker build -t pekko-example target/docker/stage/
31+
docker run -p 8088:8088 --env JAVA_OPTS=-Dhttp.port=8088 pekko-example
2832
```

build.sbt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
ThisBuild / scalaVersion := "2.13.14"
1+
ThisBuild / scalaVersion := "3.3.3"
22
run / fork := true
33

44
libraryDependencies ++= Seq(
5-
"com.typesafe.akka" %% "akka-actor-typed" % "2.6.20",
6-
"com.typesafe.akka" %% "akka-stream" % "2.6.20",
7-
"com.typesafe.akka" %% "akka-http" % "10.2.10",
5+
"org.apache.pekko" %% "pekko-actor-typed" % "1.1.0",
6+
"org.apache.pekko" %% "pekko-stream" % "1.1.0",
7+
"org.apache.pekko" %% "pekko-http" % "1.0.1",
88
"ch.qos.logback" % "logback-classic" % "1.5.7",
99
"org.scalactic" %% "scalactic" % "3.2.19",
1010
"org.scalatest" %% "scalatest" % "3.2.19" % Test

src/main/scala/sample.scala

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import akka.actor.typed.ActorSystem
2-
import akka.actor.typed.scaladsl.Behaviors
3-
import akka.event.Logging
4-
import akka.http.scaladsl.Http
5-
import akka.http.scaladsl.model._
6-
import akka.http.scaladsl.server.Directives._
1+
import org.apache.pekko.actor.typed.ActorSystem
2+
import org.apache.pekko.actor.typed.scaladsl.Behaviors
3+
import org.apache.pekko.event.Logging
4+
import org.apache.pekko.http.scaladsl.Http
5+
import org.apache.pekko.http.scaladsl.model._
6+
import org.apache.pekko.http.scaladsl.server.Directives._
77
import scala.concurrent.{Await, Future}
88
import scala.concurrent.duration.Duration
99

1010
object Main {
11-
implicit val system = ActorSystem(Behaviors.empty, "my-sample-app")
11+
implicit val system: ActorSystem[Any] =
12+
ActorSystem(Behaviors.empty, "my-sample-app")
1213

1314
def main(args: Array[String]): Unit = {
1415
Await.ready(start(), Duration.Inf)

src/test/resources/application.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
akka.http.client {
2-
user-agent-header = "akka-http"
1+
pekko.http.client {
2+
user-agent-header = "pekko-http"
33
}

src/test/scala/sample.scala

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import akka.actor.typed.ActorSystem
2-
import akka.actor.typed.scaladsl.Behaviors
3-
import akka.http.scaladsl.Http
4-
import akka.http.scaladsl.model._
5-
import akka.http.scaladsl.unmarshalling.Unmarshal
1+
import org.apache.pekko.actor.typed.ActorSystem
2+
import org.apache.pekko.actor.typed.scaladsl.Behaviors
3+
import org.apache.pekko.event.Logging
4+
import org.apache.pekko.http.scaladsl.Http
5+
import org.apache.pekko.http.scaladsl.model._
6+
import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal
67
import scala.concurrent.{Await, Future}
78
import scala.concurrent.duration._
89
import scala.language.postfixOps
@@ -45,7 +46,7 @@ class MainTests extends AsyncFunSuite {
4546
.map(str => {
4647
println(str)
4748
assert(
48-
str.equals("param: Map(q -> 1), user-agent: akka-http}")
49+
str.equals("param: Map(q -> 1), user-agent: pekko-http}")
4950
)
5051
})
5152
}
@@ -64,7 +65,7 @@ class MainTests extends AsyncFunSuite {
6465
.map(str => {
6566
println(str)
6667
assert(
67-
str.equals("param: Map(), user-agent: akka-http}")
68+
str.equals("param: Map(), user-agent: pekko-http}")
6869
)
6970
})
7071
}

0 commit comments

Comments
 (0)