Skip to content

Commit

Permalink
Fix PSH version in scripts/akka-to-pekko
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelLipski committed Aug 24, 2023
1 parent e985c2b commit ea0a7f1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/standard-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ jobs:
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1

- run: git fetch --tags
- name: Publish Maven artifacts
run: sbt ci-release
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.log

.bsp/
.DS_Store/
.idea/
.sbt/
null/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.virtuslab.ash.circe

import akka.actor
// scalafix:off
import akka.actor.{ActorSystem => ClassicActorSystem}
import akka.actor.typed.ActorRef
import akka.actor.typed.ActorRefResolver
import akka.actor.typed.ActorSystem
Expand All @@ -11,28 +12,29 @@ import akka.stream.StreamRefResolver
import io.circe.Codec
import io.circe.Decoder
import io.circe.Encoder
//scalafix:on

/**
* Default codecs for serializing some of Akka types
*/
trait AkkaCodecs {
private def serializationSystem: actor.ActorSystem = Serialization.getCurrentTransportInformation().system
private def serializationSystem: ClassicActorSystem = Serialization.getCurrentTransportInformation().system

implicit def actorRefCodec[T](implicit system: actor.ActorSystem = serializationSystem): Codec[ActorRef[T]] = {
implicit def actorRefCodec[T](implicit system: ClassicActorSystem = serializationSystem): Codec[ActorRef[T]] = {
val resolver = ActorRefResolver(ActorSystem.wrap(system))
Codec.from(
Decoder.decodeString.map(resolver.resolveActorRef),
Encoder.encodeString.contramap(resolver.toSerializationFormat))
}

implicit def sinkRefCodec[T](implicit system: actor.ActorSystem = serializationSystem): Codec[SinkRef[T]] = {
implicit def sinkRefCodec[T](implicit system: ClassicActorSystem = serializationSystem): Codec[SinkRef[T]] = {
val resolver = StreamRefResolver(ActorSystem.wrap(system))
Codec.from(
Decoder.decodeString.map(resolver.resolveSinkRef),
Encoder.encodeString.contramap(resolver.toSerializationFormat(_: SinkRef[T])))
}

implicit def sourceRefCodec[T](implicit system: actor.ActorSystem = serializationSystem): Codec[SourceRef[T]] = {
implicit def sourceRefCodec[T](implicit system: ClassicActorSystem = serializationSystem): Codec[SourceRef[T]] = {
val resolver = StreamRefResolver(ActorSystem.wrap(system))
Codec.from(
Decoder.decodeString.map(resolver.resolveSourceRef),
Expand Down
4 changes: 2 additions & 2 deletions scripts/akka-to-pekko.sed
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/<START-AKKA>/, /<END-AKKA>/ d
s/import akka/import org.apache.pekko/

# All cases where "akka" isn't simply replaced with "pekko"
s/"akka\./"org.apache.pekko./
Expand All @@ -11,7 +12,6 @@ s/doc\.akka\.io/pekko.apache.org/g
# TODO (#325): use a more proper link once this tutorial is published
s!https://developer\.lightbend\.com/docs/akka-platform-guide/microservices-tutorial/index\.html!https://github.com/apache/incubator-pekko-platform-guide/blob/main/docs-source/docs/modules/microservices-tutorial/pages/index.adoc!
s!https://github\.com/akka/akka-samples/tree/2\.6/akka-sample-cluster-scala!https://github.com/apache/incubator-pekko-samples/tree/forked-from-akka/akka-sample-cluster-scala!
s/import akka/import org.apache.pekko/

s/akka/pekko/g
s/Akka/Pekko/g
Expand All @@ -21,7 +21,7 @@ s/\<ASH\>/ASH/g
s/("ch\.megard" %% "pekko-http-cors") % ".*"/\1 % "0.0.0-SNAPSHOT"/
s/("org\.apache\.pekko" %% "pekko-grpc-runtime") % ".*"/\1 % "1.0.0-RC2-2-56662643-SNAPSHOT"/
s/("org\.apache\.pekko" % "sbt-pekko-grpc") % ".*"/\1 % "0.0.0-94-0bfb43a6-SNAPSHOT"/
s/("org\.virtuslab\.ash" % "sbt-akka-serialization-helper") % ".*"/\1 % "0.1.0"/
s/("org\.virtuslab\.psh" % "sbt-pekko-serialization-helper") % ".*"/\1 % "0.7.2.1"/
s/(val pekkoHttp2SupportVersion) = .*/\1 = "0.0.0+4272-045c925b-SNAPSHOT"/
s/(val pekkoHttpVersion) = .*/\1 = "1.0.0"/
s/(val pekkoManagementVersion) = .*/\1 = "1.0.0"/
Expand Down

0 comments on commit ea0a7f1

Please sign in to comment.