diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 12301490..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" diff --git a/.github/workflows/standard-workflow.yml b/.github/workflows/standard-workflow.yml index a8bf47c1..c9d3efa0 100644 --- a/.github/workflows/standard-workflow.yml +++ b/.github/workflows/standard-workflow.yml @@ -34,13 +34,13 @@ jobs: run: sbt scalafmtCheckAll scalafmtSbtCheck "scalafixAll --check" working-directory: examples/event-migration - - name: Check code style - examples/akka-cluster-app + - name: Check code style - examples/pekko-cluster-app run: sbt scalafmtCheckAll scalafmtSbtCheck "scalafixAll --check" - working-directory: examples/akka-cluster-app + working-directory: examples/pekko-cluster-app - - name: Check code style - examples/akka-persistence-app + - name: Check code style - examples/pekko-persistence-app run: sbt scalafmtCheckAll scalafmtSbtCheck "scalafixAll --check" - working-directory: examples/akka-persistence-app + working-directory: examples/pekko-persistence-app test-212: runs-on: ubuntu-latest @@ -101,44 +101,13 @@ jobs: run: sbt test working-directory: examples/event-migration - - name: Compile akka-cluster-app + - name: Compile pekko-cluster-app run: sbt compile - working-directory: examples/akka-cluster-app + working-directory: examples/pekko-cluster-app - - name: Test akka-persistence-app + - name: Test pekko-persistence-app run: sbt test - working-directory: examples/akka-persistence-app + working-directory: examples/pekko-persistence-app - # - patch-and-push-to-psh: - if: github.event_name != 'pull_request' - needs: [code-style-check, test-212, test-213, test-sbt-plugin, run-examples] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - # Fetch all history so that a push to pekko-serialization-helper succeeds. - # See https://stackoverflow.com/q/76470864 - fetch-depth: 0 - - run: git status - - run: git checkout -b TEMP/from-ash - - run: curl -sL https://raw.githubusercontent.com/ap/rename/master/rename | sudo tee /usr/local/bin/rename - - run: sudo chmod +x /usr/local/bin/rename - - run: ./scripts/akka-to-pekko - - run: git add . - - run: git config user.email "psh@virtuslab.com" - - run: git config user.name "Pekko Serialization Helper Bot" - - run: git commit -m 'Migrate `main` branch from from akka-serialization-helper' - - env: - # 2.1 Generate an SSH key in terminal (Leave the passphrase empty) - # 2.2 Add public key in the external repository: /Settings/Deploy keys/Add deploy key - # Paste the public key. Enable "Allow write access" - # 2.3 Add private key in the source repository: /Settings/Secrets/Actions/New repository secret - # Paste the private key. - PSH_SSH_PRIVATE_KEY: ${{ secrets.PSH_SSH_PRIVATE_KEY }} - run: mkdir -p ~/.ssh/ && echo "$PSH_SSH_PRIVATE_KEY" > ~/.ssh/psh && chmod 400 ~/.ssh/psh - - run: git config core.sshCommand "ssh -i $HOME/.ssh/psh" - - run: git push --force git@github.com:VirtusLab/pekko-serialization-helper.git HEAD:main - # ### diff --git a/.scala-steward.conf b/.scala-steward.conf index 47df8834..150f86ed 100644 --- a/.scala-steward.conf +++ b/.scala-steward.conf @@ -4,11 +4,11 @@ commits.message = "Scala-Steward: Update ${artifactName} from ${currentVersion} buildRoots = [ ".", - "examples/akka-cluster-app/", - "examples/akka-persistence-app/", + "examples/pekko-cluster-app/", + "examples/pekko-persistence-app/", "examples/event-migration/", - "sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies", - "sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple", + "sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies", + "sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple", ] scalafmt.runAfterUpgrading = false @@ -22,70 +22,11 @@ pullRequests { } updates { -# -# allowPreReleases = [ { groupId = "org.apache.pekko" } ] -# allow = [ { groupId = "org.apache.pekko" } ] -# ignore = [ -# { groupId = "org.apache.pekko", artifactId = "pekko-grpc-runtime_2.13" } -# { groupId = "org.apache.pekko", version = { contains = "-M" } } # like, 1.1.0-M1 -# ] -# - -# - pin = [ - # * org.scala-lang.modules:scala-xml_2.12:2.1.0 (early-semver) is selected over 1.2.0 - # +- com.github.sbt:sbt-native-packager:1.9.10 (sbtVersion=1.0, scalaVersion=2.12) (depends on 2.1.0) - # +- com.typesafe.play:twirl-api_2.12:1.5.1 (depends on 1.2.0) - { groupId = "com.github.sbt", artifactId = "sbt-native-packager", version = "1.9.9" } - - # * org.scala-lang.modules:scala-parser-combinators_2.13:2.1.0 (early-semver) is selected over 1.1.2 - # +- org.scalikejdbc:scalikejdbc-core_2.13:4.0.0 (depends on 2.1.0) - # +- com.typesafe:ssl-config-core_2.13:0.4.3 (depends on 1.1.2) - { groupId = "org.scalikejdbc", version = "3." } - - # Since most libraries will pull in slf4j-api v1 for a long time... - # so to spare ourselves dependency overrides & all the hassle with v2, let's stick to v1 as for now. - { groupId = "org.slf4j", version = "1." } - - # Akka changed its license from Apache 2.0 (opensource) to Business Source License 1.1 (commercial) in the - # 2.7.0 release. So, we want to stick to 2.6.x for now to avoid potential license-connected problems. - { groupId = "com.typesafe.akka", artifactId="akka-actor", version = "2.6." } - { groupId = "com.typesafe.akka", artifactId="akka-actor-typed", version = "2.6." } - { groupId = "com.typesafe.akka", artifactId="akka-stream", version = "2.6." } - { groupId = "com.typesafe.akka", artifactId="akka-persistence-typed", version = "2.6." } - { groupId = "com.typesafe.akka", artifactId="akka-actor-testkit-typed", version = "2.6." } - { groupId = "com.typesafe.akka", artifactId="akka-stream-testkit", version = "2.6." } - { groupId = "com.typesafe.akka", artifactId="akka-cluster-typed", version = "2.6." } - { groupId = "com.typesafe.akka", artifactId="akka-cluster-sharding-typed", version = "2.6." } - { groupId = "com.typesafe.akka", artifactId="akka-discovery", version = "2.6." } - { groupId = "com.typesafe.akka", artifactId="akka-slf4j", version = "2.6." } - { groupId = "com.typesafe.akka", artifactId="akka-serialization-jackson", version = "2.6." } - { groupId = "com.typesafe.akka", artifactId="akka-persistence-testkit", version = "2.6." } - { groupId = "com.typesafe.akka", artifactId="akka-persistence-query", version = "2.6." } - # Akka changed its license from Apache 2.0 (opensource) to Business Source License 1.1 (commercial) in the - # 1.3.0 release for akka-projection. So, we want to stick to 1.2.x for now to avoid - # potential license-connected problems. - { groupId = "com.lightbend.akka", artifactId="akka-projection-eventsourced", version = "1.2." } - { groupId = "com.lightbend.akka", artifactId="akka-projection-jdbc", version = "1.2." } - # Akka changed its license from Apache 2.0 (opensource) to Business Source License 1.1 (commercial) in the - # 2.2.0 release for akka-grpc. So, we want to stick to 2.1.x for now to avoid potential license-connected problems. - { groupId = "com.lightbend.akka.grpc", artifactId="akka-grpc-runtime", version = "2.1." } - # Akka changed its license from Apache 2.0 (opensource) to Business Source License 1.1 (commercial) in the - # 10.3.0 release for akka-http. So, we want to stick to 10.2.x for now to avoid potential license-connected problems. - { groupId = "com.typesafe.akka", artifactId="akka-http", version = "10.2." } - { groupId = "com.typesafe.akka", artifactId="akka-http-spray-json", version = "10.2." } - { groupId = "com.typesafe.akka", artifactId="akka-http2-support", version = "10.2." } - # Akka changed its license from Apache 2.0 (opensource) to Business Source License 1.1 (commercial) in the - # 1.2.0 release for akka-management - related modules. So, we want to stick to 1.1.x for now to avoid - # potential license-connected problems. - { groupId = "com.lightbend.akka.management", artifactId="akka-management", version = "1.1." } - { groupId = "com.lightbend.akka.management", artifactId="akka-management-cluster-http", version = "1.1." } - { groupId = "com.lightbend.akka.management", artifactId="akka-management-cluster-bootstrap", version = "1.1." } - { groupId = "com.lightbend.akka.discovery", artifactId="akka-discovery-kubernetes-api", version = "1.1." } - # Akka changed its license from Apache 2.0 (opensource) to Business Source License 1.1 (commercial) in the - # 5.2.0 release for akka-persistence-jdbc. So, we want to stick to 5.1.x for now to avoid - # potential license-connected problems. - { groupId = "com.lightbend.akka", artifactId="akka-persistence-jdbc", version = "5.1." } + allowPreReleases = [ { groupId = "org.apache.pekko" } ] + allow = [ { groupId = "org.apache.pekko" } ] + ignore = [ + { groupId = "org.apache.pekko", artifactId = "pekko-grpc-runtime_2.13" } + { groupId = "org.apache.pekko", version = { contains = "-M" } } # like, 1.1.0-M1 ] -# + } diff --git a/.scalafix.conf b/.scalafix.conf index 56349296..0fa3238b 100644 --- a/.scalafix.conf +++ b/.scalafix.conf @@ -9,8 +9,8 @@ OrganizeImports { groups = [ "java.", "scala.", - "akka.", + "org.apache.pekko.", "*", - "org.virtuslab.ash" + "org.virtuslab.psh" ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8d365cfe..63aa0375 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,16 +28,16 @@ and using it in another project. Make sure that `mavenLocal` is added to the res sbt publishM2 ``` -You can find two example applications that use Akka Serialization Helper: -- [akka-cluster-app](examples/akka-cluster-app) -- [akka-persistence-app](examples/akka-persistence-app) +You can find two example applications that use Pekko Serialization Helper: +- [pekko-cluster-app](examples/pekko-cluster-app) +- [pekko-persistence-app](examples/pekko-persistence-app) These apps can be used for basic runtime testing as well. First, go to the app's directory: ```shell -cd examples/akka-cluster-app +cd examples/pekko-cluster-app ``` or ```shell -cd examples/akka-persistence-app +cd examples/pekko-persistence-app ``` And follow instructions from their README files. @@ -68,7 +68,7 @@ Otherwise, incremental compilation might determine there is nothing to compile a ### Profiling -To profile akka-serialization-helper compiler plugin used in another project - follow instructions from https://www.lightbend.com/blog/profiling-jvm-applications +To profile pekko-serialization-helper compiler plugin used in another project - follow instructions from https://www.lightbend.com/blog/profiling-jvm-applications You might as well use any other profiler, but using https://github.com/jvm-profiling-tools/async-profiler with flamegraphs should be really effective and easy to achieve (+ no unexpected bugs / issues / errors). ### Code quality @@ -88,7 +88,7 @@ Releasing is done automatically by `sbt-ci-release` sbt plugin (read more on the ### Snapshots -The new `SNAPSHOT` version is automatically published by GitHub Actions to [Sonatype OSS Snapshot repo](https://oss.sonatype.org/content/repositories/snapshots/org/virtuslab/ash/) +The new `SNAPSHOT` version is automatically published by GitHub Actions to [Sonatype OSS Snapshot repo](https://oss.sonatype.org/content/repositories/snapshots/org/virtuslab/psh/) every time a new commit is pushed to `main`. To depend on the newest version with sbt, add the following setting: @@ -99,7 +99,7 @@ to both `build.sbt` **and** `project/build.sbt` (so that the sbt plugin added in ### Maven Central -Releases to [Maven Central](https://repo1.maven.org/maven2/org/virtuslab/ash/) are triggered by pushing a lightweight git tag with a version number. +Releases to [Maven Central](https://repo1.maven.org/maven2/org/virtuslab/psh/) are triggered by pushing a lightweight git tag with a version number. To publish version x.y.z, type in the console (on main branch): ```shell diff --git a/README.md b/README.md index 2dcd65df..c0a41515 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,37 @@ -# Akka Serialization Helper +# Pekko Serialization Helper -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.virtuslab.ash/annotation_2.13/badge.svg)](https://mvnrepository.com/artifact/org.virtuslab.ash) -[![GitHub Actions](https://github.com/VirtusLab/akka-serialization-helper/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/VirtusLab/akka-serialization-helper/actions) -[![License: MIT](https://img.shields.io/github/license/VirtusLab/akka-serialization-helper)](LICENSE) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.virtuslab.psh/annotation_2.13/badge.svg)](https://mvnrepository.com/artifact/org.virtuslab.psh) +[![GitHub Actions](https://github.com/VirtusLab/pekko-serialization-helper/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/VirtusLab/pekko-serialization-helper/actions) +[![License: MIT](https://img.shields.io/github/license/VirtusLab/pekko-serialization-helper)](LICENSE) -![logo-ash-horizontal](logo/ash/svg/logo-ash-horizontal.svg#gh-light-mode-only) -![logo-ash-horizontal](logo/ash/svg/logo-ash-horizontal-dark-bg.svg#gh-dark-mode-only) +![logo-psh-horizontal](logo/psh/svg/logo-psh-horizontal.svg#gh-light-mode-only) +![logo-psh-horizontal](logo/psh/svg/logo-psh-horizontal-dark-bg.svg#gh-dark-mode-only) -Serialization toolbox for Akka messages, events and persistent state that helps achieve compile-time guarantee on -serializability. There are some Akka serialization caveats this tool can help with: +Serialization toolbox for Pekko messages, events and persistent state that helps achieve compile-time guarantee on +serializability. There are some Pekko serialization caveats this tool can help with: 1. [Missing serialization binding](#missing-serialization-binding) 2. [Incompatibility of persistent data](#incompatibility-of-persistent-data) -3. [Jackson Akka Serializer](#jackson-akka-serializer) +3. [Jackson Pekko Serializer](#jackson-pekko-serializer) 4. [Missing Codec registration](#missing-codec-registration) - -# ⚠️ Check [pekko-serialization-helper](https://github.com/VirtusLab/pekko-serialization-helper) for Pekko ⚠️ - ## Install -Add the following line to `plugins.sbt` (take `Version` from the above Maven badge or [GitHub Releases](https://github.com/VirtusLab/akka-serialization-helper/releases)): +Add the following line to `plugins.sbt` (take `Version` from the above Maven badge or [GitHub Releases](https://github.com/VirtusLab/pekko-serialization-helper/releases)): ```scala -addSbtPlugin("org.virtuslab.ash" % "sbt-akka-serialization-helper" % Version) +addSbtPlugin("org.virtuslab.psh" % "sbt-pekko-serialization-helper" % Version) ``` and enable the sbt plugin in the target project: ```scala lazy val app = (project in file("app")) - .enablePlugins(AkkaSerializationHelperPlugin) + .enablePlugins(PekkoSerializationHelperPlugin) ``` ## Missing serialization binding -To serialize message, persistent state or event in Akka, Scala trait needs to be defined: +To serialize message, persistent state or event in Pekko, Scala trait needs to be defined: ```scala package org @@ -44,9 +41,9 @@ trait MySer Also, a serializer needs to be bound to this trait in a configuration file: ```scala -akka.actor { +pekko.actor { serializers { - jackson-json = "akka.serialization.jackson.JacksonJsonSerializer" + jackson-json = "org.apache.pekko.serialization.jackson.JacksonJsonSerializer" } serialization-bindings { "org.MySer" = jackson-json @@ -61,13 +58,13 @@ trait MySer case class MyMessage() // extends MySer ``` -`akka-serialization-helper` to the rescue! It detects messages, events and persistent states, and checks whether they +`pekko-serialization-helper` to the rescue! It detects messages, events and persistent states, and checks whether they extend the given base trait and report an error when they don't. This ensures that the specified serializer is -used by Akka and protects against an unintended fallback to -[Java serialization](https://doc.akka.io/docs/akka/current/serialization.html#java-serialization) or outright +used by Pekko and protects against an unintended fallback to +[Java serialization](https://pekko.apache.org/docs/pekko/current/serialization.html#java-serialization) or outright serialization failure. -To use, base trait should be annotated with [`@org.virtuslab.ash.SerializabilityTrait`](annotation/src/main/scala/org/virtuslab/ash/annotation/SerializabilityTrait.scala): +To use, base trait should be annotated with [`@org.virtuslab.psh.SerializabilityTrait`](annotation/src/main/scala/org/virtuslab/psh/annotation/SerializabilityTrait.scala): ```scala @SerializabilityTrait @@ -76,7 +73,7 @@ trait MySerializable It allows catching errors like these: ```scala -import akka.actor.typed.Behavior +import org.apache.pekko.actor.typed.Behavior object BehaviorTest { sealed trait Command //extends MySerializable @@ -86,33 +83,33 @@ object BehaviorTest { And results in a compile error, preventing non-runtime-safe code from being executed: ``` -test0.scala:7: error: org.random.project.BehaviorTest.Command is used as Akka message -but does not extend a trait annotated with org.virtuslab.ash.annotation.SerializabilityTrait. -Passing an object of a class that does NOT extend a trait annotated with SerializabilityTrait as a message may cause Akka to +test0.scala:7: error: org.random.project.BehaviorTest.Command is used as Pekko message +but does not extend a trait annotated with org.virtuslab.psh.annotation.SerializabilityTrait. +Passing an object of a class that does NOT extend a trait annotated with SerializabilityTrait as a message may cause Pekko to fall back to Java serialization during runtime. def method(msg: Command): Behavior[Command] = ??? ^ test0.scala:6: error: Make sure this type is itself annotated, or extends a type annotated -with @org.virtuslab.ash.annotation.SerializabilityTrait. +with @org.virtuslab.psh.annotation.SerializabilityTrait. sealed trait Command extends MySerializable ^ ``` -The compiler plugin only checks the classes in the sbt modules where `AkkaSerializationHelperPlugin` is explicitly enabled. +The compiler plugin only checks the classes in the sbt modules where `PekkoSerializationHelperPlugin` is explicitly enabled. It may happen that the base trait (like `MySerializable` in the example) lives in an sbt module like `core` where the plugin should **not** be enabled (e.g. for compilation performance reasons). -However, `MySerializable` needs to be annotated with `org.virtuslab.ash.SerializabilityTrait`. +However, `MySerializable` needs to be annotated with `org.virtuslab.psh.SerializabilityTrait`. In order to have access to the `SerializabilityTrait` annotation without enabling the entire suite of compiler plugins, -add `AkkaSerializationHelperPlugin.annotation` to `libraryDependencies`: +add `PekkoSerializationHelperPlugin.annotation` to `libraryDependencies`: ```scala -import org.virtuslab.ash.AkkaSerializationHelperPlugin +import org.virtuslab.psh.PekkoSerializationHelperPlugin lazy val core = (project in file("core")) - .settings(libraryDependencies += AkkaSerializationHelperPlugin.annotation) + .settings(libraryDependencies += PekkoSerializationHelperPlugin.annotation) ``` ## Incompatibility of persistent data @@ -123,10 +120,10 @@ A typical problem with a persistence is when the already persisted data is not c with the schemas defined in a new version of the application. To solve this, a mix of a compiler plugin and an sbt task can be used for dumping schema -of [akka-persistence](https://doc.akka.io/docs/akka/current/typed/persistence.html#example-and-core-api) to a +of [pekko-persistence](https://pekko.apache.org/docs/pekko/current/typed/persistence.html#example-and-core-api) to a file. It can be used for detecting accidental changes of events (journal) and states (snapshots) with a simple `diff`. -To dump persistence schema for each sbt module where `AkkaSerializationHelperPlugin` is enabled, run: +To dump persistence schema for each sbt module where `PekkoSerializationHelperPlugin` is enabled, run: ```shell sbt ashDumpPersistenceSchema @@ -168,9 +165,9 @@ version from the current commit. ![Easy to diff](docs/easy-to-diff.png) -## Jackson Akka Serializer +## Jackson Pekko Serializer -Using Jackson Serializer for akka-persistence is also one of the pitfalls and this +Using Jackson Serializer for pekko-persistence is also one of the pitfalls and this plugin provides an alternative by using a serializer that uses [Circe](https://circe.github.io/circe/). Dangerous code for Jackson: @@ -218,34 +215,34 @@ def receive = { } // message will be unhandled ``` -A [Circe-based](https://circe.github.io/circe/) Akka serializer can be used. It uses Circe codecs, derived using [Shapeless](https://circe.github.io/circe/codecs/auto-derivation.html), +A [Circe-based](https://circe.github.io/circe/) Pekko serializer can be used. It uses Circe codecs, derived using [Shapeless](https://circe.github.io/circe/codecs/auto-derivation.html), that are generated during compile time (so serializer won't crash during runtime as reflection-based serializers may do). -For a comparison of Circe with other serializers, read [Appendix A](#appendix-a-comparison-of-available-akka-serializers). +For a comparison of Circe with other serializers, read [Appendix A](#appendix-a-comparison-of-available-pekko-serializers). Note that it is **not** obligatory to use this serializer for the other features (serializability checker, persistence schema dump) to work. -They work as well with e.g. when [Jackson serializer](https://doc.akka.io/docs/akka/current/serialization-jackson.html) is selected. +They work as well with e.g. when [Jackson serializer](https://pekko.apache.org/docs/pekko/current/serialization-jackson.html) is selected. #### Usage Add the following to project dependencies: ```scala -import org.virtuslab.ash.AkkaSerializationHelperPlugin +import org.virtuslab.psh.PekkoSerializationHelperPlugin lazy val app = (project in file("app")) // ... - .settings(libraryDependencies += AkkaSerializationHelperPlugin.circeAkkaSerializer) + .settings(libraryDependencies += PekkoSerializationHelperPlugin.circePekkoSerializer) ``` -Note that enabling `AkkaSerializationHelperPlugin` does **not** add Circe serializer to the classpath automatically, +Note that enabling `PekkoSerializationHelperPlugin` does **not** add Circe serializer to the classpath automatically, as this sbt plugin can be used to improve safety of other serializers as well. -Create a custom serializer by extending `CirceAkkaSerializer` base class: +Create a custom serializer by extending `CircePekkoSerializer` base class: ```scala -import org.virtuslab.ash.circe.CirceAkkaSerializer +import org.virtuslab.psh.circe.CircePekkoSerializer class ExampleSerializer(actorSystem: ExtendedActorSystem) - extends CirceAkkaSerializer[MySerializable](actorSystem) { + extends CircePekkoSerializer[MySerializable](actorSystem) { override def identifier: Int = 41 @@ -256,24 +253,24 @@ class ExampleSerializer(actorSystem: ExtendedActorSystem) override lazy val packagePrefix = "org.project" } ``` -`CirceAkkaSerializer` can be configured to use Gzip compression when serializing payloads greater than defined size (default is without compression). +`CircePekkoSerializer` can be configured to use Gzip compression when serializing payloads greater than defined size (default is without compression). -See [default reference.conf file](circe-akka-serializer/src/main/resources/reference.conf) with comments for more details about `CirceAkkaSerializer` configuration. +See [default reference.conf file](circe-pekko-serializer/src/main/resources/reference.conf) with comments for more details about `CircePekkoSerializer` configuration. For more guidelines on how to use the serializer, -read [Akka documentation about serialization](https://doc.akka.io/docs/akka/current/serialization.html), -[`CirceAkkaSerializer`](circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/CirceAkkaSerializer.scala) Scaladoc +read [Pekko documentation about serialization](https://pekko.apache.org/docs/pekko/current/serialization.html), +[`CircePekkoSerializer`](circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/CircePekkoSerializer.scala) Scaladoc and look at the [examples](examples). ## Missing Codec registration If a codec is not registered, a runtime exception will occur. ```scala -import org.virtuslab.ash.circe.CirceAkkaSerializer -import org.virtuslab.ash.circe.Register +import org.virtuslab.psh.circe.CircePekkoSerializer +import org.virtuslab.psh.circe.Register class ExampleSerializer(actorSystem: ExtendedActorSystem) - extends CirceAkkaSerializer[MySerializable](actorSystem) { + extends CircePekkoSerializer[MySerializable](actorSystem) { // ... override lazy val codecs = Seq(Register[CommandOne]) // WHOOPS someone forgot to register CommandTwo... } @@ -284,34 +281,34 @@ for this class or its supertype and append result to `def codecs`. ``` To solve that, an annotation -[`@org.virtuslab.ash.Serializer`](annotation/src/main/scala/org/virtuslab/ash/annotation/Serializer.scala) +[`@org.virtuslab.psh.Serializer`](annotation/src/main/scala/org/virtuslab/psh/annotation/Serializer.scala) can be used. -During compilation, the plugin gathers all direct descendants of the class marked with [`@org.virtuslab.ash.SerializabilityTrait`](annotation/src/main/scala/org/virtuslab/ash/annotation/SerializabilityTrait.scala) -and checks the body of classes annotated with [`@org.virtuslab.ash.Serializer`](annotation/src/main/scala/org/virtuslab/ash/annotation/Serializer.scala) if they reference all these direct descendants in any way. +During compilation, the plugin gathers all direct descendants of the class marked with [`@org.virtuslab.psh.SerializabilityTrait`](annotation/src/main/scala/org/virtuslab/psh/annotation/SerializabilityTrait.scala) +and checks the body of classes annotated with [`@org.virtuslab.psh.Serializer`](annotation/src/main/scala/org/virtuslab/psh/annotation/Serializer.scala) if they reference all these direct descendants in any way. -In practice, this is used for checking a class extending [CirceAkkaSerializer](circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/CirceAkkaSerializer.scala), like this: +In practice, this is used for checking a class extending [CircePekkoSerializer](circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/CircePekkoSerializer.scala), like this: ```scala -import org.virtuslab.ash.circe.CirceAkkaSerializer -import org.virtuslab.ash.circe.Register +import org.virtuslab.psh.circe.CircePekkoSerializer +import org.virtuslab.psh.circe.Register @Serializer( classOf[MySerializable], typeRegexPattern = Register.REGISTRATION_REGEX) class ExampleSerializer(actorSystem: ExtendedActorSystem) - extends CirceAkkaSerializer[MySerializable](actorSystem) { + extends CircePekkoSerializer[MySerializable](actorSystem) { // ... override lazy val codecs = Seq(Register[CommandOne]) // WHOOPS someone forgot to register CommandTwo... // ... but Codec Registration Checker will throw a compilation error here: - // `No codec for `CommandOne` is registered in a class annotated with @org.virtuslab.ash.annotation.Serializer` + // `No codec for `CommandOne` is registered in a class annotated with @org.virtuslab.psh.annotation.Serializer` } ``` Note that as with Serializability Checker and Dump Persistence Schema, -this compiler plugin only runs in the sbt modules where `AkkaSerializationHelperPlugin` is explicitly enabled. +this compiler plugin only runs in the sbt modules where `PekkoSerializationHelperPlugin` is explicitly enabled. -For more information, read [`@Serializer` scaladoc](annotation/src/main/scala/org/virtuslab/ash/annotation/Serializer.scala). +For more information, read [`@Serializer` scaladoc](annotation/src/main/scala/org/virtuslab/psh/annotation/Serializer.scala). ## Additional configuration for compiler plugins @@ -335,39 +332,39 @@ Compile / ashDumpPersistenceSchemaCompilerPlugin / ashCompilerPluginVerbose := t Test / ashCompilerPluginEnable := false ``` -For full list of sbt keys, check [`org.virtuslab.ash.AkkaSerializationHelperKeys`](sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/AkkaSerializationHelperKeys.scala). +For full list of sbt keys, check [`org.virtuslab.psh.PekkoSerializationHelperKeys`](sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/PekkoSerializationHelperKeys.scala). ## Example applications -The simplest example is the akka-cluster application which uses Akka Serialization Helper: [akka-cluster-app](examples/akka-cluster-app). +The simplest example is the pekko-cluster application which uses Pekko Serialization Helper: [pekko-cluster-app](examples/pekko-cluster-app). -The second example is the akka-persistence application which shows usage of the Dump Persistence Schema Compiler Plugin: [akka-persistence-app](examples/akka-persistence-app). +The second example is the pekko-persistence application which shows usage of the Dump Persistence Schema Compiler Plugin: [pekko-persistence-app](examples/pekko-persistence-app). ## Step-by-step guide -See [full step-by-step guide](docs/GUIDE.md) on Akka Serialization Helper usage. +See [full step-by-step guide](docs/GUIDE.md) on Pekko Serialization Helper usage. ## Contributing Guide If you want to contribute to this project, see [Contributing Guide](CONTRIBUTING.md). -## Appendix A: Comparison of available Akka Serializers +## Appendix A: Comparison of available Pekko Serializers | Serializer | [Jackson](https://github.com/FasterXML/jackson) | [Circe](https://circe.github.io/circe/) | [Protobuf v3](https://developers.google.com/protocol-buffers) | [Avro](https://avro.apache.org/docs/current/) | [Borer](https://github.com/sirthias/borer) | [Kryo](https://github.com/EsotericSoftware/kryo) | |:-----------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------| | Data formats | JSON or [CBOR](https://cbor.io) | JSON | JSON or custom binary | JSON or custom binary | JSON or CBOR | custom binary | | Scala support | very poor, even with [jackson-module-scala](https://github.com/FasterXML/jackson-module-scala):
  • poor support for Scala objects, without configuration (without adding ScalaObjectDeserializerModule usage) creates new instances of singleton types (`Foo$`), breaking pattern matching
  • lacks support of basic scala types like `Unit`
  • without explicit annotation doesn't work with generics extending `AnyVal`
| perfect out of the box | perfect with [ScalaPB](https://scalapb.github.io) | perfect with [Avro4s](https://github.com/sksamuel/avro4s) | perfect out of the box | perfect out of the box | -| Akka support | [akka-serialization-jackson](https://doc.akka.io/docs/akka/current/serialization-jackson.html) | [serializer provided by this project](#jackson-akka-serializer) | used by [akka-remote](https://doc.akka.io/docs/akka/current/serialization.html) internally | requires custom serializer | requires custom serializer | [akka-kryo](https://github.com/altoo-ag/akka-kryo-serialization) | -| Compile-time mechanics | nothing happens in compile time; everything based on runtime reflection | derives codecs via [Shapeless](https://circe.github.io/circe/codecs/auto-derivation.html) | with ScalaPB, generates Scala classes based on \*.proto files | with Avro4s, derives Avro schemas using [Magnolia](https://github.com/softwaremill/magnolia) | derives codecs **without** Magnolia | with akka-kryo, optionally derives codecs in compile time, but otherwise uses reflection in runtime | +| Pekko support | [pekko-serialization-jackson](https://pekko.apache.org/docs/pekko/current/serialization-jackson.html) | [serializer provided by this project](#jackson-pekko-serializer) | used by [pekko-remote](https://pekko.apache.org/docs/pekko/current/serialization.html) internally | requires custom serializer | requires custom serializer | [pekko-kryo](https://github.com/altoo-ag/pekko-kryo-serialization) | +| Compile-time mechanics | nothing happens in compile time; everything based on runtime reflection | derives codecs via [Shapeless](https://circe.github.io/circe/codecs/auto-derivation.html) | with ScalaPB, generates Scala classes based on \*.proto files | with Avro4s, derives Avro schemas using [Magnolia](https://github.com/softwaremill/magnolia) | derives codecs **without** Magnolia | with pekko-kryo, optionally derives codecs in compile time, but otherwise uses reflection in runtime | | Runtime safety | none, uses reflection | encoders and decoders are created during compilation | \*.proto files are validated before compilation | Avro schema is created during compilation | encoders and decoders are created during compilation | depends on whether codecs were derived in compile time (then standard for Scala code), or not (than none) | | Boilerplate | a lot:
  • ADTs requires amount of annotation equal to or exceeding the actual type definitions
  • requires explicit serializers and deserializers in certain cases (e.g. enums)
| every top-level sealed trait must be registered manually - but see [Codec Registration Checker](#missing-codec-registration) | in case of custom types, a second layer of models is needed | sometimes requires annotations | every top-level sealed trait must be registered manually; every transitively included class must have an explicitly defined codec | every top-level sealed trait must be registered manually | -| Schema evolution |
  • removing field
  • adding optional field
with [`JacksonMigration`](https://doc.akka.io/docs/akka/current/serialization-jackson.html#schema-evolution):
  • adding mandatory field
  • renaming field
  • renaming class
  • support of forward versioning for rolling updates
|
  • adding optional field
  • removing optional field
  • adding required field with default value
  • removing required field
  • renaming field
  • reordering fields
  • transforming data before deserialization
|
  • adding optional field
  • removing optional field
  • adding required field with default value
  • removing required field
  • renaming field
  • reordering fields
  • changing between compatible types
|
  • reordering fields
  • renaming fields
  • adding optional field
  • adding required field with default value
  • removing field with default value
|
  • renaming fields
  • transforming data before deserialization
|
  • adding field
  • removing field
  • renaming field
  • renaming class
| +| Schema evolution |
  • removing field
  • adding optional field
with [`JacksonMigration`](https://pekko.apache.org/docs/pekko/current/serialization-jackson.html#schema-evolution):
  • adding mandatory field
  • renaming field
  • renaming class
  • support of forward versioning for rolling updates
|
  • adding optional field
  • removing optional field
  • adding required field with default value
  • removing required field
  • renaming field
  • reordering fields
  • transforming data before deserialization
|
  • adding optional field
  • removing optional field
  • adding required field with default value
  • removing required field
  • renaming field
  • reordering fields
  • changing between compatible types
|
  • reordering fields
  • renaming fields
  • adding optional field
  • adding required field with default value
  • removing field with default value
|
  • renaming fields
  • transforming data before deserialization
|
  • adding field
  • removing field
  • renaming field
  • renaming class
| ## Appendix B: what happens with serialization of Messages / Events / States that do not extend a base trait bound to a serializer -In runtime, if given Message/Event/State class does not extend a base trait bound to a serializer, the following problems will occur (depending on Akka version and settings): +In runtime, if given Message/Event/State class does not extend a base trait bound to a serializer, the following problems will occur (depending on Pekko version and settings): -**Note** - the default setting for Akka 2.5 is `akka.actor.allow-java-serialization=on`, whereas `akka.actor.allow-java-serialization=off` is the default setting for Akka 2.6 +**Note** - the default setting for Pekko 2.5 is `pekko.actor.allow-java-serialization=on`, whereas `pekko.actor.allow-java-serialization=off` is the default setting for Pekko 2.6 -| Akka version | `akka.actor.allow-java-serialization=off` | `akka.actor.allow-java-serialization=on` | +| Pekko version | `pekko.actor.allow-java-serialization=off` | `pekko.actor.allow-java-serialization=on` | |---------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| 2.5 | Serialization will fail with logs like below:

```[WARN] [...] Outgoing message attempted to use Java Serialization even though `akka.actor.allow-java-serialization = off` was set! Message type was: [class sample.cluster.transformation.BackendRegistration$]```

```[ERROR] [...] Failed to serialize remote message [class akka.actor.ActorSelectionMessage] using serializer [class akka.remote.serialization.MessageContainerSerializer]. Transient association error (association remains live)```

```akka.remote.MessageSerializer$SerializationException: Failed to serialize remote message```
```[class akka.actor.ActorSelectionMessage] using serializer [class akka.remote.serialization.MessageContainerSerializer].```
```at akka.remote.MessageSerializer$.serialize(MessageSerializer.scala:67)```
```at akka.remote.EndpointWriter.$anonfun$serializeMessage$1(Endpoint.scala:1021)```
```at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)```
```at akka.remote.EndpointWriter.serializeMessage(Endpoint.scala:1021)```
```at akka.remote.EndpointWriter.writeSend(Endpoint.scala:887)```
```at akka.remote.EndpointWriter$$anonfun$4.applyOrElse(Endpoint.scala:859)```
```at akka.actor.Actor.aroundReceive(Actor.scala:539)```
```at akka.actor.Actor.aroundReceive$(Actor.scala:537)```
```at akka.remote.EndpointActor.aroundReceive(Endpoint.scala:536)```
```at akka.actor.ActorCell.receiveMessage(ActorCell.scala:612)```
```at akka.actor.ActorCell.invoke(ActorCell.scala:581)```
```at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:268)```
```at akka.dispatch.Mailbox.run(Mailbox.scala:229)```
```at akka.dispatch.Mailbox.exec(Mailbox.scala:241)```
```at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)```
```at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)```
```at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)```
```at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)```
```Caused by: akka.serialization.DisabledJavaSerializer$JavaSerializationException: Attempted to serialize message using Java serialization while `akka.actor.allow-java-serialization` was disabled. Check WARNING logs for more details.``` | Serialization succeeds - but using Java serialization (which is not a good choice for production). Warning log like below will appear on the startup:

```[WARN] [...] Using the default Java serializer for class [sample.cluster.transformation.TransformationResult] which is not recommended because of performance implications. Use another serializer or disable this warning using the setting 'akka.actor.warn-about-java-serializer-usage'``` | -| 2.6 | Serialization will fail with logs like below:

```[WARN] [...] - Outgoing message attempted to use Java Serialization even though`akka.actor.allow-java-serialization = off` was set! Message type was: [class sample.cluster.transformation.Worker$TransformText]```

```[ERROR] [...] - Failed to serialize message [sample.cluster.transformation.Worker$TransformText]. akka.serialization.DisabledJavaSerializer$JavaSerializationException: Attempted to serialize message using Java serialization while `akka.actor.allow-java-serialization` was disabled. Check WARNING logs for more details``` | Serialization succeeds - but using Java serialization (which is not a good choice for production). Warning log like below will appear on the startup:

```[WARN] [...] Using the default Java serializer for class [sample.cluster.transformation.TransformationResult] which is not recommended because of performance implications. Use another serializer or disable this warning using the setting 'akka.actor.warn-about-java-serializer-usage'``` | +| 2.5 | Serialization will fail with logs like below:

```[WARN] [...] Outgoing message attempted to use Java Serialization even though `pekko.actor.allow-java-serialization = off` was set! Message type was: [class sample.cluster.transformation.BackendRegistration$]```

```[ERROR] [...] Failed to serialize remote message [class pekko.actor.ActorSelectionMessage] using serializer [class pekko.remote.serialization.MessageContainerSerializer]. Transient association error (association remains live)```

```pekko.remote.MessageSerializer$SerializationException: Failed to serialize remote message```
```[class pekko.actor.ActorSelectionMessage] using serializer [class pekko.remote.serialization.MessageContainerSerializer].```
```at org.apache.pekko.remote.MessageSerializer$.serialize(MessageSerializer.scala:67)```
```at org.apache.pekko.remote.EndpointWriter.$anonfun$serializeMessage$1(Endpoint.scala:1021)```
```at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)```
```at org.apache.pekko.remote.EndpointWriter.serializeMessage(Endpoint.scala:1021)```
```at org.apache.pekko.remote.EndpointWriter.writeSend(Endpoint.scala:887)```
```at org.apache.pekko.remote.EndpointWriter$$anonfun$4.applyOrElse(Endpoint.scala:859)```
```at org.apache.pekko.actor.Actor.aroundReceive(Actor.scala:539)```
```at org.apache.pekko.actor.Actor.aroundReceive$(Actor.scala:537)```
```at org.apache.pekko.remote.EndpointActor.aroundReceive(Endpoint.scala:536)```
```at org.apache.pekko.actor.ActorCell.receiveMessage(ActorCell.scala:612)```
```at org.apache.pekko.actor.ActorCell.invoke(ActorCell.scala:581)```
```at org.apache.pekko.dispatch.Mailbox.processMailbox(Mailbox.scala:268)```
```at org.apache.pekko.dispatch.Mailbox.run(Mailbox.scala:229)```
```at org.apache.pekko.dispatch.Mailbox.exec(Mailbox.scala:241)```
```at org.apache.pekko.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)```
```at org.apache.pekko.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)```
```at org.apache.pekko.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)```
```at org.apache.pekko.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)```
```Caused by: pekko.serialization.DisabledJavaSerializer$JavaSerializationException: Attempted to serialize message using Java serialization while `pekko.actor.allow-java-serialization` was disabled. Check WARNING logs for more details.``` | Serialization succeeds - but using Java serialization (which is not a good choice for production). Warning log like below will appear on the startup:

```[WARN] [...] Using the default Java serializer for class [sample.cluster.transformation.TransformationResult] which is not recommended because of performance implications. Use another serializer or disable this warning using the setting 'pekko.actor.warn-about-java-serializer-usage'``` | +| 2.6 | Serialization will fail with logs like below:

```[WARN] [...] - Outgoing message attempted to use Java Serialization even though`pekko.actor.allow-java-serialization = off` was set! Message type was: [class sample.cluster.transformation.Worker$TransformText]```

```[ERROR] [...] - Failed to serialize message [sample.cluster.transformation.Worker$TransformText]. pekko.serialization.DisabledJavaSerializer$JavaSerializationException: Attempted to serialize message using Java serialization while `pekko.actor.allow-java-serialization` was disabled. Check WARNING logs for more details``` | Serialization succeeds - but using Java serialization (which is not a good choice for production). Warning log like below will appear on the startup:

```[WARN] [...] Using the default Java serializer for class [sample.cluster.transformation.TransformationResult] which is not recommended because of performance implications. Use another serializer or disable this warning using the setting 'pekko.actor.warn-about-java-serializer-usage'``` | diff --git a/annotation/src/main/scala/org/virtuslab/ash/annotation/SerializabilityTrait.scala b/annotation/src/main/scala/org/virtuslab/psh/annotation/SerializabilityTrait.scala similarity index 72% rename from annotation/src/main/scala/org/virtuslab/ash/annotation/SerializabilityTrait.scala rename to annotation/src/main/scala/org/virtuslab/psh/annotation/SerializabilityTrait.scala index f980d318..ab1e89ff 100644 --- a/annotation/src/main/scala/org/virtuslab/ash/annotation/SerializabilityTrait.scala +++ b/annotation/src/main/scala/org/virtuslab/psh/annotation/SerializabilityTrait.scala @@ -1,7 +1,7 @@ -package org.virtuslab.ash.annotation +package org.virtuslab.psh.annotation /** - * This annotation is used as a marker for Codec Registration Checker and Serializability Checker. Annotate Akka serialization + * This annotation is used as a marker for Codec Registration Checker and Serializability Checker. Annotate Pekko serialization * marker-trait, and the rest is done by compiler plugins. * * {{{ diff --git a/annotation/src/main/scala/org/virtuslab/ash/annotation/Serializer.scala b/annotation/src/main/scala/org/virtuslab/psh/annotation/Serializer.scala similarity index 89% rename from annotation/src/main/scala/org/virtuslab/ash/annotation/Serializer.scala rename to annotation/src/main/scala/org/virtuslab/psh/annotation/Serializer.scala index f34c43ad..60ba4748 100644 --- a/annotation/src/main/scala/org/virtuslab/ash/annotation/Serializer.scala +++ b/annotation/src/main/scala/org/virtuslab/psh/annotation/Serializer.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.annotation +package org.virtuslab.psh.annotation import scala.annotation.nowarn @@ -16,7 +16,7 @@ import scala.annotation.nowarn * For example, if we want to serialize `trait Command`, then type `Registration[Command]` is relevant, while `Option[Command]` * is not. * - * If you are using `circe-akka-serializer`, set `typeRegexPattern` to `Register.REGISTRATION_REGEX` + * If you are using `circe-pekko-serializer`, set `typeRegexPattern` to `Register.REGISTRATION_REGEX` * * @param clazz * class literal of serializability marker trait, for example `classOf[MySerializable]` diff --git a/build.sbt b/build.sbt index e50958e0..5282843e 100644 --- a/build.sbt +++ b/build.sbt @@ -14,11 +14,11 @@ lazy val testAgainstScalaVersions = targetScalaVersions ++ List("2.12.16", "2.12.17", "2.12.18") ThisBuild / scalaVersion := targetScalaVersions.head -ThisBuild / organization := "org.virtuslab.ash" +ThisBuild / organization := "org.virtuslab.psh" ThisBuild / organizationName := "VirtusLab" ThisBuild / versionScheme := Some("early-semver") -ThisBuild / homepage := Some(url("https://github.com/VirtusLab/akka-serialization-helper")) -ThisBuild / licenses := List("MIT License" -> url("https://github.com/VirtusLab/akka-serialization-helper/blob/main/LICENSE")) +ThisBuild / homepage := Some(url("https://github.com/VirtusLab/pekko-serialization-helper")) +ThisBuild / licenses := List("MIT License" -> url("https://github.com/VirtusLab/pekko-serialization-helper/blob/main/LICENSE")) ThisBuild / developers := List( Developer("MarconZet", "Marcin Złakowski", "mzlakowski@virtuslab.com", url("https://github.com/MarconZet")), Developer("LukaszKontowski", "Łukasz Kontowski", "lkontowski@virtuslab.com", url("https://github.com/LukaszKontowski")), @@ -81,15 +81,15 @@ publish / skip := true lazy val scalaVersionAxis = settingKey[Option[String]]("Project scala version") -lazy val circeAkkaSerializer = (projectMatrix in file("circe-akka-serializer")) - .settings(name := "circe-akka-serializer") +lazy val circePekkoSerializer = (projectMatrix in file("circe-pekko-serializer")) + .settings(name := "circe-pekko-serializer") .settings(commonSettings) .settings(crossScalaVersions := testAgainstScalaVersions) .settings(libraryDependencies ++= Seq( - akkaActor % Provided, - akkaActorTyped % Provided, - akkaTestKitTyped % Test, - akkaStream % Provided, + pekkoActor % Provided, + pekkoActorTyped % Provided, + pekkoTestKitTyped % Test, + pekkoStream % Provided, circeCore, circeParser, circeGeneric, @@ -147,13 +147,13 @@ lazy val serializabilityCheckerCompilerPlugin = (projectMatrix in file("serializ .getOrElse(Seq.empty) }, libraryDependencies ++= Seq( - akkaActor % Test, - akkaActorTyped % Test, - akkaPersistenceTyped % Test, - akkaProjections % Test, + pekkoActor % Test, + pekkoActorTyped % Test, + pekkoPersistenceTyped % Test, + pekkoProjections % Test, betterFiles % Test, - akkaGrpc % Test, - akkaHttpCors % Test)) + pekkoGrpc % Test, + pekkoHttpCors % Test)) .dependsOn(annotation) .jvmPlatform(scalaVersions = targetScalaVersions) @@ -172,12 +172,12 @@ lazy val codecRegistrationCheckerCompilerPlugin = (projectMatrix in file("codec- .getOrElse(Seq.empty) }, libraryDependencies += betterFiles % Test) - .dependsOn(annotation, circeAkkaSerializer % Test) + .dependsOn(annotation, circePekkoSerializer % Test) .jvmPlatform(scalaVersions = targetScalaVersions) -lazy val sbtAkkaSerializationHelper = (project in file("sbt-akka-serialization-helper")) +lazy val sbtPekkoSerializationHelper = (project in file("sbt-pekko-serialization-helper")) .enablePlugins(SbtPlugin) - .settings(name := "sbt-akka-serialization-helper") + .settings(name := "sbt-pekko-serialization-helper") .settings(commonSettings) .settings( pluginCrossBuild / sbtVersion := "1.2.8", @@ -196,8 +196,8 @@ lazy val sbtAkkaSerializationHelper = (project in file("sbt-akka-serialization-h // both head and tail.head must be published because they are separate projects, one for scala 2.13, one for 2.12 (annotation.projectRefs.head / publishLocal).value (annotation.projectRefs.tail.head / publishLocal).value - (circeAkkaSerializer.projectRefs.head / publishLocal).value - (circeAkkaSerializer.projectRefs.tail.head / publishLocal).value + (circePekkoSerializer.projectRefs.head / publishLocal).value + (circePekkoSerializer.projectRefs.tail.head / publishLocal).value (codecRegistrationCheckerCompilerPlugin.projectRefs.head / publishLocal).value (codecRegistrationCheckerCompilerPlugin.projectRefs.tail.head / publishLocal).value (dumpPersistenceSchemaCompilerPlugin.projectRefs.head / publishLocal).value @@ -222,6 +222,6 @@ lazy val dumpPersistenceSchemaCompilerPlugin = (projectMatrix in file("dump-pers } .getOrElse(Seq.empty) }, - libraryDependencies ++= Seq(sprayJson, betterFiles, akkaActorTyped % Test, akkaPersistenceTyped % Test)) + libraryDependencies ++= Seq(sprayJson, betterFiles, pekkoActorTyped % Test, pekkoPersistenceTyped % Test)) .settings(assemblySettings: _*) .jvmPlatform(scalaVersions = targetScalaVersions) diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/CirceSerializabilityTrait.scala b/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/CirceSerializabilityTrait.scala deleted file mode 100644 index 81a275aa..00000000 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/CirceSerializabilityTrait.scala +++ /dev/null @@ -1,3 +0,0 @@ -package org.virtuslab.ash.circe.data - -trait CirceSerializabilityTrait diff --git a/circe-akka-serializer/src/main/resources/reference.conf b/circe-pekko-serializer/src/main/resources/reference.conf similarity index 96% rename from circe-akka-serializer/src/main/resources/reference.conf rename to circe-pekko-serializer/src/main/resources/reference.conf index 3c270427..4d96a524 100644 --- a/circe-akka-serializer/src/main/resources/reference.conf +++ b/circe-pekko-serializer/src/main/resources/reference.conf @@ -1,6 +1,6 @@ # Default configuration -org.virtuslab.ash { +org.virtuslab.psh { circe { # enables debug logging verbose-debug-logging = off @@ -28,7 +28,7 @@ org.virtuslab.ash { # (there might be some rare corner-cases where codec-registration-checker-compiler-plugin # is not able to find missing codec registrations - but only if sbt incremental compilation is used). # - # Beware: enabling this check will cause a negative impact on Circe Akka Serializer performance. + # Beware: enabling this check will cause a negative impact on Circe Pekko Serializer performance. enable-missing-codecs-check = false } } diff --git a/circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/CirceAkkaSerializer.scala b/circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/CircePekkoSerializer.scala similarity index 90% rename from circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/CirceAkkaSerializer.scala rename to circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/CircePekkoSerializer.scala index 69000c11..5311219d 100644 --- a/circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/CirceAkkaSerializer.scala +++ b/circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/CircePekkoSerializer.scala @@ -1,13 +1,13 @@ -package org.virtuslab.ash.circe +package org.virtuslab.psh.circe import java.io.NotSerializableException import java.nio.charset.StandardCharsets.UTF_8 import scala.reflect.ClassTag -import akka.actor.ExtendedActorSystem -import akka.event.Logging -import akka.serialization.SerializerWithStringManifest +import org.apache.pekko.actor.ExtendedActorSystem +import org.apache.pekko.event.Logging +import org.apache.pekko.serialization.SerializerWithStringManifest import io.circe._ import io.circe.jawn.JawnParser @@ -16,11 +16,11 @@ import io.circe.jawn.JawnParser * An abstract class that is extended to create a custom serializer. * * After creating your subclass, don't forget to add your serializer and base trait to `application.conf` (for more info - * [[https://doc.akka.io/docs/akka/current/serialization.html]]) + * [[https://pekko.apache.org/docs/pekko/current/serialization.html]]) * * Example subclass: * {{{ - * class CustomSerializer(actorSystem: ExtendedActorSystem) extends CirceAkkaSerializer[MySerializable](actorSystem) { + * class CustomSerializer(actorSystem: ExtendedActorSystem) extends CircePekkoSerializer[MySerializable](actorSystem) { * * implicit private val serializabilityCodec: Codec[MySerializable] = genericCodec * @@ -38,17 +38,17 @@ import io.circe.jawn.JawnParser * } * }}} * @param system - * ExtendedActorSystem that is provided by Akka + * ExtendedActorSystem that is provided by Pekko * @tparam Ser * base trait that is used to mark serialization */ -abstract class CirceAkkaSerializer[Ser <: AnyRef: ClassTag](system: ExtendedActorSystem) +abstract class CircePekkoSerializer[Ser <: AnyRef: ClassTag](system: ExtendedActorSystem) extends SerializerWithStringManifest with CirceTraitCodec[Ser] - with AkkaCodecs { + with PekkoCodecs { private lazy val log = Logging(system, getClass) - private lazy val conf = system.settings.config.getConfig("org.virtuslab.ash.circe") + private lazy val conf = system.settings.config.getConfig("org.virtuslab.psh.circe") private lazy val isDebugEnabled = conf.getBoolean("verbose-debug-logging") && log.isDebugEnabled override lazy val shouldDoMissingCodecsCheck: Boolean = conf.getBoolean("enable-missing-codecs-check") private lazy val compressionAlgorithm: Compression.Algorithm = conf.getString("compression.algorithm") match { @@ -99,7 +99,7 @@ abstract class CirceAkkaSerializer[Ser <: AnyRef: ClassTag](system: ExtendedActo /** * The intended usage of this method is to provide any form of support for generic classes. * - * Because of type erasure, it's impossible to [[org.virtuslab.ash.circe.Register]] one generic class two times with different + * Because of type erasure, it's impossible to [[org.virtuslab.psh.circe.Register]] one generic class two times with different * type parameters. * * The trick for combating type erasure is to register generic class only once with type parameter being its upper bound, and diff --git a/circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/CirceTraitCodec.scala b/circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/CirceTraitCodec.scala similarity index 95% rename from circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/CirceTraitCodec.scala rename to circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/CirceTraitCodec.scala index 64b9c2bc..e17a99da 100644 --- a/circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/CirceTraitCodec.scala +++ b/circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/CirceTraitCodec.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe +package org.virtuslab.psh.circe import java.io.NotSerializableException import java.util.NoSuchElementException @@ -15,15 +15,15 @@ import org.reflections8.Reflections trait CirceTraitCodec[Ser <: AnyRef] extends Codec[Ser] { /** - * Sequence that must contain [[org.virtuslab.ash.circe.Registration]] for all direct subclasses of Ser. + * Sequence that must contain [[org.virtuslab.psh.circe.Registration]] for all direct subclasses of Ser. * - * Each `Registration` is created using [[org.virtuslab.ash.circe.Register]]s [[org.virtuslab.ash.circe.Register#apply]] + * Each `Registration` is created using [[org.virtuslab.psh.circe.Register]]s [[org.virtuslab.psh.circe.Register#apply]] * method. * * To check if all needed classes are registered, use Codec Registration Checker. * * @see - * [[org.virtuslab.ash.circe.Register]][[org.virtuslab.ash.circe.Register#apply]] for more information about type derivation + * [[org.virtuslab.psh.circe.Register]][[org.virtuslab.psh.circe.Register#apply]] for more information about type derivation */ val codecs: Seq[Registration[_ <: Ser]] diff --git a/circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/Compression.scala b/circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/Compression.scala similarity index 98% rename from circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/Compression.scala rename to circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/Compression.scala index ff738813..e846ac38 100644 --- a/circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/Compression.scala +++ b/circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/Compression.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe +package org.virtuslab.psh.circe import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream diff --git a/circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/AkkaCodecs.scala b/circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/PekkoCodecs.scala similarity index 69% rename from circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/AkkaCodecs.scala rename to circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/PekkoCodecs.scala index 3444af5e..bb327b10 100644 --- a/circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/AkkaCodecs.scala +++ b/circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/PekkoCodecs.scala @@ -1,23 +1,23 @@ -package org.virtuslab.ash.circe +package org.virtuslab.psh.circe // scalafix:off -import akka.actor.{ActorSystem => ClassicActorSystem} -import akka.actor.typed.ActorRef -import akka.actor.typed.ActorRefResolver -import akka.actor.typed.ActorSystem -import akka.serialization.Serialization -import akka.stream.SinkRef -import akka.stream.SourceRef -import akka.stream.StreamRefResolver +import org.apache.pekko.actor.{ActorSystem => ClassicActorSystem} +import org.apache.pekko.actor.typed.ActorRef +import org.apache.pekko.actor.typed.ActorRefResolver +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.serialization.Serialization +import org.apache.pekko.stream.SinkRef +import org.apache.pekko.stream.SourceRef +import org.apache.pekko.stream.StreamRefResolver import io.circe.Codec import io.circe.Decoder import io.circe.Encoder //scalafix:on /** - * Default codecs for serializing some of Akka types + * Default codecs for serializing some of Pekko types */ -trait AkkaCodecs { +trait PekkoCodecs { private def serializationSystem: ClassicActorSystem = Serialization.getCurrentTransportInformation().system implicit def actorRefCodec[T](implicit system: ClassicActorSystem = serializationSystem): Codec[ActorRef[T]] = { @@ -42,4 +42,4 @@ trait AkkaCodecs { } } -object AkkaCodecs extends AkkaCodecs +object PekkoCodecs extends PekkoCodecs diff --git a/circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/Register.scala b/circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/Register.scala similarity index 89% rename from circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/Register.scala rename to circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/Register.scala index 02361f44..4ac163b0 100644 --- a/circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/Register.scala +++ b/circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/Register.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe +package org.virtuslab.psh.circe import scala.reflect.macros.blackbox import scala.reflect.runtime.{universe => ru} @@ -26,7 +26,7 @@ object Register { * @tparam T * Type for which implicits will be looked for * @return - * [[org.virtuslab.ash.circe.Registration]] + * [[org.virtuslab.psh.circe.Registration]] */ def apply[T: ru.TypeTag: Encoder: Decoder]: Registration[T] = Registration[T](implicitly[ru.TypeTag[T]], implicitly[Encoder[T]], implicitly[Decoder[T]]) @@ -35,7 +35,7 @@ object Register { def REGISTRATION_REGEX: String = macro regexImpl /** - * `circeRegex` is the preferred typeRegexPattern for Circe Akka Serializer usage. It contains leading and trailing `.*` - so + * `circeRegex` is the preferred typeRegexPattern for Circe Pekko Serializer usage. It contains leading and trailing `.*` - so * that it matches both single Registration and multiple Registrations in a collection. It is used by the * codec-registration-checker-compiler-plugin to collect properly registered codecs. * @@ -44,7 +44,7 @@ object Register { * `Option[Register[User_Defined_Type]]` is in the AST and codec-registration-checker-compiler-plugin would still treat it as * proper registration. However, such situations have not been encountered in real usages. */ - private val circeRegex = """.*org\.virtuslab\.ash\.circe\.Registration\[.*\].*""" + private val circeRegex = """.*org\.virtuslab\.psh\.circe\.Registration\[.*\].*""" def regexImpl(c: blackbox.Context): c.Expr[String] = { import c.universe._ diff --git a/circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/Registration.scala b/circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/Registration.scala similarity index 94% rename from circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/Registration.scala rename to circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/Registration.scala index cffb343b..9cd55b48 100644 --- a/circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/Registration.scala +++ b/circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/Registration.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe +package org.virtuslab.psh.circe import scala.reflect.runtime.{universe => ru} diff --git a/circe-akka-serializer/src/test/resources/application.conf b/circe-pekko-serializer/src/test/resources/application.conf similarity index 82% rename from circe-akka-serializer/src/test/resources/application.conf rename to circe-pekko-serializer/src/test/resources/application.conf index 6764ba38..67f1c3e3 100644 --- a/circe-akka-serializer/src/test/resources/application.conf +++ b/circe-pekko-serializer/src/test/resources/application.conf @@ -1,17 +1,17 @@ -akka.actor { +pekko.actor { serializers { - circe-json = "org.virtuslab.ash.circe.CustomSerializer" + circe-json = "org.virtuslab.psh.circe.CustomSerializer" } serialization-bindings { - "org.virtuslab.ash.circe.data.CirceSerializabilityTrait" = circe-json + "org.virtuslab.psh.circe.data.CirceSerializabilityTrait" = circe-json } enable-additional-serialization-bindings = on allow-java-serialization = off } # Uncomment chosen settings below to enable debug logging OR change compression settings -#akka.loglevel = "DEBUG" -org.virtuslab.ash { +#pekko.loglevel = "DEBUG" +org.virtuslab.psh { circe { # enables debug logging #verbose-debug-logging = on diff --git a/circe-akka-serializer/src/test/resources/more_than_1KiB_object_file.txt b/circe-pekko-serializer/src/test/resources/more_than_1KiB_object_file.txt similarity index 100% rename from circe-akka-serializer/src/test/resources/more_than_1KiB_object_file.txt rename to circe-pekko-serializer/src/test/resources/more_than_1KiB_object_file.txt diff --git a/circe-akka-serializer/src/test/resources/simplelogger.properties b/circe-pekko-serializer/src/test/resources/simplelogger.properties similarity index 100% rename from circe-akka-serializer/src/test/resources/simplelogger.properties rename to circe-pekko-serializer/src/test/resources/simplelogger.properties diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/CirceAkkaSerializerSpec.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/CircePekkoSerializerSpec.scala similarity index 80% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/CirceAkkaSerializerSpec.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/CircePekkoSerializerSpec.scala index 29766aba..94609066 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/CirceAkkaSerializerSpec.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/CircePekkoSerializerSpec.scala @@ -1,23 +1,23 @@ -package org.virtuslab.ash.circe +package org.virtuslab.psh.circe import scala.io.Source -import akka.actor.testkit.typed.scaladsl.ActorTestKit -import akka.actor.testkit.typed.scaladsl.SerializationTestKit -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.testkit.typed.scaladsl.ActorTestKit +import org.apache.pekko.actor.testkit.typed.scaladsl.SerializationTestKit +import org.apache.pekko.actor.typed.ActorSystem import com.typesafe.config.ConfigFactory import com.typesafe.config.ConfigValueFactory import org.scalatest.matchers.should import org.scalatest.wordspec.AnyWordSpecLike -import org.virtuslab.ash.circe.Compression.isCompressedWithGzip -import org.virtuslab.ash.circe.MigrationAndCompressionTestKit.SerializationData -import org.virtuslab.ash.circe.data.Tree.Node._ -import org.virtuslab.ash.circe.data._ +import org.virtuslab.psh.circe.Compression.isCompressedWithGzip +import org.virtuslab.psh.circe.MigrationAndCompressionTestKit.SerializationData +import org.virtuslab.psh.circe.data.Tree.Node._ +import org.virtuslab.psh.circe.data._ -class CirceAkkaSerializerSpec extends AnyWordSpecLike with should.Matchers { - "CirceAkkaSerializer" should { +class CircePekkoSerializerSpec extends AnyWordSpecLike with should.Matchers { + "CircePekkoSerializer" should { val config = ConfigFactory.load() val testKit: ActorTestKit = ActorTestKit(config) val system: ActorSystem[Nothing] = testKit.system @@ -25,7 +25,7 @@ class CirceAkkaSerializerSpec extends AnyWordSpecLike with should.Matchers { val migrationTestKit = new MigrationAndCompressionTestKit(system) "serialize standard data" in { - import org.virtuslab.ash.circe.data.StdData._ + import org.virtuslab.psh.circe.data.StdData._ val one = One(2, 2.0f, "av") val two = Two(Wrapper(4), "abc") serializationTestKit.verifySerialization(one) @@ -33,13 +33,13 @@ class CirceAkkaSerializerSpec extends AnyWordSpecLike with should.Matchers { } "serialize ADT" in { - import org.virtuslab.ash.circe.data.Tree._ + import org.virtuslab.psh.circe.data.Tree._ val tree: Tree = TwoChildren(TwoChildren(OneChild(Leaf()), Leaf()), OneChild(OneChild(Leaf()))) serializationTestKit.verifySerialization(tree) } "support types with configuration codecs" in { - import org.virtuslab.ash.circe.data.StdMigration._ + import org.virtuslab.psh.circe.data.StdMigration._ val fieldWithDefault = FieldWithDefault() serializationTestKit.verifySerialization(fieldWithDefault) val fieldRename = FieldRename(5) @@ -47,31 +47,31 @@ class CirceAkkaSerializerSpec extends AnyWordSpecLike with should.Matchers { } "support schema migration by configuration" in { - import org.virtuslab.ash.circe.data.StdMigration._ + import org.virtuslab.psh.circe.data.StdMigration._ val dataDefaultA: SerializationData = - ("""{"FieldWithDefault":{"a":5}}""".getBytes, 42352, """org.virtuslab.ash.circe.data.StdMigration""") + ("""{"FieldWithDefault":{"a":5}}""".getBytes, 42352, """org.virtuslab.psh.circe.data.StdMigration""") val dataDefaultB: SerializationData = - ("""{"FieldWithDefault":{}}""".getBytes, 42352, """org.virtuslab.ash.circe.data.StdMigration""") + ("""{"FieldWithDefault":{}}""".getBytes, 42352, """org.virtuslab.psh.circe.data.StdMigration""") val defaultRes = List(dataDefaultA, dataDefaultB).map(migrationTestKit.deserialize(_).asInstanceOf[FieldWithDefault]) defaultRes.head shouldEqual defaultRes.tail.head val dataRenameA: SerializationData = - ("""{"FieldRename":{"original":10}}""".getBytes, 42352, """org.virtuslab.ash.circe.data.StdMigration""") + ("""{"FieldRename":{"original":10}}""".getBytes, 42352, """org.virtuslab.psh.circe.data.StdMigration""") val res = migrationTestKit.deserialize(dataRenameA).asInstanceOf[FieldRename] res.migrated shouldEqual 10 val constructorRename: SerializationData = - ("""{"OldName":{"a":20}}""".getBytes, 42352, """org.virtuslab.ash.circe.data.StdMigration""") + ("""{"OldName":{"a":20}}""".getBytes, 42352, """org.virtuslab.psh.circe.data.StdMigration""") migrationTestKit.deserialize(constructorRename) shouldEqual ConstructorRename(20) } "allow for changing name of top level sealed trait" in { - val oldName = ("""{"A":{"a":"abc"}}""".getBytes, 42352, """org.virtuslab.ash.data.OldName""") + val oldName = ("""{"A":{"a":"abc"}}""".getBytes, 42352, """org.virtuslab.psh.data.OldName""") migrationTestKit.deserialize(oldName) shouldEqual TopTraitMigration.A("abc") } @@ -90,7 +90,7 @@ class CirceAkkaSerializerSpec extends AnyWordSpecLike with should.Matchers { // setup for testing compression feature - with compression enabled val compressionConfig = - config.withValue("org.virtuslab.ash.circe.compression.algorithm", ConfigValueFactory.fromAnyRef("gzip")) + config.withValue("org.virtuslab.psh.circe.compression.algorithm", ConfigValueFactory.fromAnyRef("gzip")) val compressionTestKit: ActorTestKit = ActorTestKit(compressionConfig) val compressionActorSystem: ActorSystem[Nothing] = compressionTestKit.system val compressionSerializationTestKit = new MigrationAndCompressionTestKit(compressionActorSystem) @@ -116,7 +116,7 @@ class CirceAkkaSerializerSpec extends AnyWordSpecLike with should.Matchers { isCompressedWithGzip(smallObjectSerialized._1) shouldBe false } - // below example uses standard `config` from circe-akka-serializer/src/test/resources/application.conf + // below example uses standard `config` from circe-pekko-serializer/src/test/resources/application.conf // which is available in the migrationTestKit object - so compression is disabled "not compress payload when compression is configuration is set to 'off'" in { val largeObjectSerialized = migrationTestKit.serialize(largeSerializableObject) diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/CirceTraitCodecSpec.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/CirceTraitCodecSpec.scala similarity index 82% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/CirceTraitCodecSpec.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/CirceTraitCodecSpec.scala index d12ca29a..ef0b29d1 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/CirceTraitCodecSpec.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/CirceTraitCodecSpec.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe +package org.virtuslab.psh.circe import io.circe.Codec import io.circe.jawn.decode @@ -6,12 +6,12 @@ import io.circe.syntax._ import org.scalatest.matchers.should import org.scalatest.wordspec.AnyWordSpecLike -import org.virtuslab.ash.circe.data.NotSealedTrait +import org.virtuslab.psh.circe.data.NotSealedTrait class CirceTraitCodecSpec extends AnyWordSpecLike with should.Matchers { "CirceTraitCodec" should { "serialize/deserialize" in { - import org.virtuslab.ash.circe.data.NotSealedTrait._ + import org.virtuslab.psh.circe.data.NotSealedTrait._ implicit val notSealedTraitCodec: Codec[NotSealedTrait] = CustomTraitCodec Seq[NotSealedTrait](One(), Two()).foreach { x => diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/CustomSerializer.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/CustomSerializer.scala similarity index 68% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/CustomSerializer.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/CustomSerializer.scala index 35d00019..c936b0fd 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/CustomSerializer.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/CustomSerializer.scala @@ -1,16 +1,16 @@ -package org.virtuslab.ash.circe +package org.virtuslab.psh.circe import scala.reflect.runtime.{universe => ru} -import akka.actor.ExtendedActorSystem +import org.apache.pekko.actor.ExtendedActorSystem import io.circe._ import io.circe.generic.auto._ -import org.virtuslab.ash.circe.data.ModifiedCodec._ -import org.virtuslab.ash.circe.data._ +import org.virtuslab.psh.circe.data.ModifiedCodec._ +import org.virtuslab.psh.circe.data._ -class CustomSerializer(actorSystem: ExtendedActorSystem) extends CirceAkkaSerializer[CirceSerializabilityTrait](actorSystem) { +class CustomSerializer(actorSystem: ExtendedActorSystem) extends CircePekkoSerializer[CirceSerializabilityTrait](actorSystem) { implicit val serializabilityCodec: Codec[CirceSerializabilityTrait] = genericCodec @@ -26,7 +26,7 @@ class CustomSerializer(actorSystem: ExtendedActorSystem) extends CirceAkkaSerial Register[GenericClass[CirceSerializabilityTrait, CirceSerializabilityTrait]]) override lazy val manifestMigrations: Seq[(String, Class[TopTraitMigration])] = - Seq("org.virtuslab.ash.data.OldName" -> classOf[TopTraitMigration]) + Seq("org.virtuslab.psh.data.OldName" -> classOf[TopTraitMigration]) - override lazy val packagePrefix = "org.virtuslab.ash" + override lazy val packagePrefix = "org.virtuslab.psh" } diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/CustomTraitCodec.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/CustomTraitCodec.scala similarity index 71% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/CustomTraitCodec.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/CustomTraitCodec.scala index 6ae64e5a..25e17ab1 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/CustomTraitCodec.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/CustomTraitCodec.scala @@ -1,16 +1,16 @@ -package org.virtuslab.ash.circe +package org.virtuslab.psh.circe import scala.reflect.ClassTag import io.circe.generic.auto._ -import org.virtuslab.ash.circe.data.NotSealedTrait -import org.virtuslab.ash.circe.data.NotSealedTrait._ +import org.virtuslab.psh.circe.data.NotSealedTrait +import org.virtuslab.psh.circe.data.NotSealedTrait._ object CustomTraitCodec extends CirceTraitCodec[NotSealedTrait] { override lazy val codecs: Seq[Registration[_ <: NotSealedTrait]] = Seq(Register[One], Register[Two]) override lazy val manifestMigrations: Seq[(String, Class[_])] = Nil - override lazy val packagePrefix: String = "org.virtuslab.ash" + override lazy val packagePrefix: String = "org.virtuslab.psh" override lazy val classTagEvidence: ClassTag[NotSealedTrait] = implicitly[ClassTag[NotSealedTrait]] override lazy val errorCallback: String => Unit = x => throw new RuntimeException(x) } diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/MigrationAndCompressionTestKit.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/MigrationAndCompressionTestKit.scala similarity index 76% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/MigrationAndCompressionTestKit.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/MigrationAndCompressionTestKit.scala index 97287952..9ac768c9 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/MigrationAndCompressionTestKit.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/MigrationAndCompressionTestKit.scala @@ -1,11 +1,11 @@ -package org.virtuslab.ash.circe +package org.virtuslab.psh.circe -import akka.actor.typed.ActorSystem -import akka.actor.typed.scaladsl.adapter._ -import akka.serialization.SerializationExtension -import akka.serialization.Serializers +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.scaladsl.adapter._ +import org.apache.pekko.serialization.SerializationExtension +import org.apache.pekko.serialization.Serializers -import org.virtuslab.ash.circe.MigrationAndCompressionTestKit.SerializationData +import org.virtuslab.psh.circe.MigrationAndCompressionTestKit.SerializationData /** * Utilities to test serialization migration and compression. To perform round trip: diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/RegisterSpec.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/RegisterSpec.scala similarity index 93% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/RegisterSpec.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/RegisterSpec.scala index f5a6a2df..5015d009 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/RegisterSpec.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/RegisterSpec.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe +package org.virtuslab.psh.circe import scala.reflect.runtime.universe.typeOf diff --git a/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/CirceSerializabilityTrait.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/CirceSerializabilityTrait.scala new file mode 100644 index 00000000..0de84eb5 --- /dev/null +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/CirceSerializabilityTrait.scala @@ -0,0 +1,3 @@ +package org.virtuslab.psh.circe.data + +trait CirceSerializabilityTrait diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/GenericClass.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/GenericClass.scala similarity index 78% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/GenericClass.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/GenericClass.scala index 8803fa16..63a81b83 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/GenericClass.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/GenericClass.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe.data +package org.virtuslab.psh.circe.data case class GenericClass[A <: CirceSerializabilityTrait, B <: CirceSerializabilityTrait](a: A, b: B) extends CirceSerializabilityTrait diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/ModifiedCodec.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/ModifiedCodec.scala similarity index 93% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/ModifiedCodec.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/ModifiedCodec.scala index 49a9da7f..92e98b5c 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/ModifiedCodec.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/ModifiedCodec.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe.data +package org.virtuslab.psh.circe.data import io.circe.Decoder import io.circe.Encoder diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/NotSealedTrait.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/NotSealedTrait.scala similarity index 78% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/NotSealedTrait.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/NotSealedTrait.scala index 9e8b070a..e4b1d0d3 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/NotSealedTrait.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/NotSealedTrait.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe.data +package org.virtuslab.psh.circe.data trait NotSealedTrait diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/StdData.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/StdData.scala similarity index 85% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/StdData.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/StdData.scala index 2cfbf3c4..73047e5d 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/StdData.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/StdData.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe.data +package org.virtuslab.psh.circe.data sealed trait StdData extends CirceSerializabilityTrait object StdData { diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/StdMigration.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/StdMigration.scala similarity index 94% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/StdMigration.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/StdMigration.scala index a1c80f62..ced261aa 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/StdMigration.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/StdMigration.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe.data +package org.virtuslab.psh.circe.data import io.circe.generic.extras.Configuration import io.circe.generic.extras.ConfiguredJsonCodec diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/TopTraitMigration.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/TopTraitMigration.scala similarity index 80% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/TopTraitMigration.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/TopTraitMigration.scala index a1f3e81a..7722544e 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/TopTraitMigration.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/TopTraitMigration.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe.data +package org.virtuslab.psh.circe.data sealed trait TopTraitMigration extends CirceSerializabilityTrait diff --git a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/Tree.scala b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/Tree.scala similarity index 88% rename from circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/Tree.scala rename to circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/Tree.scala index e7039548..9246e326 100644 --- a/circe-akka-serializer/src/test/scala/org/virtuslab/ash/circe/data/Tree.scala +++ b/circe-pekko-serializer/src/test/scala/org/virtuslab/psh/circe/data/Tree.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.circe.data +package org.virtuslab.psh.circe.data sealed trait Tree extends CirceSerializabilityTrait object Tree { diff --git a/codec-registration-checker-compiler-plugin/src/main/resources/scalac-plugin.xml b/codec-registration-checker-compiler-plugin/src/main/resources/scalac-plugin.xml index 656b2bcd..1521cbde 100644 --- a/codec-registration-checker-compiler-plugin/src/main/resources/scalac-plugin.xml +++ b/codec-registration-checker-compiler-plugin/src/main/resources/scalac-plugin.xml @@ -1,4 +1,4 @@ codec-registration-checker-plugin - org.virtuslab.ash.CodecRegistrationCheckerCompilerPlugin + org.virtuslab.psh.CodecRegistrationCheckerCompilerPlugin diff --git a/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/CacheFileInteractionMode.scala b/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/CacheFileInteractionMode.scala similarity index 87% rename from codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/CacheFileInteractionMode.scala rename to codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/CacheFileInteractionMode.scala index 3e5ab1fd..0b1cbe6e 100644 --- a/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/CacheFileInteractionMode.scala +++ b/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/CacheFileInteractionMode.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh sealed trait CacheFileInteractionMode diff --git a/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/ClassSweepCompilerPluginComponent.scala b/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/ClassSweepCompilerPluginComponent.scala similarity index 92% rename from codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/ClassSweepCompilerPluginComponent.scala rename to codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/ClassSweepCompilerPluginComponent.scala index aa582833..a0a6239c 100644 --- a/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/ClassSweepCompilerPluginComponent.scala +++ b/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/ClassSweepCompilerPluginComponent.scala @@ -1,12 +1,12 @@ -package org.virtuslab.ash +package org.virtuslab.psh import scala.collection.mutable import scala.tools.nsc.Global import scala.tools.nsc.Phase import scala.tools.nsc.plugins.PluginComponent -import org.virtuslab.ash.CodecRegistrationCheckerCompilerPlugin.classSweepPhaseName -import org.virtuslab.ash.CodecRegistrationCheckerCompilerPlugin.serializabilityTraitType +import org.virtuslab.psh.CodecRegistrationCheckerCompilerPlugin.classSweepPhaseName +import org.virtuslab.psh.CodecRegistrationCheckerCompilerPlugin.serializabilityTraitType class ClassSweepCompilerPluginComponent(options: CodecRegistrationCheckerOptions, override val global: Global) extends PluginComponent { diff --git a/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/CodecRegistrationCheckerCompilerPlugin.scala b/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/CodecRegistrationCheckerCompilerPlugin.scala similarity index 93% rename from codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/CodecRegistrationCheckerCompilerPlugin.scala rename to codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/CodecRegistrationCheckerCompilerPlugin.scala index 728a0be5..1f62db85 100644 --- a/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/CodecRegistrationCheckerCompilerPlugin.scala +++ b/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/CodecRegistrationCheckerCompilerPlugin.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh import java.io.File import java.io.FileNotFoundException @@ -12,8 +12,8 @@ import scala.tools.nsc.Global import scala.tools.nsc.plugins.Plugin import scala.tools.nsc.plugins.PluginComponent -import org.virtuslab.ash.CodecRegistrationCheckerCompilerPlugin.directClassDescendantsCacheFileName -import org.virtuslab.ash.CodecRegistrationCheckerCompilerPlugin.disableFlag +import org.virtuslab.psh.CodecRegistrationCheckerCompilerPlugin.directClassDescendantsCacheFileName +import org.virtuslab.psh.CodecRegistrationCheckerCompilerPlugin.disableFlag class CodecRegistrationCheckerCompilerPlugin(override val global: Global) extends Plugin { override val name: String = "codec-registration-checker-plugin" @@ -95,8 +95,8 @@ object CodecRegistrationCheckerCompilerPlugin { val classSweepPhaseName = "codec-registration-class-sweep" val serializerCheckPhaseName = "codec-registration-serializer-check" val directClassDescendantsCacheFileName = "codec-registration-checker-cache.csv" - val serializabilityTraitType = "org.virtuslab.ash.annotation.SerializabilityTrait" - val serializerType = "org.virtuslab.ash.annotation.Serializer" + val serializabilityTraitType = "org.virtuslab.psh.annotation.SerializabilityTrait" + val serializerType = "org.virtuslab.psh.annotation.Serializer" val disableFlag = "--disable" diff --git a/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/CodecRegistrationCheckerOptions.scala b/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/CodecRegistrationCheckerOptions.scala similarity index 98% rename from codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/CodecRegistrationCheckerOptions.scala rename to codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/CodecRegistrationCheckerOptions.scala index 1cad1129..aebb6392 100644 --- a/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/CodecRegistrationCheckerOptions.scala +++ b/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/CodecRegistrationCheckerOptions.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh import java.io.File diff --git a/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/SerializerCheckCompilerPluginComponent.scala b/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/SerializerCheckCompilerPluginComponent.scala similarity index 94% rename from codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/SerializerCheckCompilerPluginComponent.scala rename to codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/SerializerCheckCompilerPluginComponent.scala index 6573083d..b10e262e 100644 --- a/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/SerializerCheckCompilerPluginComponent.scala +++ b/codec-registration-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/SerializerCheckCompilerPluginComponent.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh import java.io.RandomAccessFile import java.nio.ByteBuffer @@ -14,10 +14,10 @@ import scala.tools.nsc.Global import scala.tools.nsc.Phase import scala.tools.nsc.plugins.PluginComponent -import org.virtuslab.ash.CodecRegistrationCheckerCompilerPlugin.classSweepPhaseName -import org.virtuslab.ash.CodecRegistrationCheckerCompilerPlugin.serializabilityTraitType -import org.virtuslab.ash.CodecRegistrationCheckerCompilerPlugin.serializerCheckPhaseName -import org.virtuslab.ash.CodecRegistrationCheckerCompilerPlugin.serializerType +import org.virtuslab.psh.CodecRegistrationCheckerCompilerPlugin.classSweepPhaseName +import org.virtuslab.psh.CodecRegistrationCheckerCompilerPlugin.serializabilityTraitType +import org.virtuslab.psh.CodecRegistrationCheckerCompilerPlugin.serializerCheckPhaseName +import org.virtuslab.psh.CodecRegistrationCheckerCompilerPlugin.serializerType class SerializerCheckCompilerPluginComponent( classSweep: ClassSweepCompilerPluginComponent, @@ -79,7 +79,7 @@ class SerializerCheckCompilerPluginComponent( /* * fqcn is the FQCN of top-level serializable type (trait / class) used by currently checked Serializer. * typeRegexPattern is the `typeRegexPattern` defined for this Serializer. - * See org.virtuslab.ash.annotation.Serializer javadoc for more details. + * See org.virtuslab.psh.annotation.Serializer javadoc for more details. */ val (fqcn, typeRegexPattern) = serializerAnnotation.args match { case List(clazzTree, regexTree) => @@ -113,11 +113,11 @@ class SerializerCheckCompilerPluginComponent( * properly registered for serialization / deserialization. detectedTypes are later used to create * a sequence of FQCNs for types, which have proper codecs registration. * - * ( In case of Circe Akka Serializer usage - these are types that contain - * `org.virtuslab.ash.circe.Register.apply` invocation - i.e. detectedTypes are in fact types + * ( In case of Circe Pekko Serializer usage - these are types that contain + * `org.virtuslab.psh.circe.Register.apply` invocation - i.e. detectedTypes are in fact types * that have been registered for serialization with encoder and decoder. * Example string representation of an element from `detectedTypes` could be: - * org.virtuslab.ash.circe.Registration[org.example.SerializableImplementation] ) + * org.virtuslab.psh.circe.Registration[org.example.SerializableImplementation] ) */ val detectedTypes = { try { @@ -161,7 +161,7 @@ class SerializerCheckCompilerPluginComponent( serializerImplDef.pos, s"""No codecs for ${actuallyMissingFullyQualifiedClassNames.mkString( ", ")} are registered in class annotated with @$serializerType. - |This will lead to a missing codec for Akka serialization in the runtime. + |This will lead to a missing codec for Pekko serialization in the runtime. |Current type regex pattern: $typeRegexPattern""".stripMargin) } else { interactWithTheCacheFile(RemoveOutdatedTypesFromFile, possibleMissingFullyQualifiedClassNames) diff --git a/codec-registration-checker-compiler-plugin/src/test/resources/data/SerializableTrait.scala b/codec-registration-checker-compiler-plugin/src/test/resources/data/SerializableTrait.scala index f3b66dd9..60fc4117 100644 --- a/codec-registration-checker-compiler-plugin/src/test/resources/data/SerializableTrait.scala +++ b/codec-registration-checker-compiler-plugin/src/test/resources/data/SerializableTrait.scala @@ -1,6 +1,6 @@ package org.random.project -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.virtuslab.psh.annotation.SerializabilityTrait @SerializabilityTrait trait SerializableTrait diff --git a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/CorrectSerializer.scala b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/CorrectSerializer.scala index e7ee2435..e383f588 100644 --- a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/CorrectSerializer.scala +++ b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/CorrectSerializer.scala @@ -1,6 +1,6 @@ package org.random.project -import org.virtuslab.ash.annotation.Serializer +import org.virtuslab.psh.annotation.Serializer @Serializer(classOf[SerializableTrait], ".*Option.*") class CorrectSerializer { diff --git a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/EmptySerializer.scala b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/EmptySerializer.scala index eeee18ae..74db45ac 100644 --- a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/EmptySerializer.scala +++ b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/EmptySerializer.scala @@ -1,6 +1,6 @@ package org.random.project -import org.virtuslab.ash.annotation.Serializer +import org.virtuslab.psh.annotation.Serializer @Serializer(classOf[SerializableTrait], ".*Option.*") class EmptySerializer { diff --git a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/IncompleteSerializer.scala b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/IncompleteSerializer.scala index 50c69abe..605d9a04 100644 --- a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/IncompleteSerializer.scala +++ b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/IncompleteSerializer.scala @@ -1,6 +1,6 @@ package org.random.project -import org.virtuslab.ash.annotation.Serializer +import org.virtuslab.psh.annotation.Serializer @Serializer(classOf[SerializableTrait]) class IncompleteSerializer { diff --git a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/IncompleteSerializerTwo.scala b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/IncompleteSerializerTwo.scala index 21c95a48..65b5413a 100644 --- a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/IncompleteSerializerTwo.scala +++ b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/IncompleteSerializerTwo.scala @@ -1,6 +1,6 @@ package org.random.project -import org.virtuslab.ash.annotation.Serializer +import org.virtuslab.psh.annotation.Serializer @Serializer(classOf[SerializableTrait]) class IncompleteSerializerTwo { diff --git a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/InvalidAnnotationSerializer.scala b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/InvalidAnnotationSerializer.scala index c23ec539..b2d8f1bc 100644 --- a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/InvalidAnnotationSerializer.scala +++ b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/InvalidAnnotationSerializer.scala @@ -1,6 +1,6 @@ package org.random.project -import org.virtuslab.ash.annotation.Serializer +import org.virtuslab.psh.annotation.Serializer @Serializer(InvalidAnnotationSerializer.clazz) class InvalidAnnotationSerializer {} diff --git a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/InvalidClassSerializer.scala b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/InvalidClassSerializer.scala index 7da33de7..cf58fb9a 100644 --- a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/InvalidClassSerializer.scala +++ b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/InvalidClassSerializer.scala @@ -1,6 +1,6 @@ package org.random.project -import org.virtuslab.ash.annotation.Serializer +import org.virtuslab.psh.annotation.Serializer @Serializer(classOf[StdData]) class InvalidClassSerializer {} diff --git a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/MacroRegexSerializer.scala b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/MacroRegexSerializer.scala index dbd05e90..f17d8cc6 100644 --- a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/MacroRegexSerializer.scala +++ b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/MacroRegexSerializer.scala @@ -1,6 +1,6 @@ package org.random.project -import org.virtuslab.ash.annotation.Serializer +import org.virtuslab.psh.annotation.Serializer -@Serializer(classOf[SerializableTrait], org.virtuslab.ash.circe.Register.REGISTRATION_REGEX) +@Serializer(classOf[SerializableTrait], org.virtuslab.psh.circe.Register.REGISTRATION_REGEX) class MacroRegexSerializer diff --git a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/ObjectSerializer.scala b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/ObjectSerializer.scala index 14119a1a..7ab9b4cb 100644 --- a/codec-registration-checker-compiler-plugin/src/test/resources/serializers/ObjectSerializer.scala +++ b/codec-registration-checker-compiler-plugin/src/test/resources/serializers/ObjectSerializer.scala @@ -1,6 +1,6 @@ package org.random.project -import org.virtuslab.ash.annotation.Serializer +import org.virtuslab.psh.annotation.Serializer @Serializer(classOf[SerializableTrait], ".*Option.*") object ObjectSerializer diff --git a/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/Data.scala b/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/Data.scala deleted file mode 100644 index 686b28f5..00000000 --- a/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/Data.scala +++ /dev/null @@ -1,3 +0,0 @@ -package org.virtuslab.ash - -trait Data diff --git a/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/CodecRegistrationCheckerCompiler.scala b/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/CodecRegistrationCheckerCompiler.scala similarity index 98% rename from codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/CodecRegistrationCheckerCompiler.scala rename to codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/CodecRegistrationCheckerCompiler.scala index ad13e244..19fa6d7d 100644 --- a/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/CodecRegistrationCheckerCompiler.scala +++ b/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/CodecRegistrationCheckerCompiler.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh import java.io.BufferedReader import java.io.PrintWriter diff --git a/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/CodecRegistrationCheckerCompilerPluginSpec.scala b/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/CodecRegistrationCheckerCompilerPluginSpec.scala similarity index 96% rename from codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/CodecRegistrationCheckerCompilerPluginSpec.scala rename to codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/CodecRegistrationCheckerCompilerPluginSpec.scala index b807ab31..51d588c2 100644 --- a/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/CodecRegistrationCheckerCompilerPluginSpec.scala +++ b/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/CodecRegistrationCheckerCompilerPluginSpec.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh import better.files.Dsl.SymbolicOperations import better.files.File @@ -165,10 +165,10 @@ class CodecRegistrationCheckerCompilerPluginSpec extends AnyWordSpecLike with sh "compile without error when there were outdated type names in the cache file before start and remove them from the file" in { File.usingTemporaryDirectory() { directory => val cacheFile = directory / CodecRegistrationCheckerCompilerPlugin.directClassDescendantsCacheFileName - // hydra.test.TestAkkaSerializable and hydra.test.ConcreteClasses do not exist in the code anymore (outdated types) + // hydra.test.TestPekkoSerializable and hydra.test.ConcreteClasses do not exist in the code anymore (outdated types) cacheFile.write( - "org.random.project.SerializableTrait,hydra.test.TestAkkaSerializable\n" + - "hydra.test.TestAkkaSerializable,hydra.test.ConcreteClasses") + "org.random.project.SerializableTrait,hydra.test.TestPekkoSerializable\n" + + "hydra.test.TestPekkoSerializable,hydra.test.ConcreteClasses") val out = CodecRegistrationCheckerCompiler.compileCode( CORRECT_SERIALIZER_CODE :: dataSourceCode, List(s"${directory.toJava.getAbsolutePath}")) diff --git a/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/Data.scala b/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/Data.scala new file mode 100644 index 00000000..9de4e3a1 --- /dev/null +++ b/codec-registration-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/Data.scala @@ -0,0 +1,3 @@ +package org.virtuslab.psh + +trait Data diff --git a/docs/GUIDE.md b/docs/GUIDE.md index 358660ba..ad532fd7 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -1,40 +1,40 @@ -# Step-by-step guide for Akka Serialization Helper usage -This document is a guide on how to use Akka Serialization Helper in your project. If you want to get a more general view of this toolbox, see [README](../README.md). Moreover, it could be a good idea to see the [akka-cluster-app](../examples/akka-cluster-app) and [akka-persistence-app](../examples/akka-persistence-app) first as code examples of basic Akka Serialization Helper usage. +# Step-by-step guide for Pekko Serialization Helper usage +This document is a guide on how to use Pekko Serialization Helper in your project. If you want to get a more general view of this toolbox, see [README](../README.md). Moreover, it could be a good idea to see the [pekko-cluster-app](../examples/pekko-cluster-app) and [pekko-persistence-app](../examples/pekko-persistence-app) first as code examples of basic Pekko Serialization Helper usage. -Akka Serialization Helper (ASH) has two major parts: -1. Circe Akka Serializer +Pekko Serialization Helper (ASH) has two major parts: +1. Circe Pekko Serializer 2. Compiler Plugins You might use ASH in a few ways: - Use both parts of the toolbox (best option — gives you all benefits of the toolbox and maximum runtime safety) -- Use Circe Akka Serializer but without enabling Compiler Plugins -- Use Compiler Plugins but not Circe Akka Serializer (if you need to stick to your current Serializer) +- Use Circe Pekko Serializer but without enabling Compiler Plugins +- Use Compiler Plugins but not Circe Pekko Serializer (if you need to stick to your current Serializer) -To use ASH (whole or a selected part), you need to first add Akka Serialization Helper in the `project/plugins.sbt` file and enable it in `build.sbt` — this is the standard way of using the toolbox. Just follow the [installation instructions from README](https://github.com/VirtusLab/akka-serialization-helper#install). +To use ASH (whole or a selected part), you need to first add Pekko Serialization Helper in the `project/plugins.sbt` file and enable it in `build.sbt` — this is the standard way of using the toolbox. Just follow the [installation instructions from README](https://github.com/VirtusLab/pekko-serialization-helper#install). -Alternatively — if you want to use only Circe Akka Serializer (without enabling compiler plugins) — you can add it as a standard library dependency (find new available versions under [releases](https://github.com/VirtusLab/akka-serialization-helper/releases)): +Alternatively — if you want to use only Circe Pekko Serializer (without enabling compiler plugins) — you can add it as a standard library dependency (find new available versions under [releases](https://github.com/VirtusLab/pekko-serialization-helper/releases)): ```sbt -libraryDependencies += "org.virtuslab.ash" %% "circe-akka-serializer" % "Version" +libraryDependencies += "org.virtuslab.psh" %% "circe-pekko-serializer" % "Version" ``` ## How to use: -1. [Circe Akka Serializer](#circe-akka-serializer) +1. [Circe Pekko Serializer](#circe-pekko-serializer) 2. [Annotations](#annotations) 3. [Serializability Checker Compiler Plugin](#serializability-checker-compiler-plugin) 4. [Codec Registration Checker Compiler Plugin](#codec-registration-checker-compiler-plugin) 5. [Dump Persistence Schema Compiler Plugin](#dump-persistence-schema-compiler-plugin) 6. [ashDumpPersistenceSchema sbt task](#ashdumppersistenceschema-sbt-task) -### Circe Akka Serializer -[CirceAkkaSerializer](../circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/CirceAkkaSerializer.scala) is the main abstract class that you have to extend to use as the Serializer in your application. Before extending it, read Scaladoc comments available in the following files: -- [CirceAkkaSerializer.scala](../circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/CirceAkkaSerializer.scala) (the most important starting point / main abstraction) -- [CirceTraitCodec.scala](../circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/CirceTraitCodec.scala) (a trait that is extended by CirceAkkaSerializer and has some important `val`s that should be overridden in your code) -- [Register.scala](../circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/Register.scala) (helper object with `apply` method that needs to be used in order to register Codecs for serializable type) -- [Registration.scala](../circe-akka-serializer/src/main/scala/org/virtuslab/ash/circe/Registration.scala) (`Register.apply` method returns an instance of type Registration. Registration instances are later used as registered codecs) +### Circe Pekko Serializer +[CircePekkoSerializer](../circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/CircePekkoSerializer.scala) is the main abstract class that you have to extend to use as the Serializer in your application. Before extending it, read Scaladoc comments available in the following files: +- [CircePekkoSerializer.scala](../circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/CircePekkoSerializer.scala) (the most important starting point / main abstraction) +- [CirceTraitCodec.scala](../circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/CirceTraitCodec.scala) (a trait that is extended by CircePekkoSerializer and has some important `val`s that should be overridden in your code) +- [Register.scala](../circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/Register.scala) (helper object with `apply` method that needs to be used in order to register Codecs for serializable type) +- [Registration.scala](../circe-pekko-serializer/src/main/scala/org/virtuslab/psh/circe/Registration.scala) (`Register.apply` method returns an instance of type Registration. Registration instances are later used as registered codecs) -Scaladocs from these files and a quick read of [Akka serialization guide](https://doc.akka.io/docs/akka/current/serialization.html) should be enough to use Circe Akka Serializer properly. Apart from implementing the Circe Akka Serializer in scala code, remember to configure your Serializer in Akka-specific configuration file (.conf file). Two mandatory configurations are `akka.actor.serializers` and `akka.actor.serialization-bindings` (example below): +Scaladocs from these files and a quick read of [Pekko serialization guide](https://pekko.apache.org/docs/pekko/current/serialization.html) should be enough to use Circe Pekko Serializer properly. Apart from implementing the Circe Pekko Serializer in scala code, remember to configure your Serializer in Pekko-specific configuration file (.conf file). Two mandatory configurations are `pekko.actor.serializers` and `pekko.actor.serialization-bindings` (example below): ``` -akka { +pekko { actor { serializers { circe-json = "org.example.ExampleSerializer" @@ -45,47 +45,47 @@ akka { } } ``` -where `org.example.ExampleSerializer` is the FQCN of your Serializer which extends CirceAkkaSerializer and `org.example.MySerializable` is the FQCN of your top-level serializable type (trait / abstract class) that is extended by Messages / Events / States which `org.example.ExampleSerializer` should serialize. +where `org.example.ExampleSerializer` is the FQCN of your Serializer which extends CircePekkoSerializer and `org.example.MySerializable` is the FQCN of your top-level serializable type (trait / abstract class) that is extended by Messages / Events / States which `org.example.ExampleSerializer` should serialize. -Also, there are few optional configurations that you can set if you want to change the default behavior of Circe Akka Serializer: -- `org.virtuslab.ash.circe.verbose-debug-logging` = `on` / `off` +Also, there are few optional configurations that you can set if you want to change the default behavior of Circe Pekko Serializer: +- `org.virtuslab.psh.circe.verbose-debug-logging` = `on` / `off` `on` enables debug logs for each serialization / deserialization — prints info about what has been serialized/deserialized and how much time it took. Default is `off`.

-- `org.virtuslab.ash.circe.enable-missing-codecs-check` = `true` / `false` +- `org.virtuslab.psh.circe.enable-missing-codecs-check` = `true` / `false` -`true` enables additional runtime check for possible missing codec registrations (more info about this problem in [README](https://github.com/VirtusLab/akka-serialization-helper#missing-codec-registration)). This is in general checked by the [Codec Registration Checker Compiler Plugin](#codec-registration-checker-compiler-plugin) during compilation, so the default is `false`. However, if you use only Circe Akka Serializer without compiler plugins — this check should be enabled. Be aware that enabling this check might have a slight negative impact on Serializer's performance.

+`true` enables additional runtime check for possible missing codec registrations (more info about this problem in [README](https://github.com/VirtusLab/pekko-serialization-helper#missing-codec-registration)). This is in general checked by the [Codec Registration Checker Compiler Plugin](#codec-registration-checker-compiler-plugin) during compilation, so the default is `false`. However, if you use only Circe Pekko Serializer without compiler plugins — this check should be enabled. Be aware that enabling this check might have a slight negative impact on Serializer's performance.

-- `org.virtuslab.ash.circe.compression.algorithm` = `gzip` / `off` +- `org.virtuslab.psh.circe.compression.algorithm` = `gzip` / `off` `gzip` enables compression of payloads before serialization using the Gzip algorithm. Default is `off` (compression disabled). Choosing `gzip` altogether with setting proper `compress-larger-than` value (explained below) enables compression of payloads.

-- `org.virtuslab.ash.circe.compression.compress-larger-than` = `64 KiB` _(example value)_ +- `org.virtuslab.psh.circe.compression.compress-larger-than` = `64 KiB` _(example value)_ -If `org.virtuslab.ash.circe.compression.algorithm` = `gzip` and `compress-larger-than` is larger than `0 KiB` — each payload greater than this value will be compressed before serialization. Default value is `32 KiB`. If `org.virtuslab.ash.circe.compression.algorithm` = `off`, payloads will not be compressed, regardless of the chosen `compress-larger-than` value.

-**Note** — Circe Akka Serializer will perform **deserialization** properly for both compressed and uncompressed payloads regardless of both `org.virtuslab.ash.circe.compression` configurations (deserializer will recognize whether the payload has been compressed). `org.virtuslab.ash.circe.compression.*` settings matter only for selecting the mode of **serialization**. +If `org.virtuslab.psh.circe.compression.algorithm` = `gzip` and `compress-larger-than` is larger than `0 KiB` — each payload greater than this value will be compressed before serialization. Default value is `32 KiB`. If `org.virtuslab.psh.circe.compression.algorithm` = `off`, payloads will not be compressed, regardless of the chosen `compress-larger-than` value.

+**Note** — Circe Pekko Serializer will perform **deserialization** properly for both compressed and uncompressed payloads regardless of both `org.virtuslab.psh.circe.compression` configurations (deserializer will recognize whether the payload has been compressed). `org.virtuslab.psh.circe.compression.*` settings matter only for selecting the mode of **serialization**. ### Annotations -ASH compiler plugins are driven by two annotations: [@SerializabilityTrait](#SerializabilityTrait) and [@Serializer](#Serializer). Thus, before running compilation with ASH compiler plugins, make sure that you are using these two annotations properly in the project/module where plugins will do their work. Annotations are available on the classpath for each project/module where ASH sbt plugin [is enabled](https://github.com/VirtusLab/akka-serialization-helper#install). If you want to use annotations in some other project/module without enabling ASH sbt plugin, add them directly to library dependencies: +ASH compiler plugins are driven by two annotations: [@SerializabilityTrait](#SerializabilityTrait) and [@Serializer](#Serializer). Thus, before running compilation with ASH compiler plugins, make sure that you are using these two annotations properly in the project/module where plugins will do their work. Annotations are available on the classpath for each project/module where ASH sbt plugin [is enabled](https://github.com/VirtusLab/pekko-serialization-helper#install). If you want to use annotations in some other project/module without enabling ASH sbt plugin, add them directly to library dependencies: ```sbt -import org.virtuslab.ash.AkkaSerializationHelperPlugin +import org.virtuslab.psh.PekkoSerializationHelperPlugin (...) val foo = project // ... - .settings(libraryDependencies += AkkaSerializationHelperPlugin.annotation) + .settings(libraryDependencies += PekkoSerializationHelperPlugin.annotation) ``` #### SerializabilityTrait -[@SerializabilityTrait](../annotation/src/main/scala/org/virtuslab/ash/annotation/SerializabilityTrait.scala) is an annotation that should be added to your top-level serializable type (trait mentioned in the `akka.actor.serialization-bindings` part of Akka config). Moreover, if your top-level serializable type is extended by another **trait** (i.e. another, more specific marker trait that is later extended by concrete classes representing messages / events / states) — and this more specific trait is used as a type parameter in a `@Serializer` annotation, then such trait should also be annotated with `@SerializabilityTrait` annotation. Concrete classes extending serializability traits (i.e. classes that define Messages/Events/States) should **not** be marked with this annotation. See examples in [README](https://github.com/VirtusLab/akka-serialization-helper#missing-serialization-binding) +[@SerializabilityTrait](../annotation/src/main/scala/org/virtuslab/psh/annotation/SerializabilityTrait.scala) is an annotation that should be added to your top-level serializable type (trait mentioned in the `pekko.actor.serialization-bindings` part of Pekko config). Moreover, if your top-level serializable type is extended by another **trait** (i.e. another, more specific marker trait that is later extended by concrete classes representing messages / events / states) — and this more specific trait is used as a type parameter in a `@Serializer` annotation, then such trait should also be annotated with `@SerializabilityTrait` annotation. Concrete classes extending serializability traits (i.e. classes that define Messages/Events/States) should **not** be marked with this annotation. See examples in [README](https://github.com/VirtusLab/pekko-serialization-helper#missing-serialization-binding) #### Serializer -[@Serializer](../annotation/src/main/scala/org/virtuslab/ash/annotation/Serializer.scala) is an annotation used by the [Codec Registration Checker Compiler Plugin](#codec-registration-checker-compiler-plugin) to check if there are any missing codec registrations. Add the `@Serializer` annotation to each serializer listed in the `akka.actor.serializers` part of the Akka config. Moreover, to achieve full assurance that all codecs will be registered properly — add `@Serializer` annotation to each class/object/trait that contains code responsible for registration of codecs. See [Serializer Scaladoc](../annotation/src/main/scala/org/virtuslab/ash/annotation/Serializer.scala) for more details. +[@Serializer](../annotation/src/main/scala/org/virtuslab/psh/annotation/Serializer.scala) is an annotation used by the [Codec Registration Checker Compiler Plugin](#codec-registration-checker-compiler-plugin) to check if there are any missing codec registrations. Add the `@Serializer` annotation to each serializer listed in the `pekko.actor.serializers` part of the Pekko config. Moreover, to achieve full assurance that all codecs will be registered properly — add `@Serializer` annotation to each class/object/trait that contains code responsible for registration of codecs. See [Serializer Scaladoc](../annotation/src/main/scala/org/virtuslab/psh/annotation/Serializer.scala) for more details. ### Serializability Checker Compiler Plugin -Before using this compiler plugin, make sure that you are using the [@SerializabilityTrait](../annotation/src/main/scala/org/virtuslab/ash/annotation/SerializabilityTrait.scala) annotation properly in code (instructions in previous [section](#SerializabilityTrait)). This plugin searches for all possible Akka Messages, Events and States and checks if their supertypes are properly marked with the `@SerializabilityTrait` annotation.

+Before using this compiler plugin, make sure that you are using the [@SerializabilityTrait](../annotation/src/main/scala/org/virtuslab/psh/annotation/SerializabilityTrait.scala) annotation properly in code (instructions in previous [section](#SerializabilityTrait)). This plugin searches for all possible Pekko Messages, Events and States and checks if their supertypes are properly marked with the `@SerializabilityTrait` annotation.

Serializability Checker Compiler Plugin does not need additional configuration, but if you want to change its default behavior (or disable it) — you can add optional configurations as explained below: - `--disable` -The Plugin is enabled by default in each project/module where `AkkaSerializationHelperPlugin` is enabled. If you want to disable this particular plugin (but want to keep on using other ASH compiler plugins) — add the following setting inside `build.sbt` for the selected project/module:
+The Plugin is enabled by default in each project/module where `PekkoSerializationHelperPlugin` is enabled. If you want to disable this particular plugin (but want to keep on using other ASH compiler plugins) — add the following setting inside `build.sbt` for the selected project/module:
`ashSerializabilityCheckerCompilerPlugin / ashCompilerPluginEnable := false`

- `--verbose` @@ -95,22 +95,22 @@ Verbose mode enables additional logs from the plugin. These logs contain detaile - `--disable-detection-generics` -This option disables detection of messages/events/states based on their usage as a type parameter of certain classes — e.g. `akka.actor.typed.Behavior` or `akka.persistence.typed.scaladsl.Effect`. This detection is enabled by default. If you want to disable it, add the following setting:
+This option disables detection of messages/events/states based on their usage as a type parameter of certain classes — e.g. `org.apache.pekko.actor.typed.Behavior` or `org.apache.pekko.persistence.typed.scaladsl.Effect`. This detection is enabled by default. If you want to disable it, add the following setting:
`Compile / scalacOptions += "-P:serializability-checker-plugin:--disable-detection-generics"`

- `--disable-detection-generic-methods` -This option disables detection of messages/events/state based on their usage as generic argument to a method, e.g. `akka.actor.typed.scaladsl.ActorContext.ask`. This detection is enabled by default. If you want to disable it, add the following setting:
+This option disables detection of messages/events/state based on their usage as generic argument to a method, e.g. `org.apache.pekko.actor.typed.scaladsl.ActorContext.ask`. This detection is enabled by default. If you want to disable it, add the following setting:
`Compile / scalacOptions += "-P:serializability-checker-plugin:--disable-detection-generic-methods"`

- `--disable-detection-methods` -This option disables detection of messages/events/state based on type of arguments to a method, e.g. `akka.actor.typed.ActorRef.tell`. This detection is enabled by default. If you want to disable it, add the following setting:
+This option disables detection of messages/events/state based on type of arguments to a method, e.g. `org.apache.pekko.actor.typed.ActorRef.tell`. This detection is enabled by default. If you want to disable it, add the following setting:
`Compile / scalacOptions += "-P:serializability-checker-plugin:--disable-detection-methods"`

- `--disable-detection-untyped-methods` -This option disables detection of messages/events/state based on type of arguments to a method that takes Any, used for Akka Classic. This detection is enabled by default. If you want to disable it, add the following setting:
+This option disables detection of messages/events/state based on type of arguments to a method that takes Any, used for Pekko Classic. This detection is enabled by default. If you want to disable it, add the following setting:
`Compile / scalacOptions += "-P:serializability-checker-plugin:--disable-detection-untyped-methods"`

- `--disable-detection-higher-order-function` @@ -143,12 +143,12 @@ The list is empty by default. If you want to mark some types as serializable, ad ### Codec Registration Checker Compiler Plugin Before using this compiler plugin, make sure that you are using both [annotations](#annotations) properly. If so — the plugin can be used right away. This plugin checks whether classes marked with serializability trait are being referenced in a marked serializer, which ensures that codecs will be registered in runtime. -**Note** - Codec Registration Checker Compiler Plugin is useful only in projects (modules) where the [@Serializer](#Serializer) annotation is used. Therefore, if you are using Akka Serialization Helper in multiple modules but in fact use `@Serializer` annotation in only one module, you might disable this plugin in all other modules except the one where `@Serializer` annotation is used.

+**Note** - Codec Registration Checker Compiler Plugin is useful only in projects (modules) where the [@Serializer](#Serializer) annotation is used. Therefore, if you are using Pekko Serialization Helper in multiple modules but in fact use `@Serializer` annotation in only one module, you might disable this plugin in all other modules except the one where `@Serializer` annotation is used.

Codec Registration Checker Compiler Plugin does not need additional configuration, but you can change default configurations as explained below: - `--disable` -The Plugin is enabled by default in each project/module where `AkkaSerializationHelperPlugin` is enabled. If you want to disable this particular plugin (but want to keep on using other ASH compiler plugins) — add the following setting inside `build.sbt` for the selected project/module:
+The Plugin is enabled by default in each project/module where `PekkoSerializationHelperPlugin` is enabled. If you want to disable this particular plugin (but want to keep on using other ASH compiler plugins) — add the following setting inside `build.sbt` for the selected project/module:
`ashCodecRegistrationCheckerCompilerPlugin / ashCompilerPluginEnable := false`

- `custom cache file path` @@ -162,7 +162,7 @@ Dump Persistence Schema Compiler Plugin does not need additional configuration, - `--disable` -The Plugin is enabled by default in each project/module where `AkkaSerializationHelperPlugin` is enabled. If you want to disable this particular plugin (but want to keep on using other ASH compiler plugins) — add the following setting inside `build.sbt` for the selected project/module:
+The Plugin is enabled by default in each project/module where `PekkoSerializationHelperPlugin` is enabled. If you want to disable this particular plugin (but want to keep on using other ASH compiler plugins) — add the following setting inside `build.sbt` for the selected project/module:
`ashDumpPersistenceSchemaCompilerPlugin / ashCompilerPluginEnable := false`

- `--verbose` @@ -178,7 +178,7 @@ This plugin creates a set of helper temporary Json files (used later by the [`as Dump Persistence Schema Compiler Plugin prepares data for the `ashDumpPersistenceSchema` sbt task, which creates the final output for user.
### `ashDumpPersistenceSchema` sbt task -The `ashDumpPersistenceSchema` sbt task dumps schema of akka-persistence to a yaml file. This is the only part of ASH that has to be invoked explicitly as a sbt task (`sbt ashDumpPersistenceSchema`). If you want to use this task, Dump Persistence Schema Compiler Plugin must **not** be disabled.
+The `ashDumpPersistenceSchema` sbt task dumps schema of pekko-persistence to a yaml file. This is the only part of ASH that has to be invoked explicitly as a sbt task (`sbt ashDumpPersistenceSchema`). If you want to use this task, Dump Persistence Schema Compiler Plugin must **not** be disabled.
Default output file for this task is `s"${name.value}-dump-persistence-schema-${version.value}.yaml"` (`name.value` and `version.value` are resolved by sbt on your project). If you want to have a custom name for this file, add following setting:
`ashDumpPersistenceSchema / ashDumpPersistenceSchemaOutputFilename := "CUSTOM_FILE_NAME"`
diff --git a/docs/presentation.pdf b/docs/presentation.pdf index c67128f2..8b4a5a8c 100644 Binary files a/docs/presentation.pdf and b/docs/presentation.pdf differ diff --git a/dump-persistence-schema-compiler-plugin/src/main/resources/scalac-plugin.xml b/dump-persistence-schema-compiler-plugin/src/main/resources/scalac-plugin.xml index 0bb958ca..6e7e820d 100644 --- a/dump-persistence-schema-compiler-plugin/src/main/resources/scalac-plugin.xml +++ b/dump-persistence-schema-compiler-plugin/src/main/resources/scalac-plugin.xml @@ -1,4 +1,4 @@ dump-persistence-schema-plugin - org.virtuslab.ash.DumpPersistenceSchemaCompilerPlugin + org.virtuslab.psh.DumpPersistenceSchemaCompilerPlugin diff --git a/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/CrossVersionReporter.scala b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/CrossVersionReporter.scala similarity index 96% rename from serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/CrossVersionReporter.scala rename to dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/CrossVersionReporter.scala index 913c07a3..de209964 100644 --- a/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/CrossVersionReporter.scala +++ b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/CrossVersionReporter.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh import scala.tools.nsc.Global import scala.tools.nsc.reporters.Reporter diff --git a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/DumpPersistenceSchemaCompilerPlugin.scala b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/DumpPersistenceSchemaCompilerPlugin.scala similarity index 97% rename from dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/DumpPersistenceSchemaCompilerPlugin.scala rename to dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/DumpPersistenceSchemaCompilerPlugin.scala index c8be807c..94d38b0a 100644 --- a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/DumpPersistenceSchemaCompilerPlugin.scala +++ b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/DumpPersistenceSchemaCompilerPlugin.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh import java.io.File diff --git a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/DumpPersistenceSchemaCompilerPluginComponent.scala b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/DumpPersistenceSchemaCompilerPluginComponent.scala similarity index 88% rename from dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/DumpPersistenceSchemaCompilerPluginComponent.scala rename to dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/DumpPersistenceSchemaCompilerPluginComponent.scala index 816cc1bc..79d7416d 100644 --- a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/DumpPersistenceSchemaCompilerPluginComponent.scala +++ b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/DumpPersistenceSchemaCompilerPluginComponent.scala @@ -1,11 +1,11 @@ -package org.virtuslab.ash +package org.virtuslab.psh import scala.tools.nsc.Global import scala.tools.nsc.Phase import scala.tools.nsc.plugins.PluginComponent -import org.virtuslab.ash.model.Field -import org.virtuslab.ash.model.TypeDefinition -import org.virtuslab.ash.writer.PersistenceSchemaWriter +import org.virtuslab.psh.model.Field +import org.virtuslab.psh.model.TypeDefinition +import org.virtuslab.psh.writer.PersistenceSchemaWriter class DumpPersistenceSchemaCompilerPluginComponent(val options: DumpPersistenceSchemaOptions, val global: Global) extends PluginComponent { @@ -26,11 +26,11 @@ class DumpPersistenceSchemaCompilerPluginComponent(val options: DumpPersistenceS */ private val genericsNames = Seq( - "akka.persistence.typed.scaladsl.Effect", - "akka.persistence.typed.scaladsl.EffectBuilder", - "akka.persistence.typed.scaladsl.EventSourcedBehavior", - "akka.persistence.typed.scaladsl.ReplyEffect") - private val ignoredPackages = Seq("akka.", "scala.", "java.") + "org.apache.pekko.persistence.typed.scaladsl.Effect", + "org.apache.pekko.persistence.typed.scaladsl.EffectBuilder", + "org.apache.pekko.persistence.typed.scaladsl.EventSourcedBehavior", + "org.apache.pekko.persistence.typed.scaladsl.ReplyEffect") + private val ignoredPackages = Seq("org.apache.pekko.", "scala.", "java.") override def apply(unit: global.CompilationUnit): Unit = { val body = unit.body diff --git a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/DumpPersistenceSchemaOptions.scala b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/DumpPersistenceSchemaOptions.scala similarity index 92% rename from dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/DumpPersistenceSchemaOptions.scala rename to dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/DumpPersistenceSchemaOptions.scala index e937f3be..64209b03 100644 --- a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/DumpPersistenceSchemaOptions.scala +++ b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/DumpPersistenceSchemaOptions.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh /** * Scalac forces us to be stateful. PluginComponents must be created during constructor call and plugin receives options by a diff --git a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/model/Field.scala b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/model/Field.scala similarity index 60% rename from dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/model/Field.scala rename to dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/model/Field.scala index e10fb82e..25f68185 100644 --- a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/model/Field.scala +++ b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/model/Field.scala @@ -1,3 +1,3 @@ -package org.virtuslab.ash.model +package org.virtuslab.psh.model case class Field(name: String, typeName: String) diff --git a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/model/TypeDefinition.scala b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/model/TypeDefinition.scala similarity index 82% rename from dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/model/TypeDefinition.scala rename to dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/model/TypeDefinition.scala index d7c15ccf..c26df410 100644 --- a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/model/TypeDefinition.scala +++ b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/model/TypeDefinition.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.model +package org.virtuslab.psh.model final case class TypeDefinition( typeSymbol: String, diff --git a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/writer/DumpPersistenceSchemaJsonProtocol.scala b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/writer/DumpPersistenceSchemaJsonProtocol.scala similarity index 72% rename from dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/writer/DumpPersistenceSchemaJsonProtocol.scala rename to dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/writer/DumpPersistenceSchemaJsonProtocol.scala index 69f21d16..cb995174 100644 --- a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/writer/DumpPersistenceSchemaJsonProtocol.scala +++ b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/writer/DumpPersistenceSchemaJsonProtocol.scala @@ -1,10 +1,10 @@ -package org.virtuslab.ash.writer +package org.virtuslab.psh.writer import spray.json.DefaultJsonProtocol import spray.json.JsonFormat -import org.virtuslab.ash.model.Field -import org.virtuslab.ash.model.TypeDefinition +import org.virtuslab.psh.model.Field +import org.virtuslab.psh.model.TypeDefinition trait DumpPersistenceSchemaJsonProtocol extends DefaultJsonProtocol { implicit val fieldFormat: JsonFormat[Field] = jsonFormat2(Field) diff --git a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/writer/PersistenceSchemaWriter.scala b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/writer/PersistenceSchemaWriter.scala similarity index 91% rename from dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/writer/PersistenceSchemaWriter.scala rename to dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/writer/PersistenceSchemaWriter.scala index 1048f4c8..befcd416 100644 --- a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/writer/PersistenceSchemaWriter.scala +++ b/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/psh/writer/PersistenceSchemaWriter.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.writer +package org.virtuslab.psh.writer import scala.collection.mutable import scala.util.Try @@ -6,8 +6,8 @@ import scala.util.Try import better.files.File import spray.json._ -import org.virtuslab.ash.DumpPersistenceSchemaOptions -import org.virtuslab.ash.model.TypeDefinition +import org.virtuslab.psh.DumpPersistenceSchemaOptions +import org.virtuslab.psh.model.TypeDefinition class PersistenceSchemaWriter(outputDirectory: File) extends DumpPersistenceSchemaJsonProtocol { diff --git a/dump-persistence-schema-compiler-plugin/src/test/resources/AbstractTrigger.scala b/dump-persistence-schema-compiler-plugin/src/test/resources/AbstractTrigger.scala index 398baf79..819d5acd 100644 --- a/dump-persistence-schema-compiler-plugin/src/test/resources/AbstractTrigger.scala +++ b/dump-persistence-schema-compiler-plugin/src/test/resources/AbstractTrigger.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.persistence.typed.scaladsl.Effect +import org.apache.pekko.persistence.typed.scaladsl.Effect object AbstractTrigger { def trigger: Effect[Any with Data with Serializable with Product, Any] = ??? diff --git a/dump-persistence-schema-compiler-plugin/src/test/resources/Data.scala b/dump-persistence-schema-compiler-plugin/src/test/resources/Data.scala index 80f85bb2..61094d62 100644 --- a/dump-persistence-schema-compiler-plugin/src/test/resources/Data.scala +++ b/dump-persistence-schema-compiler-plugin/src/test/resources/Data.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.persistence.typed.scaladsl.Effect +import org.apache.pekko.persistence.typed.scaladsl.Effect import scala.annotation.StaticAnnotation diff --git a/dump-persistence-schema-compiler-plugin/src/test/resources/DataEnum.scala b/dump-persistence-schema-compiler-plugin/src/test/resources/DataEnum.scala index a2f94a58..5496eef5 100644 --- a/dump-persistence-schema-compiler-plugin/src/test/resources/DataEnum.scala +++ b/dump-persistence-schema-compiler-plugin/src/test/resources/DataEnum.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.persistence.typed.scaladsl.Effect +import org.apache.pekko.persistence.typed.scaladsl.Effect object DataEnum { sealed trait Enum diff --git a/dump-persistence-schema-compiler-plugin/src/test/resources/GenericTrigger.scala b/dump-persistence-schema-compiler-plugin/src/test/resources/GenericTrigger.scala index de63f81f..e35d8e2a 100644 --- a/dump-persistence-schema-compiler-plugin/src/test/resources/GenericTrigger.scala +++ b/dump-persistence-schema-compiler-plugin/src/test/resources/GenericTrigger.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.persistence.typed.scaladsl.Effect +import org.apache.pekko.persistence.typed.scaladsl.Effect object GenericTrigger { def trigger[A]: Effect[A, Any] = ??? diff --git a/dump-persistence-schema-compiler-plugin/src/test/resources/StateData.scala b/dump-persistence-schema-compiler-plugin/src/test/resources/StateData.scala index 3fc5f371..c901ff1b 100644 --- a/dump-persistence-schema-compiler-plugin/src/test/resources/StateData.scala +++ b/dump-persistence-schema-compiler-plugin/src/test/resources/StateData.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.persistence.typed.scaladsl.Effect +import org.apache.pekko.persistence.typed.scaladsl.Effect object StateData { diff --git a/dump-persistence-schema-compiler-plugin/src/test/resources/Trigger.scala b/dump-persistence-schema-compiler-plugin/src/test/resources/Trigger.scala index 8384d974..6d010f17 100644 --- a/dump-persistence-schema-compiler-plugin/src/test/resources/Trigger.scala +++ b/dump-persistence-schema-compiler-plugin/src/test/resources/Trigger.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.persistence.typed.scaladsl.Effect +import org.apache.pekko.persistence.typed.scaladsl.Effect object Trigger { def trigger: Effect[Data, Any] = ??? diff --git a/dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/ash/DumpPersistenceSchemaCompilerPluginComponentSpec.scala b/dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/psh/DumpPersistenceSchemaCompilerPluginComponentSpec.scala similarity index 94% rename from dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/ash/DumpPersistenceSchemaCompilerPluginComponentSpec.scala rename to dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/psh/DumpPersistenceSchemaCompilerPluginComponentSpec.scala index 023a5f24..3352de28 100644 --- a/dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/ash/DumpPersistenceSchemaCompilerPluginComponentSpec.scala +++ b/dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/psh/DumpPersistenceSchemaCompilerPluginComponentSpec.scala @@ -1,12 +1,12 @@ -package org.virtuslab.ash +package org.virtuslab.psh import better.files.File import org.scalatest.matchers.should import org.scalatest.wordspec.AnyWordSpecLike -import org.virtuslab.ash.compiler.DumpPersistenceSchemaCompiler -import org.virtuslab.ash.model.TypeDefinition -import org.virtuslab.ash.writer.PersistenceSchemaWriter +import org.virtuslab.psh.compiler.DumpPersistenceSchemaCompiler +import org.virtuslab.psh.model.TypeDefinition +import org.virtuslab.psh.writer.PersistenceSchemaWriter class DumpPersistenceSchemaCompilerPluginComponentSpec extends AnyWordSpecLike with should.Matchers { private def getResourceAsString(name: String) = diff --git a/dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/ash/PersistenceSchemaWriterSpec.scala b/dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/psh/PersistenceSchemaWriterSpec.scala similarity index 85% rename from dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/ash/PersistenceSchemaWriterSpec.scala rename to dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/psh/PersistenceSchemaWriterSpec.scala index 0d1d8a88..5fb53b34 100644 --- a/dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/ash/PersistenceSchemaWriterSpec.scala +++ b/dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/psh/PersistenceSchemaWriterSpec.scala @@ -1,14 +1,14 @@ -package org.virtuslab.ash +package org.virtuslab.psh import better.files.File import org.scalatest.matchers.should import org.scalatest.wordspec.AnyWordSpecLike import spray.json._ -import org.virtuslab.ash.model.Field -import org.virtuslab.ash.model.TypeDefinition -import org.virtuslab.ash.writer.DumpPersistenceSchemaJsonProtocol -import org.virtuslab.ash.writer.PersistenceSchemaWriter +import org.virtuslab.psh.model.Field +import org.virtuslab.psh.model.TypeDefinition +import org.virtuslab.psh.writer.DumpPersistenceSchemaJsonProtocol +import org.virtuslab.psh.writer.PersistenceSchemaWriter class PersistenceSchemaWriterSpec extends AnyWordSpecLike with should.Matchers with DumpPersistenceSchemaJsonProtocol { val testDef: TypeDefinition = diff --git a/dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/ash/compiler/DumpPersistenceSchemaCompiler.scala b/dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/psh/compiler/DumpPersistenceSchemaCompiler.scala similarity index 95% rename from dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/ash/compiler/DumpPersistenceSchemaCompiler.scala rename to dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/psh/compiler/DumpPersistenceSchemaCompiler.scala index ae188e8e..b4e5b536 100644 --- a/dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/ash/compiler/DumpPersistenceSchemaCompiler.scala +++ b/dump-persistence-schema-compiler-plugin/src/test/scala/org/virtuslab/psh/compiler/DumpPersistenceSchemaCompiler.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.compiler +package org.virtuslab.psh.compiler import java.io.BufferedReader import java.io.PrintWriter @@ -13,7 +13,7 @@ import scala.tools.nsc.io.VirtualDirectory import scala.tools.nsc.reporters.ConsoleReporter import scala.tools.nsc.util.ClassPath -import org.virtuslab.ash.DumpPersistenceSchemaCompilerPlugin +import org.virtuslab.psh.DumpPersistenceSchemaCompilerPlugin object DumpPersistenceSchemaCompiler { def compileCode(code: List[String], options: List[String]): String = { diff --git a/examples/akka-cluster-app/README.md b/examples/akka-cluster-app/README.md deleted file mode 100644 index 7876f461..00000000 --- a/examples/akka-cluster-app/README.md +++ /dev/null @@ -1,12 +0,0 @@ -## akka-cluster-app example project -This project is the simplest example of Akka Serialization Helper usage.
- -In order to run the application locally, run the following commands in separate terminal windows (so that 3 separate processes run in parallel): -``` -sbt "runMain org.virtuslab.example.App compute 25251" -sbt "runMain org.virtuslab.example.App compute 25252" -sbt "runMain org.virtuslab.example.App client 0" -``` - -Note: this example-app's logic is based on akka-sample-custer-scala code from the official Akka repository, -see [akka-sample-cluster-scala](https://github.com/akka/akka-samples/tree/2.6/akka-sample-cluster-scala). diff --git a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/CirceAkkaSerializable.scala b/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/CirceAkkaSerializable.scala deleted file mode 100644 index cfc7df25..00000000 --- a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/CirceAkkaSerializable.scala +++ /dev/null @@ -1,6 +0,0 @@ -package org.virtuslab.example - -import org.virtuslab.ash.annotation.SerializabilityTrait - -@SerializabilityTrait -trait CirceAkkaSerializable extends Product with Serializable diff --git a/examples/akka-persistence-app/build.sbt b/examples/akka-persistence-app/build.sbt deleted file mode 100644 index deb29a2d..00000000 --- a/examples/akka-persistence-app/build.sbt +++ /dev/null @@ -1,79 +0,0 @@ -import org.virtuslab.ash.AkkaSerializationHelperPlugin - -name := "akka-persistence-app" - -scalaVersion := "2.13.14" - -Compile / scalacOptions ++= Seq( - "-target:11", - "-deprecation", - "-feature", - "-unchecked", - "-Xlog-reflective-calls", - "-Xlint", - "-Ywarn-unused") -Compile / javacOptions ++= Seq("-Xlint:unchecked", "-Xlint:deprecation") - -Test / parallelExecution := false -Test / logBuffered := false - -fork := true // must be true due to https://discuss.lightbend.com/t/akka-projection-getting-started-guide-example-could-not-run-eventgeneratorapp/9434/2 -Global / cancelable := false // ctrl-c - -ThisBuild / resolvers += Resolver.ApacheMavenSnapshotsRepo - -val akkaVersion = "2.6.20" -val akkaHttpVersion = "10.2.10" -val akkaHttp2SupportVersion = "10.2.10" -val akkaManagementVersion = "1.1.4" -val akkaPersistenceJdbcVersion = "5.1.0" -val akkaProjectionVersion = "1.2.5" -val circeVersion = "0.14.8" -val scalikeJdbcVersion = "3.5.0" - -enablePlugins(AkkaGrpcPlugin, JavaAppPackaging, DockerPlugin, AkkaSerializationHelperPlugin) -dockerBaseImage := "docker.io/library/adoptopenjdk:11-jre-hotspot" -dockerUsername := sys.props.get("docker.username") -dockerRepository := sys.props.get("docker.registry") - -libraryDependencySchemes += "com.typesafe.akka" %% "akka-http-core" % "always" - -libraryDependencies ++= Seq( - // 1. Basic dependencies for a clustered application - "com.typesafe.akka" %% "akka-stream" % akkaVersion, - "com.typesafe.akka" %% "akka-cluster-typed" % akkaVersion, - "com.typesafe.akka" %% "akka-cluster-sharding-typed" % akkaVersion, - "com.typesafe.akka" %% "akka-actor-testkit-typed" % akkaVersion % Test, - // Akka Management powers Health Checks and Akka Cluster Bootstrapping - "com.lightbend.akka.management" %% "akka-management" % akkaManagementVersion, - "com.typesafe.akka" %% "akka-http" % akkaHttpVersion, - "com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion, - "com.lightbend.akka.management" %% "akka-management-cluster-http" % akkaManagementVersion, - "com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % akkaManagementVersion, - "com.lightbend.akka.discovery" %% "akka-discovery-kubernetes-api" % akkaManagementVersion, - "com.typesafe.akka" %% "akka-discovery" % akkaVersion, - // Common dependencies for logging and testing - "com.typesafe.akka" %% "akka-slf4j" % akkaVersion, - "ch.qos.logback" % "logback-classic" % "1.5.6", - "org.scalatest" %% "scalatest" % "3.2.12" % Test, - // 2. Using gRPC and/or protobuf - "com.typesafe.akka" %% "akka-http2-support" % akkaHttp2SupportVersion, - // 3. Using Akka Persistence - "com.typesafe.akka" %% "akka-persistence-typed" % akkaVersion, - "com.typesafe.akka" %% "akka-serialization-jackson" % akkaVersion, - "com.lightbend.akka" %% "akka-persistence-jdbc" % akkaPersistenceJdbcVersion, - "com.typesafe.akka" %% "akka-persistence-testkit" % akkaVersion % Test, - "org.postgresql" % "postgresql" % "42.7.3", - // 4. Querying or projecting data from Akka Persistence - "com.typesafe.akka" %% "akka-persistence-query" % akkaVersion, - "com.lightbend.akka" %% "akka-projection-eventsourced" % akkaProjectionVersion, - "com.lightbend.akka" %% "akka-projection-jdbc" % akkaProjectionVersion, - "org.scalikejdbc" %% "scalikejdbc" % scalikeJdbcVersion, - "org.scalikejdbc" %% "scalikejdbc-config" % scalikeJdbcVersion, - // 5. Dependencies needed to use Akka Serialization Helper with circe codecs - "io.circe" %% "circe-core" % circeVersion, - AkkaSerializationHelperPlugin.annotation, - AkkaSerializationHelperPlugin.circeAkkaSerializer) - -ThisBuild / semanticdbEnabled := true -ThisBuild / semanticdbVersion := "4.9.3" diff --git a/examples/akka-persistence-app/src/main/resources/local1.conf b/examples/akka-persistence-app/src/main/resources/local1.conf deleted file mode 100644 index 31ddd9a9..00000000 --- a/examples/akka-persistence-app/src/main/resources/local1.conf +++ /dev/null @@ -1,7 +0,0 @@ -include "application" -include "local-shared" - -akka-persistence-app.grpc.port = 8101 - -akka.remote.artery.canonical.port = 2551 -akka.management.http.port = 9101 diff --git a/examples/akka-persistence-app/src/main/resources/local2.conf b/examples/akka-persistence-app/src/main/resources/local2.conf deleted file mode 100644 index 9b5dcaf8..00000000 --- a/examples/akka-persistence-app/src/main/resources/local2.conf +++ /dev/null @@ -1,7 +0,0 @@ -include "application" -include "local-shared" - -akka-persistence-app.grpc.port = 8102 - -akka.management.http.port = 9102 -akka.remote.artery.canonical.port = 2552 diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/CirceAkkaSerializable.scala b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/CirceAkkaSerializable.scala deleted file mode 100644 index cfc7df25..00000000 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/CirceAkkaSerializable.scala +++ /dev/null @@ -1,6 +0,0 @@ -package org.virtuslab.example - -import org.virtuslab.ash.annotation.SerializabilityTrait - -@SerializabilityTrait -trait CirceAkkaSerializable extends Product with Serializable diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala b/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala deleted file mode 100644 index ec5226a1..00000000 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala +++ /dev/null @@ -1,24 +0,0 @@ -package org.virtuslab.example - -import akka.actor.ExtendedActorSystem - -import org.virtuslab.ash.annotation.Serializer -import org.virtuslab.ash.circe.CirceAkkaSerializer -import org.virtuslab.ash.circe.Register -import org.virtuslab.ash.circe.Registration - -@Serializer(classOf[CirceAkkaSerializable], Register.REGISTRATION_REGEX) -class ExampleSerializer(actorSystem: ExtendedActorSystem) - extends CirceAkkaSerializer[CirceAkkaSerializable](actorSystem) { - override def identifier: Int = 7312 - - override lazy val codecs: Seq[Registration[_ <: CirceAkkaSerializable]] = Seq( - Register[ShoppingCart.Command], - Register[ShoppingCart.Event], - Register[ShoppingCart.State], - Register[ShoppingCart.Summary]) - - override lazy val manifestMigrations: Seq[(String, Class[_])] = Nil - - override lazy val packagePrefix: String = "org.virtuslab.example" -} diff --git a/examples/event-migration/.scalafix.conf b/examples/event-migration/.scalafix.conf index 56349296..0fa3238b 100644 --- a/examples/event-migration/.scalafix.conf +++ b/examples/event-migration/.scalafix.conf @@ -9,8 +9,8 @@ OrganizeImports { groups = [ "java.", "scala.", - "akka.", + "org.apache.pekko.", "*", - "org.virtuslab.ash" + "org.virtuslab.psh" ] } diff --git a/examples/akka-persistence-app/.scalafix.conf b/examples/pekko-cluster-app/.scalafix.conf similarity index 78% rename from examples/akka-persistence-app/.scalafix.conf rename to examples/pekko-cluster-app/.scalafix.conf index 56349296..0fa3238b 100644 --- a/examples/akka-persistence-app/.scalafix.conf +++ b/examples/pekko-cluster-app/.scalafix.conf @@ -9,8 +9,8 @@ OrganizeImports { groups = [ "java.", "scala.", - "akka.", + "org.apache.pekko.", "*", - "org.virtuslab.ash" + "org.virtuslab.psh" ] } diff --git a/examples/akka-cluster-app/.scalafmt.conf b/examples/pekko-cluster-app/.scalafmt.conf similarity index 100% rename from examples/akka-cluster-app/.scalafmt.conf rename to examples/pekko-cluster-app/.scalafmt.conf diff --git a/examples/pekko-cluster-app/README.md b/examples/pekko-cluster-app/README.md new file mode 100644 index 00000000..b87ecea9 --- /dev/null +++ b/examples/pekko-cluster-app/README.md @@ -0,0 +1,12 @@ +## pekko-cluster-app example project +This project is the simplest example of Pekko Serialization Helper usage.
+ +In order to run the application locally, run the following commands in separate terminal windows (so that 3 separate processes run in parallel): +``` +sbt "runMain org.virtuslab.example.App compute 25251" +sbt "runMain org.virtuslab.example.App compute 25252" +sbt "runMain org.virtuslab.example.App client 0" +``` + +Note: this example-app's logic is based on pekko-sample-custer-scala code from the official Pekko repository, +see [pekko-sample-cluster-scala](https://github.com/apache/incubator-pekko-samples/tree/forked-from-pekko/pekko-sample-cluster-scala). diff --git a/examples/akka-cluster-app/build.sbt b/examples/pekko-cluster-app/build.sbt similarity index 50% rename from examples/akka-cluster-app/build.sbt rename to examples/pekko-cluster-app/build.sbt index e1edf10b..6f197061 100644 --- a/examples/akka-cluster-app/build.sbt +++ b/examples/pekko-cluster-app/build.sbt @@ -1,32 +1,32 @@ import com.typesafe.sbt.SbtMultiJvm.multiJvmSettings import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm -import org.virtuslab.ash.AkkaSerializationHelperPlugin +import org.virtuslab.psh.PekkoSerializationHelperPlugin -name := "akka-cluster-app" +name := "pekko-cluster-app" version := "0.1" scalaVersion := "2.13.14" val circeVersion = "0.14.8" -val akkaVersion = "2.6.20" +val pekkoVersion = "1.0.3" -lazy val `akka-cluster-app` = project +lazy val `pekko-cluster-app` = project .in(file(".")) - .enablePlugins(AkkaSerializationHelperPlugin) + .enablePlugins(PekkoSerializationHelperPlugin) .settings(multiJvmSettings: _*) .settings( - libraryDependencies ++= akkaDependencies ++ ashDependencies ++ Seq(logbackDependency, circeDependency), - fork := true, // must be true due to https://discuss.lightbend.com/t/akka-projection-getting-started-guide-example-could-not-run-eventgeneratorapp/9434/2 + libraryDependencies ++= pekkoDependencies ++ ashDependencies ++ Seq(logbackDependency, circeDependency), + fork := true, // must be true due to https://discuss.lightbend.com/t/pekko-projection-getting-started-guide-example-could-not-run-eventgeneratorapp/9434/2 Global / cancelable := false, scalacOptions += "-Ywarn-unused") .configs(MultiJvm) -lazy val akkaDependencies = - Seq("com.typesafe.akka" %% "akka-actor-typed", "com.typesafe.akka" %% "akka-cluster-typed").map(_ % akkaVersion) +lazy val pekkoDependencies = + Seq("org.apache.pekko" %% "pekko-actor-typed", "org.apache.pekko" %% "pekko-cluster-typed").map(_ % pekkoVersion) lazy val circeDependency = "io.circe" %% "circe-core" % circeVersion lazy val ashDependencies = - Seq(AkkaSerializationHelperPlugin.annotation, AkkaSerializationHelperPlugin.circeAkkaSerializer) + Seq(PekkoSerializationHelperPlugin.annotation, PekkoSerializationHelperPlugin.circePekkoSerializer) lazy val logbackDependency = "ch.qos.logback" % "logback-classic" % "1.5.6" diff --git a/examples/akka-cluster-app/project/build.properties b/examples/pekko-cluster-app/project/build.properties similarity index 100% rename from examples/akka-cluster-app/project/build.properties rename to examples/pekko-cluster-app/project/build.properties diff --git a/examples/akka-cluster-app/project/plugins.sbt b/examples/pekko-cluster-app/project/plugins.sbt similarity index 68% rename from examples/akka-cluster-app/project/plugins.sbt rename to examples/pekko-cluster-app/project/plugins.sbt index a56568e1..7807e88e 100644 --- a/examples/akka-cluster-app/project/plugins.sbt +++ b/examples/pekko-cluster-app/project/plugins.sbt @@ -1,4 +1,4 @@ addSbtPlugin("com.github.sbt" % "sbt-multi-jvm" % "0.6.0") -addSbtPlugin("org.virtuslab.ash" % "sbt-akka-serialization-helper" % "0.8.0") +addSbtPlugin("org.virtuslab.psh" % "sbt-pekko-serialization-helper" % "0.8.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1") diff --git a/examples/akka-cluster-app/src/main/resources/application.conf b/examples/pekko-cluster-app/src/main/resources/application.conf similarity index 52% rename from examples/akka-cluster-app/src/main/resources/application.conf rename to examples/pekko-cluster-app/src/main/resources/application.conf index 8ff0bd6f..fda6cb66 100644 --- a/examples/akka-cluster-app/src/main/resources/application.conf +++ b/examples/pekko-cluster-app/src/main/resources/application.conf @@ -1,4 +1,4 @@ -akka { +pekko { actor { provider = cluster @@ -7,7 +7,7 @@ akka { } serialization-bindings { - "org.virtuslab.example.CirceAkkaSerializable" = circe-json + "org.virtuslab.example.CircePekkoSerializable" = circe-json } } remote.artery { @@ -19,9 +19,9 @@ akka { cluster { seed-nodes = [ - "akka://ClusterSystem@127.0.0.1:25251", - "akka://ClusterSystem@127.0.0.1:25252"] + "pekko://ClusterSystem@127.0.0.1:25251", + "pekko://ClusterSystem@127.0.0.1:25252"] - downing-provider-class = "akka.cluster.sbr.SplitBrainResolverProvider" + downing-provider-class = "org.apache.pekko.cluster.sbr.SplitBrainResolverProvider" } } diff --git a/examples/akka-cluster-app/src/main/resources/example.conf b/examples/pekko-cluster-app/src/main/resources/example.conf similarity index 100% rename from examples/akka-cluster-app/src/main/resources/example.conf rename to examples/pekko-cluster-app/src/main/resources/example.conf diff --git a/examples/akka-cluster-app/src/main/resources/logback.xml b/examples/pekko-cluster-app/src/main/resources/logback.xml similarity index 85% rename from examples/akka-cluster-app/src/main/resources/logback.xml rename to examples/pekko-cluster-app/src/main/resources/logback.xml index a87ba4ee..efd5e309 100644 --- a/examples/akka-cluster-app/src/main/resources/logback.xml +++ b/examples/pekko-cluster-app/src/main/resources/logback.xml @@ -1,7 +1,7 @@ + logging config, see the Pekko docs: https://pekko.apache.org/docs/pekko/2.6/typed/logging.html#logback --> [%date{ISO8601}] [%level] [%logger] [%marker] [%thread] - %msg%n diff --git a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/App.scala b/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/App.scala similarity index 80% rename from examples/akka-cluster-app/src/main/scala/org/virtuslab/example/App.scala rename to examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/App.scala index 64ec580d..07cbcaa6 100644 --- a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/App.scala +++ b/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/App.scala @@ -1,12 +1,12 @@ package org.virtuslab.example -import akka.actor.typed.ActorSystem -import akka.actor.typed.Behavior -import akka.actor.typed.receptionist.Receptionist -import akka.actor.typed.receptionist.ServiceKey -import akka.actor.typed.scaladsl.Behaviors -import akka.actor.typed.scaladsl.Routers -import akka.cluster.typed.Cluster +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.Behavior +import org.apache.pekko.actor.typed.receptionist.Receptionist +import org.apache.pekko.actor.typed.receptionist.ServiceKey +import org.apache.pekko.actor.typed.scaladsl.Behaviors +import org.apache.pekko.actor.typed.scaladsl.Routers +import org.apache.pekko.cluster.typed.Cluster import com.typesafe.config.ConfigFactory @@ -51,8 +51,8 @@ object App { // Override the configuration of the port when specified as program argument val config = ConfigFactory .parseString(s""" - akka.remote.artery.canonical.port = $port - akka.cluster.roles = [$role] + pekko.remote.artery.canonical.port = $port + pekko.cluster.roles = [$role] """) .withFallback(ConfigFactory.load("example")) diff --git a/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/CircePekkoSerializable.scala b/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/CircePekkoSerializable.scala new file mode 100644 index 00000000..4d54c0f1 --- /dev/null +++ b/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/CircePekkoSerializable.scala @@ -0,0 +1,6 @@ +package org.virtuslab.example + +import org.virtuslab.psh.annotation.SerializabilityTrait + +@SerializabilityTrait +trait CircePekkoSerializable extends Product with Serializable diff --git a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala b/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala similarity index 51% rename from examples/akka-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala rename to examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala index fb32e11a..f973f454 100644 --- a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala +++ b/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala @@ -1,18 +1,18 @@ package org.virtuslab.example -import akka.actor.ExtendedActorSystem +import org.apache.pekko.actor.ExtendedActorSystem -import org.virtuslab.ash.annotation.Serializer -import org.virtuslab.ash.circe.CirceAkkaSerializer -import org.virtuslab.ash.circe.Register -import org.virtuslab.ash.circe.Registration +import org.virtuslab.psh.annotation.Serializer +import org.virtuslab.psh.circe.CircePekkoSerializer +import org.virtuslab.psh.circe.Register +import org.virtuslab.psh.circe.Registration -@Serializer(classOf[CirceAkkaSerializable], Register.REGISTRATION_REGEX) +@Serializer(classOf[CircePekkoSerializable], Register.REGISTRATION_REGEX) class ExampleSerializer(actorSystem: ExtendedActorSystem) - extends CirceAkkaSerializer[CirceAkkaSerializable](actorSystem) { + extends CircePekkoSerializer[CircePekkoSerializable](actorSystem) { override def identifier: Int = 2137 - override lazy val codecs: Seq[Registration[_ <: CirceAkkaSerializable]] = Seq( + override lazy val codecs: Seq[Registration[_ <: CircePekkoSerializable]] = Seq( Register[StatsClient.Event], Register[StatsService.Command], Register[StatsService.Response], diff --git a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsClient.scala b/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/StatsClient.scala similarity index 83% rename from examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsClient.scala rename to examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/StatsClient.scala index bf019550..386d11d1 100644 --- a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsClient.scala +++ b/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/StatsClient.scala @@ -2,16 +2,16 @@ package org.virtuslab.example import scala.concurrent.duration._ -import akka.actor.typed.ActorRef -import akka.actor.typed.Behavior -import akka.actor.typed.scaladsl.Behaviors +import org.apache.pekko.actor.typed.ActorRef +import org.apache.pekko.actor.typed.Behavior +import org.apache.pekko.actor.typed.scaladsl.Behaviors import io.circe.Codec import io.circe.generic.semiauto.deriveCodec object StatsClient { - sealed trait Event extends CirceAkkaSerializable + sealed trait Event extends CircePekkoSerializable private case object Tick extends Event private case class ServiceResponse(result: StatsService.Response) extends Event diff --git a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala b/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala similarity index 87% rename from examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala rename to examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala index bf5fd8f9..cf612064 100644 --- a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala +++ b/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/StatsService.scala @@ -2,29 +2,29 @@ package org.virtuslab.example import scala.concurrent.duration._ -import akka.actor.typed.ActorRef -import akka.actor.typed.Behavior -import akka.actor.typed.scaladsl.Behaviors +import org.apache.pekko.actor.typed.ActorRef +import org.apache.pekko.actor.typed.Behavior +import org.apache.pekko.actor.typed.scaladsl.Behaviors import io.circe.Codec import io.circe.generic.semiauto.deriveCodec -import org.virtuslab.ash.circe.AkkaCodecs +import org.virtuslab.psh.circe.PekkoCodecs object StatsService { - sealed trait Command extends CirceAkkaSerializable + sealed trait Command extends CircePekkoSerializable final case class ProcessText(text: String, replyTo: ActorRef[Response]) extends Command { require(text.nonEmpty) } case object Stop extends Command - sealed trait Response extends CirceAkkaSerializable + sealed trait Response extends CircePekkoSerializable final case class JobResult(meanWordLength: Double) extends Response final case class JobFailed(reason: String) extends Response implicit lazy val codecResponse: Codec[Response] = deriveCodec - implicit lazy val codecActorRefResponse: Codec[ActorRef[Response]] = new AkkaCodecs {}.actorRefCodec + implicit lazy val codecActorRefResponse: Codec[ActorRef[Response]] = new PekkoCodecs {}.actorRefCodec implicit lazy val codecCommand: Codec[Command] = deriveCodec def apply(workers: ActorRef[StatsWorker.Process]): Behavior[Command] = @@ -47,7 +47,7 @@ object StatsService { object StatsAggregator { - sealed trait Event extends CirceAkkaSerializable + sealed trait Event extends CircePekkoSerializable private case object Timeout extends Event private case class CalculationComplete(length: Int) extends Event diff --git a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsWorker.scala b/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/StatsWorker.scala similarity index 79% rename from examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsWorker.scala rename to examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/StatsWorker.scala index 15c29fbe..ffafa6b7 100644 --- a/examples/akka-cluster-app/src/main/scala/org/virtuslab/example/StatsWorker.scala +++ b/examples/pekko-cluster-app/src/main/scala/org/virtuslab/example/StatsWorker.scala @@ -2,26 +2,26 @@ package org.virtuslab.example import scala.concurrent.duration._ -import akka.actor.typed.ActorRef -import akka.actor.typed.Behavior -import akka.actor.typed.scaladsl.ActorContext -import akka.actor.typed.scaladsl.Behaviors +import org.apache.pekko.actor.typed.ActorRef +import org.apache.pekko.actor.typed.Behavior +import org.apache.pekko.actor.typed.scaladsl.ActorContext +import org.apache.pekko.actor.typed.scaladsl.Behaviors import io.circe.Codec import io.circe.generic.semiauto.deriveCodec -import org.virtuslab.ash.circe.AkkaCodecs +import org.virtuslab.psh.circe.PekkoCodecs object StatsWorker { - sealed trait Command extends CirceAkkaSerializable + sealed trait Command extends CircePekkoSerializable final case class Process(word: String, replyTo: ActorRef[Processed]) extends Command private case object EvictCache extends Command - final case class Processed(word: String, length: Int) extends CirceAkkaSerializable + final case class Processed(word: String, length: Int) extends CircePekkoSerializable implicit lazy val codecProcessed: Codec[Processed] = deriveCodec - implicit lazy val codecActorRefProcessed: Codec[ActorRef[Processed]] = new AkkaCodecs {}.actorRefCodec + implicit lazy val codecActorRefProcessed: Codec[ActorRef[Processed]] = new PekkoCodecs {}.actorRefCodec implicit lazy val codecCommand: Codec[Command] = deriveCodec def apply(): Behavior[Command] = Behaviors.setup { ctx => diff --git a/examples/akka-cluster-app/.scalafix.conf b/examples/pekko-persistence-app/.scalafix.conf similarity index 78% rename from examples/akka-cluster-app/.scalafix.conf rename to examples/pekko-persistence-app/.scalafix.conf index 56349296..0fa3238b 100644 --- a/examples/akka-cluster-app/.scalafix.conf +++ b/examples/pekko-persistence-app/.scalafix.conf @@ -9,8 +9,8 @@ OrganizeImports { groups = [ "java.", "scala.", - "akka.", + "org.apache.pekko.", "*", - "org.virtuslab.ash" + "org.virtuslab.psh" ] } diff --git a/examples/akka-persistence-app/.scalafmt.conf b/examples/pekko-persistence-app/.scalafmt.conf similarity index 100% rename from examples/akka-persistence-app/.scalafmt.conf rename to examples/pekko-persistence-app/.scalafmt.conf diff --git a/examples/akka-persistence-app/README.md b/examples/pekko-persistence-app/README.md similarity index 65% rename from examples/akka-persistence-app/README.md rename to examples/pekko-persistence-app/README.md index e65962d8..c8ac1694 100644 --- a/examples/akka-persistence-app/README.md +++ b/examples/pekko-persistence-app/README.md @@ -1,12 +1,12 @@ -## akka-persistence-app example project -`akka-persistence-app` is an example project to show real usage of the Dump Persistence Schema Compiler Plugin. -This project uses logic from the [akka-microservices-tutorial](https://developer.lightbend.com/docs/akka-platform-guide/microservices-tutorial/index.html) -(the `shopping-cart-service`), with Akka Serialization Helper added. +## pekko-persistence-app example project +`pekko-persistence-app` is an example project to show real usage of the Dump Persistence Schema Compiler Plugin. +This project uses logic from the [pekko-microservices-tutorial](https://github.com/apache/incubator-pekko-platform-guide/blob/main/docs-source/docs/modules/microservices-tutorial/pages/index.adoc) +(the `shopping-cart-service`), with Pekko Serialization Helper added. ## Dump Persistence Schema Compiler Plugin usage You can test Dump Persistence Schema Compiler Plugin on this example project. There are two possibilities to do it: - `sbt compile` - compiles the project with the `dump-persistence-schema` phase enabled. `dump-persistence-schema` phase dumps detected persistence schema (types for Events and States) into `.json` files under the `target/dump-psersistence-schema-cache` directory of this project. These `.json` files are cache files used later by the `ashDumpPersistenceSchema` sbt task. -- `sbt ashDumpPersistenceSchema` — sbt task that creates final output of the dump using mentioned `.json` files. Output is saved into the `target/akka-persistence-app-dump-persistence-schema-0.1.0-SNAPSHOT.yaml` file. +- `sbt ashDumpPersistenceSchema` — sbt task that creates final output of the dump using mentioned `.json` files. Output is saved into the `target/pekko-persistence-app-dump-persistence-schema-0.1.0-SNAPSHOT.yaml` file. You can just invoke `sbt ashDumpPersistenceSchema` without `sbt compile` — `ashDumpPersistenceSchema` task will invoke `sbt compile` if needed. ## Running the sample code @@ -20,7 +20,7 @@ You can just invoke `sbt ashDumpPersistenceSchema` without `sbt compile` — 2. Create database tables with: ``` - docker exec -i akka-persistence-app_postgres-db_1 psql -U shopping-cart -t < ddl-scripts/create_tables.sql` + docker exec -i pekko-persistence-app_postgres-db_1 psql -U shopping-cart -t < ddl-scripts/create_tables.sql` ``` 3. Start a first node: @@ -47,9 +47,9 @@ You can just invoke `sbt ashDumpPersistenceSchema` without `sbt compile` — grpcurl -d '{"cartId":"cart1", "itemId":"T-shirt", "quantity":3}' -plaintext 127.0.0.1:8101 shoppingcart.ShoppingCartService.AddItem ``` -7. Dump persistence schema with Akka Serialization Helper (after shutting down the application): +7. Dump persistence schema with Pekko Serialization Helper (after shutting down the application): ``` sbt ashDumpPersistenceSchema ``` -Output saved into the `target/akka-persistence-app-dump-persistence-schema-0.1.0-SNAPSHOT.yaml` file. +Output saved into the `target/pekko-persistence-app-dump-persistence-schema-0.1.0-SNAPSHOT.yaml` file. diff --git a/examples/pekko-persistence-app/build.sbt b/examples/pekko-persistence-app/build.sbt new file mode 100644 index 00000000..3f6e9b1e --- /dev/null +++ b/examples/pekko-persistence-app/build.sbt @@ -0,0 +1,79 @@ +import org.virtuslab.psh.PekkoSerializationHelperPlugin + +name := "pekko-persistence-app" + +scalaVersion := "2.13.14" + +Compile / scalacOptions ++= Seq( + "-target:11", + "-deprecation", + "-feature", + "-unchecked", + "-Xlog-reflective-calls", + "-Xlint", + "-Ywarn-unused") +Compile / javacOptions ++= Seq("-Xlint:unchecked", "-Xlint:deprecation") + +Test / parallelExecution := false +Test / logBuffered := false + +fork := true // must be true due to https://discuss.lightbend.com/t/pekko-projection-getting-started-guide-example-could-not-run-eventgeneratorapp/9434/2 +Global / cancelable := false // ctrl-c + +ThisBuild / resolvers += Resolver.ApacheMavenSnapshotsRepo + +val pekkoVersion = "1.0.3" +val pekkoHttpVersion = "1.0.1" +val pekkoHttp2SupportVersion = "0.0.0+4272-045c925b-SNAPSHOT" +val pekkoManagementVersion = "1.0.0" +val pekkoPersistenceJdbcVersion = "1.0.0" +val pekkoProjectionVersion = "1.0.0" +val circeVersion = "0.14.8" +val scalikeJdbcVersion = "3.5.0" + +enablePlugins(PekkoGrpcPlugin, JavaAppPackaging, DockerPlugin, PekkoSerializationHelperPlugin) +dockerBaseImage := "docker.io/library/adoptopenjdk:11-jre-hotspot" +dockerUsername := sys.props.get("docker.username") +dockerRepository := sys.props.get("docker.registry") + +libraryDependencySchemes += "org.apache.pekko" %% "pekko-http-core" % "always" + +libraryDependencies ++= Seq( + // 1. Basic dependencies for a clustered application + "org.apache.pekko" %% "pekko-stream" % pekkoVersion, + "org.apache.pekko" %% "pekko-cluster-typed" % pekkoVersion, + "org.apache.pekko" %% "pekko-cluster-sharding-typed" % pekkoVersion, + "org.apache.pekko" %% "pekko-actor-testkit-typed" % pekkoVersion % Test, + // Pekko Management powers Health Checks and Pekko Cluster Bootstrapping + "org.apache.pekko" %% "pekko-management" % pekkoManagementVersion, + "org.apache.pekko" %% "pekko-http" % pekkoHttpVersion, + "org.apache.pekko" %% "pekko-http-spray-json" % pekkoHttpVersion, + "org.apache.pekko" %% "pekko-management-cluster-http" % pekkoManagementVersion, + "org.apache.pekko" %% "pekko-management-cluster-bootstrap" % pekkoManagementVersion, + "org.apache.pekko" %% "pekko-discovery-kubernetes-api" % pekkoManagementVersion, + "org.apache.pekko" %% "pekko-discovery" % pekkoVersion, + // Common dependencies for logging and testing + "org.apache.pekko" %% "pekko-slf4j" % pekkoVersion, + "ch.qos.logback" % "logback-classic" % "1.5.6", + "org.scalatest" %% "scalatest" % "3.2.12" % Test, + // 2. Using gRPC and/or protobuf + "org.apache.pekko" %% "pekko-http2-support" % pekkoHttp2SupportVersion, + // 3. Using Pekko Persistence + "org.apache.pekko" %% "pekko-persistence-typed" % pekkoVersion, + "org.apache.pekko" %% "pekko-serialization-jackson" % pekkoVersion, + "org.apache.pekko" %% "pekko-persistence-jdbc" % pekkoPersistenceJdbcVersion, + "org.apache.pekko" %% "pekko-persistence-testkit" % pekkoVersion % Test, + "org.postgresql" % "postgresql" % "42.7.3", + // 4. Querying or projecting data from Pekko Persistence + "org.apache.pekko" %% "pekko-persistence-query" % pekkoVersion, + "org.apache.pekko" %% "pekko-projection-eventsourced" % pekkoProjectionVersion, + "org.apache.pekko" %% "pekko-projection-jdbc" % pekkoProjectionVersion, + "org.scalikejdbc" %% "scalikejdbc" % scalikeJdbcVersion, + "org.scalikejdbc" %% "scalikejdbc-config" % scalikeJdbcVersion, + // 5. Dependencies needed to use Pekko Serialization Helper with circe codecs + "io.circe" %% "circe-core" % circeVersion, + PekkoSerializationHelperPlugin.annotation, + PekkoSerializationHelperPlugin.circePekkoSerializer) + +ThisBuild / semanticdbEnabled := true +ThisBuild / semanticdbVersion := "4.9.3" diff --git a/examples/akka-persistence-app/ddl-scripts/create_tables.sql b/examples/pekko-persistence-app/ddl-scripts/create_tables.sql similarity index 83% rename from examples/akka-persistence-app/ddl-scripts/create_tables.sql rename to examples/pekko-persistence-app/ddl-scripts/create_tables.sql index 20c6c62a..6ca417fb 100644 --- a/examples/akka-persistence-app/ddl-scripts/create_tables.sql +++ b/examples/pekko-persistence-app/ddl-scripts/create_tables.sql @@ -53,9 +53,9 @@ CREATE TABLE IF NOT EXISTS public.snapshot ( PRIMARY KEY(persistence_id, sequence_number) ); ---drop table if exists public.akka_projection_offset_store; +--drop table if exists public.pekko_projection_offset_store; -CREATE TABLE IF NOT EXISTS public.akka_projection_offset_store ( +CREATE TABLE IF NOT EXISTS public.pekko_projection_offset_store ( projection_name VARCHAR(255) NOT NULL, projection_key VARCHAR(255) NOT NULL, current_offset VARCHAR(255) NOT NULL, @@ -65,11 +65,11 @@ CREATE TABLE IF NOT EXISTS public.akka_projection_offset_store ( PRIMARY KEY(projection_name, projection_key) ); -CREATE INDEX IF NOT EXISTS projection_name_index ON public.akka_projection_offset_store (projection_name); +CREATE INDEX IF NOT EXISTS projection_name_index ON public.pekko_projection_offset_store (projection_name); ---drop table if exists public.akka_projection_management; +--drop table if exists public.pekko_projection_management; -CREATE TABLE IF NOT EXISTS public.akka_projection_management ( +CREATE TABLE IF NOT EXISTS public.pekko_projection_management ( projection_name VARCHAR(255) NOT NULL, projection_key VARCHAR(255) NOT NULL, paused BOOLEAN NOT NULL, diff --git a/examples/akka-persistence-app/docker-compose.yml b/examples/pekko-persistence-app/docker-compose.yml similarity index 100% rename from examples/akka-persistence-app/docker-compose.yml rename to examples/pekko-persistence-app/docker-compose.yml diff --git a/examples/akka-persistence-app/project/build.properties b/examples/pekko-persistence-app/project/build.properties similarity index 100% rename from examples/akka-persistence-app/project/build.properties rename to examples/pekko-persistence-app/project/build.properties diff --git a/examples/akka-persistence-app/project/plugins.sbt b/examples/pekko-persistence-app/project/plugins.sbt similarity index 50% rename from examples/akka-persistence-app/project/plugins.sbt rename to examples/pekko-persistence-app/project/plugins.sbt index a58c8037..acde4419 100644 --- a/examples/akka-persistence-app/project/plugins.sbt +++ b/examples/pekko-persistence-app/project/plugins.sbt @@ -1,10 +1,10 @@ resolvers += Resolver.ApacheMavenSnapshotsRepo -val akkaGrpcSbtPluginVersion = "2.1.6" -val sbtNativePackagerVersion = "1.9.9" +val pekkoGrpcSbtPluginVersion = "1.0.2" +val sbtNativePackagerVersion = "1.10.0" addSbtPlugin("com.github.sbt" % "sbt-native-packager" % sbtNativePackagerVersion) -addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % akkaGrpcSbtPluginVersion) +addSbtPlugin("org.apache.pekko" % "pekko-grpc-sbt-plugin" % pekkoGrpcSbtPluginVersion) addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1") -addSbtPlugin("org.virtuslab.ash" % "sbt-akka-serialization-helper" % "0.8.0") +addSbtPlugin("org.virtuslab.psh" % "sbt-pekko-serialization-helper" % "0.8.0") diff --git a/examples/akka-persistence-app/project/project/plugins.sbt b/examples/pekko-persistence-app/project/project/plugins.sbt similarity index 100% rename from examples/akka-persistence-app/project/project/plugins.sbt rename to examples/pekko-persistence-app/project/project/plugins.sbt diff --git a/examples/akka-persistence-app/src/main/protobuf/ShoppingCartService.proto b/examples/pekko-persistence-app/src/main/protobuf/ShoppingCartService.proto similarity index 100% rename from examples/akka-persistence-app/src/main/protobuf/ShoppingCartService.proto rename to examples/pekko-persistence-app/src/main/protobuf/ShoppingCartService.proto diff --git a/examples/akka-persistence-app/src/main/resources/application.conf b/examples/pekko-persistence-app/src/main/resources/application.conf similarity index 79% rename from examples/akka-persistence-app/src/main/resources/application.conf rename to examples/pekko-persistence-app/src/main/resources/application.conf index d3434f12..5113089b 100644 --- a/examples/akka-persistence-app/src/main/resources/application.conf +++ b/examples/pekko-persistence-app/src/main/resources/application.conf @@ -3,10 +3,10 @@ include "grpc" include "persistence" include "serialization" -akka { +pekko { loglevel = DEBUG } -akka-persistence-app { +pekko-persistence-app { ask-timeout = 5 s } diff --git a/examples/akka-persistence-app/src/main/resources/cluster.conf b/examples/pekko-persistence-app/src/main/resources/cluster.conf similarity index 75% rename from examples/akka-persistence-app/src/main/resources/cluster.conf rename to examples/pekko-persistence-app/src/main/resources/cluster.conf index e982dfe1..c75faa0c 100644 --- a/examples/akka-persistence-app/src/main/resources/cluster.conf +++ b/examples/pekko-persistence-app/src/main/resources/cluster.conf @@ -1,4 +1,4 @@ -akka { +pekko { actor.provider = cluster remote.artery { @@ -6,7 +6,7 @@ akka { } cluster { - downing-provider-class = "akka.cluster.sbr.SplitBrainResolverProvider" + downing-provider-class = "org.apache.pekko.cluster.sbr.SplitBrainResolverProvider" shutdown-after-unsuccessful-join-seed-nodes = 120s @@ -17,7 +17,7 @@ akka { } } -akka.management { +pekko.management { http { port = 8558 port = ${?HTTP_MGMT_PORT} diff --git a/examples/akka-persistence-app/src/main/resources/grpc.conf b/examples/pekko-persistence-app/src/main/resources/grpc.conf similarity index 69% rename from examples/akka-persistence-app/src/main/resources/grpc.conf rename to examples/pekko-persistence-app/src/main/resources/grpc.conf index 6e322df2..a98adb6b 100644 --- a/examples/akka-persistence-app/src/main/resources/grpc.conf +++ b/examples/pekko-persistence-app/src/main/resources/grpc.conf @@ -1,6 +1,6 @@ -akka.http.server.preview.enable-http2 = on +pekko.http.server.preview.enable-http2 = on -akka-persistence-app { +pekko-persistence-app { grpc { # consider setting this to a specific interface for your environment diff --git a/examples/akka-persistence-app/src/main/resources/local-shared.conf b/examples/pekko-persistence-app/src/main/resources/local-shared.conf similarity index 67% rename from examples/akka-persistence-app/src/main/resources/local-shared.conf rename to examples/pekko-persistence-app/src/main/resources/local-shared.conf index 1c12af4d..65f23dd7 100644 --- a/examples/akka-persistence-app/src/main/resources/local-shared.conf +++ b/examples/pekko-persistence-app/src/main/resources/local-shared.conf @@ -1,11 +1,11 @@ -akka-persistence-app.grpc.interface = "127.0.0.1" -akka.remote.artery.canonical.hostname = "127.0.0.1" -akka.management.http.hostname = "127.0.0.1" +pekko-persistence-app.grpc.interface = "127.0.0.1" +pekko.remote.artery.canonical.hostname = "127.0.0.1" +pekko.management.http.hostname = "127.0.0.1" -## The following setting overrides for Akka Management, Akka Discovery and Akka Projections +## The following setting overrides for Pekko Management, Pekko Discovery and Pekko Projections ## should only be used in a local environment during development. -akka.management.cluster.bootstrap.contact-point-discovery { - service-name = "akka-persistence-app" +pekko.management.cluster.bootstrap.contact-point-discovery { + service-name = "pekko-persistence-app" discovery-method = config # boostrap filters ports with the same IP assuming they are previous instances running on the same node # unless a port is specified @@ -17,10 +17,10 @@ akka.management.cluster.bootstrap.contact-point-discovery { contact-with-all-contact-points = false } -akka.discovery { +pekko.discovery { config { services { - "akka-persistence-app" { + "pekko-persistence-app" { endpoints = [ {host = "127.0.0.1", port = 9101} {host = "127.0.0.1", port = 9102} diff --git a/examples/pekko-persistence-app/src/main/resources/local1.conf b/examples/pekko-persistence-app/src/main/resources/local1.conf new file mode 100644 index 00000000..3e6b1504 --- /dev/null +++ b/examples/pekko-persistence-app/src/main/resources/local1.conf @@ -0,0 +1,7 @@ +include "application" +include "local-shared" + +pekko-persistence-app.grpc.port = 8101 + +pekko.remote.artery.canonical.port = 2551 +pekko.management.http.port = 9101 diff --git a/examples/pekko-persistence-app/src/main/resources/local2.conf b/examples/pekko-persistence-app/src/main/resources/local2.conf new file mode 100644 index 00000000..e4d79f71 --- /dev/null +++ b/examples/pekko-persistence-app/src/main/resources/local2.conf @@ -0,0 +1,7 @@ +include "application" +include "local-shared" + +pekko-persistence-app.grpc.port = 8102 + +pekko.management.http.port = 9102 +pekko.remote.artery.canonical.port = 2552 diff --git a/examples/akka-persistence-app/src/main/resources/logback.xml b/examples/pekko-persistence-app/src/main/resources/logback.xml similarity index 81% rename from examples/akka-persistence-app/src/main/resources/logback.xml rename to examples/pekko-persistence-app/src/main/resources/logback.xml index f4e889fc..a828611a 100644 --- a/examples/akka-persistence-app/src/main/resources/logback.xml +++ b/examples/pekko-persistence-app/src/main/resources/logback.xml @@ -2,7 +2,7 @@ - [%date{ISO8601}] [%level] [%logger] [%X{akkaAddress}] [%marker] [%thread] - %msg%n + [%date{ISO8601}] [%level] [%logger] [%X{pekkoAddress}] [%marker] [%thread] - %msg%n diff --git a/examples/akka-persistence-app/src/main/resources/persistence.conf b/examples/pekko-persistence-app/src/main/resources/persistence.conf similarity index 87% rename from examples/akka-persistence-app/src/main/resources/persistence.conf rename to examples/pekko-persistence-app/src/main/resources/persistence.conf index b89a19ad..8e268877 100644 --- a/examples/akka-persistence-app/src/main/resources/persistence.conf +++ b/examples/pekko-persistence-app/src/main/resources/persistence.conf @@ -1,4 +1,4 @@ -akka { +pekko { # use JDBC plugin to store both snapshots and the events of the persistent actors persistence { journal.plugin = "jdbc-journal" @@ -14,7 +14,7 @@ akka { } } -# These settings configure the database connection for ScalikeJDBC and the akka-persistence-jdbc plugin +# These settings configure the database connection for ScalikeJDBC and the pekko-persistence-jdbc plugin jdbc-connection-settings { driver = "org.postgresql.Driver" @@ -26,11 +26,11 @@ jdbc-connection-settings { # the following properties are used to configure the - # Hikari connection pool used on the read-side (akka-projections) + # Hikari connection pool used on the read-side (pekko-projections) connection-pool { # How many connections should be available to from the pool? # it's recommended to use the same value used by the blocking-jdbc-dispatcher (see above) - max-pool-size = ${akka.projection.jdbc.blocking-jdbc-dispatcher.thread-pool-executor.fixed-pool-size} + max-pool-size = ${pekko.projection.jdbc.blocking-jdbc-dispatcher.thread-pool-executor.fixed-pool-size} # How long should we wait (in millis) before it times out? # In a normal scenario, we should always be able to get a connection @@ -42,7 +42,7 @@ jdbc-connection-settings { } -akka-persistence-jdbc { +pekko-persistence-jdbc { shared-databases { default { # the slick profile must be compatible with the configured jdbc-connection-settings.driver @@ -71,12 +71,12 @@ jdbc-journal { use-shared-db = "default" } -# the akka-persistence-snapshot-store in use +# the pekko-persistence-snapshot-store in use jdbc-snapshot-store { use-shared-db = "default" } -# the akka-persistence-query provider in use +# the pekko-persistence-query provider in use jdbc-read-journal { use-shared-db = "default" } diff --git a/examples/akka-persistence-app/src/main/resources/serialization.conf b/examples/pekko-persistence-app/src/main/resources/serialization.conf similarity index 58% rename from examples/akka-persistence-app/src/main/resources/serialization.conf rename to examples/pekko-persistence-app/src/main/resources/serialization.conf index 3b0421ac..53a2038e 100644 --- a/examples/akka-persistence-app/src/main/resources/serialization.conf +++ b/examples/pekko-persistence-app/src/main/resources/serialization.conf @@ -1,8 +1,8 @@ -akka.actor { +pekko.actor { serializers { circe-json = "org.virtuslab.example.ExampleSerializer" } serialization-bindings { - "org.virtuslab.example.CirceAkkaSerializable" = circe-json + "org.virtuslab.example.CircePekkoSerializable" = circe-json } } diff --git a/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/CircePekkoSerializable.scala b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/CircePekkoSerializable.scala new file mode 100644 index 00000000..4d54c0f1 --- /dev/null +++ b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/CircePekkoSerializable.scala @@ -0,0 +1,6 @@ +package org.virtuslab.example + +import org.virtuslab.psh.annotation.SerializabilityTrait + +@SerializabilityTrait +trait CircePekkoSerializable extends Product with Serializable diff --git a/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala new file mode 100644 index 00000000..865cfd36 --- /dev/null +++ b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/ExampleSerializer.scala @@ -0,0 +1,24 @@ +package org.virtuslab.example + +import org.apache.pekko.actor.ExtendedActorSystem + +import org.virtuslab.psh.annotation.Serializer +import org.virtuslab.psh.circe.CircePekkoSerializer +import org.virtuslab.psh.circe.Register +import org.virtuslab.psh.circe.Registration + +@Serializer(classOf[CircePekkoSerializable], Register.REGISTRATION_REGEX) +class ExampleSerializer(actorSystem: ExtendedActorSystem) + extends CircePekkoSerializer[CircePekkoSerializable](actorSystem) { + override def identifier: Int = 7312 + + override lazy val codecs: Seq[Registration[_ <: CircePekkoSerializable]] = Seq( + Register[ShoppingCart.Command], + Register[ShoppingCart.Event], + Register[ShoppingCart.State], + Register[ShoppingCart.Summary]) + + override lazy val manifestMigrations: Seq[(String, Class[_])] = Nil + + override lazy val packagePrefix: String = "org.virtuslab.example" +} diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/Main.scala b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/Main.scala similarity index 68% rename from examples/akka-persistence-app/src/main/scala/org/virtuslab/example/Main.scala rename to examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/Main.scala index f4df6f0b..cba2cd3a 100644 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/Main.scala +++ b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/Main.scala @@ -2,10 +2,10 @@ package org.virtuslab.example import scala.util.control.NonFatal -import akka.actor.typed.ActorSystem -import akka.actor.typed.scaladsl.Behaviors -import akka.management.cluster.bootstrap.ClusterBootstrap -import akka.management.scaladsl.AkkaManagement +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.scaladsl.Behaviors +import org.apache.pekko.management.cluster.bootstrap.ClusterBootstrap +import org.apache.pekko.management.scaladsl.PekkoManagement import com.typesafe.config.ConfigFactory import org.slf4j.LoggerFactory @@ -17,7 +17,7 @@ object Main { def main(args: Array[String]): Unit = { val chosenConfig = args.headOption.getOrElse( throw new IllegalArgumentException( - "Application started without specifying the akka .conf file in runtime args. " + + "Application started without specifying the pekko .conf file in runtime args. " + "Please, run again with filename added as the first argument. E.g.: `sbt \"run chosen_config.conf\"`")) val config = ConfigFactory.load(chosenConfig) val system = ActorSystem[Nothing](Behaviors.empty, "ShoppingCartService", config) @@ -32,13 +32,13 @@ object Main { } def init(system: ActorSystem[_]): Unit = { - AkkaManagement(system).start() + PekkoManagement(system).start() ClusterBootstrap(system).start() val grpcInterface = - system.settings.config.getString("akka-persistence-app.grpc.interface") + system.settings.config.getString("pekko-persistence-app.grpc.interface") val grpcPort = - system.settings.config.getInt("akka-persistence-app.grpc.port") + system.settings.config.getInt("pekko-persistence-app.grpc.port") val grpcService = new ShoppingCartServiceImpl(system) ShoppingCartServer.start(grpcInterface, grpcPort, system, grpcService) diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala similarity index 75% rename from examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala rename to examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala index f1da7daf..184b974e 100644 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala +++ b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCart.scala @@ -2,24 +2,24 @@ package org.virtuslab.example import scala.concurrent.duration._ -import akka.actor.typed.ActorRef -import akka.actor.typed.ActorSystem -import akka.actor.typed.Behavior -import akka.actor.typed.SupervisorStrategy -import akka.cluster.sharding.typed.scaladsl.ClusterSharding -import akka.cluster.sharding.typed.scaladsl.Entity -import akka.cluster.sharding.typed.scaladsl.EntityTypeKey -import akka.pattern.StatusReply -import akka.persistence.typed.PersistenceId -import akka.persistence.typed.scaladsl.Effect -import akka.persistence.typed.scaladsl.EventSourcedBehavior -import akka.persistence.typed.scaladsl.ReplyEffect -import akka.persistence.typed.scaladsl.RetentionCriteria +import org.apache.pekko.actor.typed.ActorRef +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.Behavior +import org.apache.pekko.actor.typed.SupervisorStrategy +import org.apache.pekko.cluster.sharding.typed.scaladsl.ClusterSharding +import org.apache.pekko.cluster.sharding.typed.scaladsl.Entity +import org.apache.pekko.cluster.sharding.typed.scaladsl.EntityTypeKey +import org.apache.pekko.pattern.StatusReply +import org.apache.pekko.persistence.typed.PersistenceId +import org.apache.pekko.persistence.typed.scaladsl.Effect +import org.apache.pekko.persistence.typed.scaladsl.EventSourcedBehavior +import org.apache.pekko.persistence.typed.scaladsl.ReplyEffect +import org.apache.pekko.persistence.typed.scaladsl.RetentionCriteria import io.circe.Codec import io.circe.generic.semiauto.deriveCodec -import org.virtuslab.ash.circe.AkkaCodecs +import org.virtuslab.psh.circe.PekkoCodecs object ShoppingCart { @@ -46,7 +46,7 @@ object ShoppingCart { /** * This interface defines all the commands (messages) that the ShoppingCart actor supports. */ - sealed trait Command extends CirceAkkaSerializable + sealed trait Command extends CircePekkoSerializable /** * A command to add an item to the cart. @@ -59,12 +59,12 @@ object ShoppingCart { /** * Summary of the shopping cart state, used in reply messages. */ - final case class Summary(items: Map[String, Int]) extends CirceAkkaSerializable + final case class Summary(items: Map[String, Int]) extends CircePekkoSerializable /** * This interface defines all the events that the ShoppingCart supports. */ - sealed trait Event extends CirceAkkaSerializable { + sealed trait Event extends CircePekkoSerializable { def cartId: String } @@ -75,7 +75,7 @@ object ShoppingCart { * @param items * \- Map containing information about items that are in the cart currently */ - final case class State(items: Map[String, Int]) extends CirceAkkaSerializable { + final case class State(items: Map[String, Int]) extends CircePekkoSerializable { def hasItem(itemId: String): Boolean = items.contains(itemId) @@ -94,8 +94,8 @@ object ShoppingCart { val empty: State = State(items = Map.empty) } - // codecs derivation for all types extending CirceAkkaSerializable - implicit lazy val codecActorRefResponse: Codec[ActorRef[StatusReply[Summary]]] = new AkkaCodecs {}.actorRefCodec + // codecs derivation for all types extending CircePekkoSerializable + implicit lazy val codecActorRefResponse: Codec[ActorRef[StatusReply[Summary]]] = new PekkoCodecs {}.actorRefCodec implicit lazy val codecCommand: Codec[Command] = deriveCodec implicit lazy val summaryCommand: Codec[Summary] = deriveCodec implicit lazy val codecEvent: Codec[Event] = deriveCodec diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCartServer.scala b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCartServer.scala similarity index 79% rename from examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCartServer.scala rename to examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCartServer.scala index 4d7878f3..0b7a6e7b 100644 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCartServer.scala +++ b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCartServer.scala @@ -6,12 +6,12 @@ import scala.concurrent.duration._ import scala.util.Failure import scala.util.Success -import akka.actor.typed.ActorSystem -import akka.grpc.scaladsl.ServerReflection -import akka.grpc.scaladsl.ServiceHandler -import akka.http.scaladsl.Http -import akka.http.scaladsl.model.HttpRequest -import akka.http.scaladsl.model.HttpResponse +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.grpc.scaladsl.ServerReflection +import org.apache.pekko.grpc.scaladsl.ServiceHandler +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.model.HttpRequest +import org.apache.pekko.http.scaladsl.model.HttpResponse object ShoppingCartServer { diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCartServiceImpl.scala b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCartServiceImpl.scala similarity index 82% rename from examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCartServiceImpl.scala rename to examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCartServiceImpl.scala index 386afda9..7e4cc68d 100644 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCartServiceImpl.scala +++ b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/ShoppingCartServiceImpl.scala @@ -4,10 +4,10 @@ import java.util.concurrent.TimeoutException import scala.concurrent.Future -import akka.actor.typed.ActorSystem -import akka.cluster.sharding.typed.scaladsl.ClusterSharding -import akka.grpc.GrpcServiceException -import akka.util.Timeout +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.cluster.sharding.typed.scaladsl.ClusterSharding +import org.apache.pekko.grpc.GrpcServiceException +import org.apache.pekko.util.Timeout import io.grpc.Status import org.slf4j.LoggerFactory @@ -19,7 +19,7 @@ class ShoppingCartServiceImpl(system: ActorSystem[_]) extends proto.ShoppingCart private val logger = LoggerFactory.getLogger(getClass) implicit private val timeout: Timeout = - Timeout.create(system.settings.config.getDuration("akka-persistence-app.ask-timeout")) + Timeout.create(system.settings.config.getDuration("pekko-persistence-app.ask-timeout")) private val sharding = ClusterSharding(system) diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSession.scala b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSession.scala similarity index 79% rename from examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSession.scala rename to examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSession.scala index 3756fb59..70a48eb1 100644 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSession.scala +++ b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSession.scala @@ -2,8 +2,8 @@ package org.virtuslab.example.repository import java.sql.Connection -import akka.japi.function.Function -import akka.projection.jdbc.JdbcSession +import org.apache.pekko.japi.function.Function +import org.apache.pekko.projection.jdbc.JdbcSession import scalikejdbc._ @@ -19,7 +19,7 @@ object ScalikeJdbcSession { } /** - * Provide database connections within a transaction to Akka Projections. + * Provide database connections within a transaction to Pekko Projections. */ final class ScalikeJdbcSession extends JdbcSession { val db: DB = DB.connect() diff --git a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala similarity index 98% rename from examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala rename to examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala index 4861fcad..d41bafe8 100644 --- a/examples/akka-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala +++ b/examples/pekko-persistence-app/src/main/scala/org/virtuslab/example/repository/ScalikeJdbcSetup.scala @@ -1,6 +1,6 @@ package org.virtuslab.example.repository -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import com.typesafe.config.Config import com.zaxxer.hikari.HikariDataSource diff --git a/examples/akka-persistence-app/src/test/resources/logback-test.xml b/examples/pekko-persistence-app/src/test/resources/logback-test.xml similarity index 70% rename from examples/akka-persistence-app/src/test/resources/logback-test.xml rename to examples/pekko-persistence-app/src/test/resources/logback-test.xml index 615e2562..1ab4c01b 100644 --- a/examples/akka-persistence-app/src/test/resources/logback-test.xml +++ b/examples/pekko-persistence-app/src/test/resources/logback-test.xml @@ -3,7 +3,7 @@ - [%date{ISO8601}] [%level] [%logger] [%X{akkaAddress}] [%marker] [%thread] - %msg%n + [%date{ISO8601}] [%level] [%logger] [%X{pekkoAddress}] [%marker] [%thread] - %msg%n diff --git a/examples/akka-persistence-app/src/test/resources/persistence-test.conf b/examples/pekko-persistence-app/src/test/resources/persistence-test.conf similarity index 100% rename from examples/akka-persistence-app/src/test/resources/persistence-test.conf rename to examples/pekko-persistence-app/src/test/resources/persistence-test.conf diff --git a/examples/akka-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala b/examples/pekko-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala similarity index 85% rename from examples/akka-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala rename to examples/pekko-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala index 7a3eefc9..a481ee2d 100644 --- a/examples/akka-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala +++ b/examples/pekko-persistence-app/src/test/scala/org.virtuslab/example/ShoppingCartSpec.scala @@ -1,8 +1,8 @@ package org.virtuslab.example -import akka.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit -import akka.pattern.StatusReply -import akka.persistence.testkit.scaladsl.EventSourcedBehaviorTestKit +import org.apache.pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit +import org.apache.pekko.pattern.StatusReply +import org.apache.pekko.persistence.testkit.scaladsl.EventSourcedBehaviorTestKit import com.typesafe.config.ConfigFactory import org.scalatest.BeforeAndAfterEach @@ -11,12 +11,12 @@ import org.scalatest.wordspec.AnyWordSpecLike object ShoppingCartSpec { val config = ConfigFactory .parseString(""" - akka.actor { + pekko.actor { serializers { circe-json = "org.virtuslab.example.ExampleSerializer" } serialization-bindings { - "org.virtuslab.example.CirceAkkaSerializable" = circe-json + "org.virtuslab.example.CircePekkoSerializable" = circe-json } } """) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 4229ff01..2bd4f55a 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -4,10 +4,10 @@ object Dependencies { val scalaVersion213 = "2.13.14" val scalaVersion212 = "2.12.19" - val akkaProjectionVersion = "1.2.5" - val akkaGrpcRuntimeVersion = "2.1.6" - val akkaHttpCorsVersion = "1.2.0" - val akkaVersion = "2.6.20" + val pekkoProjectionVersion = "1.0.0" + val pekkoGrpcRuntimeVersion = "1.0.2" + val pekkoHttpCorsVersion = "1.0.1" + val pekkoVersion = "1.0.3" val borerVersion = "1.8.0" val circeYamlVersion = "1.15.0" val circeVersion = "0.14.8" @@ -20,20 +20,20 @@ object Dependencies { val sprayJson = "io.spray" %% "spray-json" % "1.3.6" val scalaCollectionCompat = "org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0" - val akkaActor = "com.typesafe.akka" %% "akka-actor" % akkaVersion - val akkaActorTyped = "com.typesafe.akka" %% "akka-actor-typed" % akkaVersion - val akkaStream = "com.typesafe.akka" %% "akka-stream" % akkaVersion - val akkaPersistenceTyped = "com.typesafe.akka" %% "akka-persistence-typed" % akkaVersion - val akkaProjections = "com.lightbend.akka" %% "akka-projection-eventsourced" % akkaProjectionVersion - val akkaTestKitTyped = "com.typesafe.akka" %% "akka-actor-testkit-typed" % akkaVersion - val akkaStreamTestKit = "com.typesafe.akka" %% "akka-stream-testkit" % akkaVersion + val pekkoActor = "org.apache.pekko" %% "pekko-actor" % pekkoVersion + val pekkoActorTyped = "org.apache.pekko" %% "pekko-actor-typed" % pekkoVersion + val pekkoStream = "org.apache.pekko" %% "pekko-stream" % pekkoVersion + val pekkoPersistenceTyped = "org.apache.pekko" %% "pekko-persistence-typed" % pekkoVersion + val pekkoProjections = "org.apache.pekko" %% "pekko-projection-eventsourced" % pekkoProjectionVersion + val pekkoTestKitTyped = "org.apache.pekko" %% "pekko-actor-testkit-typed" % pekkoVersion + val pekkoStreamTestKit = "org.apache.pekko" %% "pekko-stream-testkit" % pekkoVersion - val akkaHttpCors = "ch.megard" %% "akka-http-cors" % akkaHttpCorsVersion // required by akka-grpc-runtime - val akkaGrpc = "com.lightbend.akka.grpc" %% "akka-grpc-runtime" % akkaGrpcRuntimeVersion + val pekkoHttpCors = "org.apache.pekko" %% "pekko-http-cors" % pekkoHttpCorsVersion // required by pekko-grpc-runtime + val pekkoGrpc = "org.apache.pekko" %% "pekko-grpc-runtime" % pekkoGrpcRuntimeVersion val borerCore = "io.bullet" %% "borer-core" % borerVersion val borerDerivation = "io.bullet" %% "borer-derivation" % borerVersion - val borerAkka = "io.bullet" %% "borer-compat-akka" % borerVersion + val borerPekko = "io.bullet" %% "borer-compat-pekko" % borerVersion val circeCore = "io.circe" %% "circe-core" % circeVersion val circeGeneric = "io.circe" %% "circe-generic" % circeVersion diff --git a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/build.sbt b/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/build.sbt deleted file mode 100644 index 5687d6a1..00000000 --- a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/build.sbt +++ /dev/null @@ -1,8 +0,0 @@ -val scala213 = "2.13.6" - -name := "dependencies" -version := "0.1" -scalaVersion := scala213 - -enablePlugins(AkkaSerializationHelperPlugin) -libraryDependencies += AkkaSerializationHelperPlugin.circeAkkaSerializer diff --git a/sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/DumpPersistenceSchema.scala b/sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/DumpPersistenceSchema.scala similarity index 91% rename from sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/DumpPersistenceSchema.scala rename to sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/DumpPersistenceSchema.scala index 004c07a8..6a0630a5 100644 --- a/sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/DumpPersistenceSchema.scala +++ b/sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/DumpPersistenceSchema.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh import better.files.{File => SFile, _} import io.circe.generic.auto._ @@ -8,11 +8,11 @@ import sbt.Keys._ import sbt._ import spray.json._ -import org.virtuslab.ash.model._ +import org.virtuslab.psh.model._ object DumpPersistenceSchema { import DumpPersistenceSchemaJsonProtocol._ - import AkkaSerializationHelperPlugin.autoImport._ + import PekkoSerializationHelperPlugin.autoImport._ def apply(outputFile: SFile, inputDirectory: SFile): SFile = { val typeDefinitions = for { diff --git a/sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/AkkaSerializationHelperKeys.scala b/sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/PekkoSerializationHelperKeys.scala similarity index 95% rename from sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/AkkaSerializationHelperKeys.scala rename to sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/PekkoSerializationHelperKeys.scala index 941f2268..be1f682c 100644 --- a/sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/AkkaSerializationHelperKeys.scala +++ b/sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/PekkoSerializationHelperKeys.scala @@ -1,11 +1,11 @@ -package org.virtuslab.ash +package org.virtuslab.psh import sbt.File import sbt.librarymanagement.ModuleID import sbt.settingKey import sbt.taskKey -trait AkkaSerializationHelperKeys { +trait PekkoSerializationHelperKeys { lazy val ashDumpPersistenceSchemaCompilerPlugin = settingKey[ModuleID]("ModuleID of dump persistence plugin") lazy val ashCodecRegistrationCheckerCompilerPlugin = settingKey[ModuleID]("ModuleID of codec registration checker plugin") diff --git a/sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/AkkaSerializationHelperPlugin.scala b/sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/PekkoSerializationHelperPlugin.scala similarity index 91% rename from sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/AkkaSerializationHelperPlugin.scala rename to sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/PekkoSerializationHelperPlugin.scala index cc696c1f..8c60b9f2 100644 --- a/sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/AkkaSerializationHelperPlugin.scala +++ b/sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/PekkoSerializationHelperPlugin.scala @@ -1,17 +1,17 @@ -package org.virtuslab.ash +package org.virtuslab.psh import sbt.Def import sbt.Keys._ import sbt._ -object AkkaSerializationHelperPlugin extends AutoPlugin { +object PekkoSerializationHelperPlugin extends AutoPlugin { - object autoImport extends AkkaSerializationHelperKeys { - val baseAshSettings: Seq[Def.Setting[_]] = AkkaSerializationHelperPlugin.baseAshSettings + object autoImport extends PekkoSerializationHelperKeys { + val baseAshSettings: Seq[Def.Setting[_]] = PekkoSerializationHelperPlugin.baseAshSettings } import autoImport.{baseAshSettings => _, _} - val circeAkkaSerializer = component("circe-akka-serializer") + val circePekkoSerializer = component("circe-pekko-serializer") val annotation = component("annotation") @@ -56,7 +56,7 @@ object AkkaSerializationHelperPlugin extends AutoPlugin { private lazy val ashVersion = getClass.getPackage.getImplementationVersion - private def component(id: String) = "org.virtuslab.ash" %% id % ashVersion + private def component(id: String) = "org.virtuslab.psh" %% id % ashVersion private def ashScalacOptionsInConfig(conf: Configuration) = { inConfig(conf)(ashScalacOptions := { diff --git a/sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/model/DumpPersistenceSchemaJsonProtocol.scala b/sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/model/DumpPersistenceSchemaJsonProtocol.scala similarity index 90% rename from sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/model/DumpPersistenceSchemaJsonProtocol.scala rename to sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/model/DumpPersistenceSchemaJsonProtocol.scala index 1718f7ca..f21494cd 100644 --- a/sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/model/DumpPersistenceSchemaJsonProtocol.scala +++ b/sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/model/DumpPersistenceSchemaJsonProtocol.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.model +package org.virtuslab.psh.model import spray.json.DefaultJsonProtocol import spray.json.JsonFormat diff --git a/sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/model/Field.scala b/sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/model/Field.scala similarity index 60% rename from sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/model/Field.scala rename to sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/model/Field.scala index e10fb82e..25f68185 100644 --- a/sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/model/Field.scala +++ b/sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/model/Field.scala @@ -1,3 +1,3 @@ -package org.virtuslab.ash.model +package org.virtuslab.psh.model case class Field(name: String, typeName: String) diff --git a/sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/model/TypeDefinition.scala b/sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/model/TypeDefinition.scala similarity index 83% rename from sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/model/TypeDefinition.scala rename to sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/model/TypeDefinition.scala index 35a36948..0e403385 100644 --- a/sbt-akka-serialization-helper/src/main/scala/org/virtuslab/ash/model/TypeDefinition.scala +++ b/sbt-pekko-serialization-helper/src/main/scala/org/virtuslab/psh/model/TypeDefinition.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.model +package org.virtuslab.psh.model final case class TypeDefinition( name: String, diff --git a/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/build.sbt b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/build.sbt new file mode 100644 index 00000000..160375fb --- /dev/null +++ b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/build.sbt @@ -0,0 +1,8 @@ +val scala213 = "2.13.6" + +name := "dependencies" +version := "0.1" +scalaVersion := scala213 + +enablePlugins(PekkoSerializationHelperPlugin) +libraryDependencies += PekkoSerializationHelperPlugin.circePekkoSerializer diff --git a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/project/build.properties b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/project/build.properties similarity index 100% rename from sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/project/build.properties rename to sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/project/build.properties diff --git a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/project/plugins.sbt b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/project/plugins.sbt similarity index 70% rename from sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/project/plugins.sbt rename to sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/project/plugins.sbt index 82743cd3..ee14e280 100644 --- a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/project/plugins.sbt +++ b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/project/plugins.sbt @@ -3,4 +3,4 @@ val pluginVersion = sys.props.get("plugin.version") match { case _ => "0.7.3" // default, for the sake of Scala Steward where plugin.version system property isn't defined } -addSbtPlugin("org.virtuslab.ash" % "sbt-akka-serialization-helper" % pluginVersion) +addSbtPlugin("org.virtuslab.psh" % "sbt-pekko-serialization-helper" % pluginVersion) diff --git a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/test b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/test similarity index 100% rename from sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/test rename to sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/dependencies/test diff --git a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/build.sbt b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/build.sbt similarity index 77% rename from sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/build.sbt rename to sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/build.sbt index 2d08aa25..2e6d4956 100644 --- a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/build.sbt +++ b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/build.sbt @@ -4,11 +4,11 @@ lazy val scala212 = "2.12.18" name := "simple-dump" version := "0.1" scalaVersion := scala213 -val akkaVersion = "2.6.20" -libraryDependencies += "com.typesafe.akka" %% "akka-persistence-typed" % akkaVersion +val pekkoVersion = "1.0.3" +libraryDependencies += "org.apache.pekko" %% "pekko-persistence-typed" % pekkoVersion crossScalaVersions := Seq(scala213, scala212) -enablePlugins(AkkaSerializationHelperPlugin) +enablePlugins(PekkoSerializationHelperPlugin) ashCompilerPluginCacheDirectory := crossTarget.value ashDumpPersistenceSchema / ashDumpPersistenceSchemaOutputDirectoryPath := crossTarget.value.getPath ashDumpPersistenceSchema / ashDumpPersistenceSchemaOutputFilename := "dump.yaml" diff --git a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/project/build.properties b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/project/build.properties similarity index 100% rename from sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/project/build.properties rename to sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/project/build.properties diff --git a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/project/plugins.sbt b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/project/plugins.sbt similarity index 70% rename from sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/project/plugins.sbt rename to sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/project/plugins.sbt index 82743cd3..ee14e280 100644 --- a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/project/plugins.sbt +++ b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/project/plugins.sbt @@ -3,4 +3,4 @@ val pluginVersion = sys.props.get("plugin.version") match { case _ => "0.7.3" // default, for the sake of Scala Steward where plugin.version system property isn't defined } -addSbtPlugin("org.virtuslab.ash" % "sbt-akka-serialization-helper" % pluginVersion) +addSbtPlugin("org.virtuslab.psh" % "sbt-pekko-serialization-helper" % pluginVersion) diff --git a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/src/main/scala/Data.scala b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/src/main/scala/Data.scala similarity index 100% rename from sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/src/main/scala/Data.scala rename to sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/src/main/scala/Data.scala diff --git a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/src/main/scala/Triggers.scala b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/src/main/scala/Triggers.scala similarity index 77% rename from sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/src/main/scala/Triggers.scala rename to sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/src/main/scala/Triggers.scala index 28c7c130..49740b60 100644 --- a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/src/main/scala/Triggers.scala +++ b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/src/main/scala/Triggers.scala @@ -1,4 +1,4 @@ -import akka.persistence.typed.scaladsl.Effect +import org.apache.pekko.persistence.typed.scaladsl.Effect import scala.annotation.StaticAnnotation diff --git a/sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/test b/sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/test similarity index 100% rename from sbt-akka-serialization-helper/src/sbt-test/sbt-dumpschema/simple/test rename to sbt-pekko-serialization-helper/src/sbt-test/sbt-dumpschema/simple/test diff --git a/sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.AdditionalData.json b/sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.AdditionalData.json similarity index 100% rename from sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.AdditionalData.json rename to sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.AdditionalData.json diff --git a/sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.ClassTest.json b/sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.ClassTest.json similarity index 100% rename from sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.ClassTest.json rename to sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.ClassTest.json diff --git a/sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.ClassWithAdditionData.json b/sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.ClassWithAdditionData.json similarity index 100% rename from sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.ClassWithAdditionData.json rename to sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.ClassWithAdditionData.json diff --git a/sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.DeepTrait.json b/sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.DeepTrait.json similarity index 100% rename from sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.DeepTrait.json rename to sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.DeepTrait.json diff --git a/sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.DeeperTrait.json b/sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.DeeperTrait.json similarity index 100% rename from sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.DeeperTrait.json rename to sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.DeeperTrait.json diff --git a/sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.DeepestClass.json b/sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.DeepestClass.json similarity index 100% rename from sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.DeepestClass.json rename to sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.DeepestClass.json diff --git a/sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.GenericsTest.json b/sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.GenericsTest.json similarity index 100% rename from sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.GenericsTest.json rename to sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.GenericsTest.json diff --git a/sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.TraitWithAnnotation.json b/sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.TraitWithAnnotation.json similarity index 100% rename from sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.TraitWithAnnotation.json rename to sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.TraitWithAnnotation.json diff --git a/sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.json b/sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.json similarity index 100% rename from sbt-akka-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.json rename to sbt-pekko-serialization-helper/src/test/resources/example-jsons/org.random.project.Data.json diff --git a/sbt-akka-serialization-helper/src/test/resources/target.yaml b/sbt-pekko-serialization-helper/src/test/resources/target.yaml similarity index 100% rename from sbt-akka-serialization-helper/src/test/resources/target.yaml rename to sbt-pekko-serialization-helper/src/test/resources/target.yaml diff --git a/sbt-akka-serialization-helper/src/test/scala/org/virtuslab/ash/DumpPersistenceSchemaSpec.scala b/sbt-pekko-serialization-helper/src/test/scala/org/virtuslab/psh/DumpPersistenceSchemaSpec.scala similarity index 95% rename from sbt-akka-serialization-helper/src/test/scala/org/virtuslab/ash/DumpPersistenceSchemaSpec.scala rename to sbt-pekko-serialization-helper/src/test/scala/org/virtuslab/psh/DumpPersistenceSchemaSpec.scala index f9c37456..f8c7f381 100644 --- a/sbt-akka-serialization-helper/src/test/scala/org/virtuslab/ash/DumpPersistenceSchemaSpec.scala +++ b/sbt-pekko-serialization-helper/src/test/scala/org/virtuslab/psh/DumpPersistenceSchemaSpec.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh import better.files.File import org.scalatest.flatspec.AnyFlatSpecLike diff --git a/scripts/format-code b/scripts/format-code index d8db424e..ddde120e 100755 --- a/scripts/format-code +++ b/scripts/format-code @@ -7,8 +7,8 @@ sbt scalafmtAll scalafixAll scalafmtSbt cd examples/event-migration sbt scalafmtAll scalafixAll scalafmtSbt -cd ../akka-cluster-app +cd ../pekko-cluster-app sbt scalafmtAll scalafixAll scalafmtSbt -cd ../akka-persistence-app +cd ../pekko-persistence-app sbt scalafmtAll scalafixAll scalafmtSbt diff --git a/scripts/substitute-sbt-plugin-snapshot-version b/scripts/substitute-sbt-plugin-snapshot-version index 13c6c90b..7ab75f45 100755 --- a/scripts/substitute-sbt-plugin-snapshot-version +++ b/scripts/substitute-sbt-plugin-snapshot-version @@ -4,10 +4,10 @@ set -e -o pipefail -u sbt publishLocal -version=$(ls -1t ~/.ivy2/local/org.virtuslab.ash/sbt-akka-serialization-helper/scala_2.12/sbt_1.0/ | head -1) +version=$(ls -1t ~/.ivy2/local/org.virtuslab.psh/sbt-pekko-serialization-helper/scala_2.12/sbt_1.0/ | head -1) # Version can be more elegantly extracted using: # sbt -Dsbt.supershell=false -error "print sbtPekkoSerializationHelper/version" # but the problem is that snapshot versions include minute-resolution timestamp, # which is likely to change from the preceding `sbt publishLocal`. -find . -type f | grep '\.sbt$' | xargs sed -E 's/("sbt-akka-serialization-helper") % ".*"/\1 % "'"$version"'"/' -i +find . -type f | grep '\.sbt$' | xargs sed -E 's/("sbt-pekko-serialization-helper") % ".*"/\1 % "'"$version"'"/' -i diff --git a/serializability-checker-compiler-plugin/src/main/resources/scalac-plugin.xml b/serializability-checker-compiler-plugin/src/main/resources/scalac-plugin.xml index 5867f3d4..da11d414 100644 --- a/serializability-checker-compiler-plugin/src/main/resources/scalac-plugin.xml +++ b/serializability-checker-compiler-plugin/src/main/resources/scalac-plugin.xml @@ -1,4 +1,4 @@ serializability-checker-plugin - org.virtuslab.ash.SerializabilityCheckerCompilerPlugin + org.virtuslab.psh.SerializabilityCheckerCompilerPlugin diff --git a/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/ClassKind.scala b/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/ClassKind.scala similarity index 93% rename from serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/ClassKind.scala rename to serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/ClassKind.scala index aeb485e4..a7233949 100644 --- a/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/ClassKind.scala +++ b/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/ClassKind.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh sealed trait ClassKind { val name: String diff --git a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/CrossVersionReporter.scala b/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/CrossVersionReporter.scala similarity index 96% rename from dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/CrossVersionReporter.scala rename to serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/CrossVersionReporter.scala index 913c07a3..de209964 100644 --- a/dump-persistence-schema-compiler-plugin/src/main/scala/org/virtuslab/ash/CrossVersionReporter.scala +++ b/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/CrossVersionReporter.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh import scala.tools.nsc.Global import scala.tools.nsc.reporters.Reporter diff --git a/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/SerializabilityCheckerCompilerPlugin.scala b/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/SerializabilityCheckerCompilerPlugin.scala similarity index 86% rename from serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/SerializabilityCheckerCompilerPlugin.scala rename to serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/SerializabilityCheckerCompilerPlugin.scala index 00c71e5a..6be9778d 100644 --- a/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/SerializabilityCheckerCompilerPlugin.scala +++ b/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/SerializabilityCheckerCompilerPlugin.scala @@ -1,15 +1,15 @@ -package org.virtuslab.ash +package org.virtuslab.psh import scala.tools.nsc.Global import scala.tools.nsc.plugins.Plugin import scala.tools.nsc.plugins.PluginComponent -import org.virtuslab.ash.SerializabilityCheckerCompilerPlugin.Flags._ +import org.virtuslab.psh.SerializabilityCheckerCompilerPlugin.Flags._ class SerializabilityCheckerCompilerPlugin(override val global: Global) extends Plugin { override val name: String = "serializability-checker-plugin" override val description: String = - """checks whether a specified Akka serialization is applied to all messages, events and persistent state classes""" + """checks whether a specified Pekko serialization is applied to all messages, events and persistent state classes""" // Placeholder options private val pluginOptions = new SerializabilityCheckerOptions() @@ -42,10 +42,10 @@ class SerializabilityCheckerCompilerPlugin(override val global: Global) extends override val optionsHelp: Option[String] = Some(s""" |$verbose - print additional info about detected serializability traits and serializable classes - |$disableGenerics - disables detection of messages/events/state based on their usage as a type param of certain classes, e.g. akka.actor.typed.Behavior or akka.persistence.typed.scaladsl.Effect - |$disableGenericMethods - disables detection of messages/events/state based on their usage as generic argument to a method, e.g. akka.actor.typed.scaladsl.ActorContext.ask - |$disableMethods - disables detection of messages/events/state based on type of arguments to a method, e.g. akka.actor.typed.ActorRef.tell - |$disableMethodsUntyped - disables detection of messages/events/state based on type of arguments to a method that takes Any, used for Akka Classic + |$disableGenerics - disables detection of messages/events/state based on their usage as a type param of certain classes, e.g. org.apache.pekko.actor.typed.Behavior or org.apache.pekko.persistence.typed.scaladsl.Effect + |$disableGenericMethods - disables detection of messages/events/state based on their usage as generic argument to a method, e.g. org.apache.pekko.actor.typed.scaladsl.ActorContext.ask + |$disableMethods - disables detection of messages/events/state based on type of arguments to a method, e.g. org.apache.pekko.actor.typed.ActorRef.tell + |$disableMethodsUntyped - disables detection of messages/events/state based on type of arguments to a method that takes Any, used for Pekko Classic |$disableHigherOrderFunctions - disables detection of messages/events/state based on return type of the function given as argument to method |$excludeMessages - exclude all messages from the serializability check |$excludePersistentEvents - exclude all events from the serializability check @@ -68,5 +68,5 @@ object SerializabilityCheckerCompilerPlugin { val excludePersistentStates = "--exclude-persistent-states" val typesExplicitlyMarkedAsSerializable = "--types-explicitly-marked-as-serializable=" } - val serializabilityTraitType = "org.virtuslab.ash.annotation.SerializabilityTrait" + val serializabilityTraitType = "org.virtuslab.psh.annotation.SerializabilityTrait" } diff --git a/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/SerializabilityCheckerCompilerPluginComponent.scala b/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/SerializabilityCheckerCompilerPluginComponent.scala similarity index 70% rename from serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/SerializabilityCheckerCompilerPluginComponent.scala rename to serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/SerializabilityCheckerCompilerPluginComponent.scala index 62dc0db1..86d2f5fd 100644 --- a/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/SerializabilityCheckerCompilerPluginComponent.scala +++ b/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/SerializabilityCheckerCompilerPluginComponent.scala @@ -1,10 +1,10 @@ -package org.virtuslab.ash +package org.virtuslab.psh import scala.tools.nsc.Global import scala.tools.nsc.Phase import scala.tools.nsc.plugins.PluginComponent -import org.virtuslab.ash.SerializabilityCheckerCompilerPlugin.serializabilityTraitType +import org.virtuslab.psh.SerializabilityCheckerCompilerPlugin.serializabilityTraitType class SerializabilityCheckerCompilerPluginComponent(val pluginOptions: SerializabilityCheckerOptions, val global: Global) extends PluginComponent { @@ -21,7 +21,7 @@ class SerializabilityCheckerCompilerPluginComponent(val pluginOptions: Serializa override def newPhase(prev: Phase): Phase = new StdPhase(prev) { - private val akkaSerializabilityTraits = Seq( + private val pekkoSerializabilityTraits = Seq( "com.google.protobuf.GeneratedMessage", "com.google.protobuf.GeneratedMessageV3", "com.typesafe.config.Config", @@ -43,49 +43,49 @@ class SerializabilityCheckerCompilerPluginComponent(val pluginOptions: Serializa "scala.Nothing", "scala.Null") - private val ignoredTypePrefixes = List("akka.") + private val ignoredTypePrefixes = List("org.apache.pekko.") private val genericsToKinds: Map[String, Seq[ClassKind]] = Map( - "akka.actor.typed.ActorSystem" -> Seq(ClassKind.Message), - "akka.actor.typed.ActorRef" -> Seq(ClassKind.Message), - "akka.actor.typed.Behavior" -> Seq(ClassKind.Message), - "akka.actor.typed.RecipientRef" -> Seq(ClassKind.Message), - "akka.pattern.PipeToSupport.PipeableFuture" -> Seq(ClassKind.Message), - "akka.pattern.PipeToSupport.PipeableCompletionStage" -> Seq(ClassKind.Message), - "akka.persistence.typed.scaladsl.ReplyEffect" -> Seq(ClassKind.PersistentEvent, ClassKind.PersistentState), - "akka.persistence.typed.scaladsl.Effect" -> Seq(ClassKind.PersistentEvent), - "akka.persistence.typed.scaladsl.EffectBuilder" -> Seq(ClassKind.PersistentEvent), - "akka.projection.eventsourced.EventEnvelope" -> Seq(ClassKind.PersistentEvent, ClassKind.PersistentState)) + "org.apache.pekko.actor.typed.ActorSystem" -> Seq(ClassKind.Message), + "org.apache.pekko.actor.typed.ActorRef" -> Seq(ClassKind.Message), + "org.apache.pekko.actor.typed.Behavior" -> Seq(ClassKind.Message), + "org.apache.pekko.actor.typed.RecipientRef" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.PipeToSupport.PipeableFuture" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.PipeToSupport.PipeableCompletionStage" -> Seq(ClassKind.Message), + "org.apache.pekko.persistence.typed.scaladsl.ReplyEffect" -> Seq(ClassKind.PersistentEvent, ClassKind.PersistentState), + "org.apache.pekko.persistence.typed.scaladsl.Effect" -> Seq(ClassKind.PersistentEvent), + "org.apache.pekko.persistence.typed.scaladsl.EffectBuilder" -> Seq(ClassKind.PersistentEvent), + "org.apache.pekko.projection.eventsourced.EventEnvelope" -> Seq(ClassKind.PersistentEvent, ClassKind.PersistentState)) private val genericMethodsToKinds: Map[String, Seq[ClassKind]] = Map( - "akka.actor.typed.scaladsl.ActorContext.ask" -> Seq(ClassKind.Message, ClassKind.Message), - "akka.actor.typed.scaladsl.AskPattern.Askable.$qmark" -> Seq(ClassKind.Message), - "akka.pattern.PipeToSupport.pipe" -> Seq(ClassKind.Message), - "akka.pattern.PipeToSupport.pipeCompletionStage" -> Seq(ClassKind.Message)) + "org.apache.pekko.actor.typed.scaladsl.ActorContext.ask" -> Seq(ClassKind.Message, ClassKind.Message), + "org.apache.pekko.actor.typed.scaladsl.AskPattern.Askable.$qmark" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.PipeToSupport.pipe" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.PipeToSupport.pipeCompletionStage" -> Seq(ClassKind.Message)) private val concreteMethodsToKinds: Map[String, Seq[ClassKind]] = Map( - "akka.actor.typed.ActorRef.ActorRefOps.$bang" -> Seq(ClassKind.Message), - "akka.actor.typed.ActorRef.tell" -> Seq(ClassKind.Message), - "akka.actor.typed.RecipientRef.tell" -> Seq(ClassKind.Message)) + "org.apache.pekko.actor.typed.ActorRef.ActorRefOps.$bang" -> Seq(ClassKind.Message), + "org.apache.pekko.actor.typed.ActorRef.tell" -> Seq(ClassKind.Message), + "org.apache.pekko.actor.typed.RecipientRef.tell" -> Seq(ClassKind.Message)) private val concreteUntypedMethodsToKinds: Map[String, Seq[ClassKind]] = Map( - "akka.actor.ActorRef.tell" -> Seq(ClassKind.Message, ClassKind.Ignore), - "akka.actor.ActorRef.$bang" -> Seq(ClassKind.Message), - "akka.actor.ActorRef.forward" -> Seq(ClassKind.Message), - "akka.pattern.AskSupport.ask" -> Seq(ClassKind.Ignore, ClassKind.Message, ClassKind.Ignore), - "akka.pattern.AskSupport.askWithStatus" -> Seq(ClassKind.Ignore, ClassKind.Message, ClassKind.Ignore), - "akka.pattern.AskableActorRef.ask" -> Seq(ClassKind.Message), - "akka.pattern.AskableActorRef.askWithStatus" -> Seq(ClassKind.Message), - "akka.pattern.AskableActorRef.$qmark" -> Seq(ClassKind.Message), - "akka.pattern.AskableActorSelection.ask" -> Seq(ClassKind.Message), - "akka.pattern.AskableActorSelection.$qmark" -> Seq(ClassKind.Message), - "akka.pattern.ExplicitAskSupport.ask" -> Seq(ClassKind.Ignore, ClassKind.Message, ClassKind.Ignore)) + "org.apache.pekko.actor.ActorRef.tell" -> Seq(ClassKind.Message, ClassKind.Ignore), + "org.apache.pekko.actor.ActorRef.$bang" -> Seq(ClassKind.Message), + "org.apache.pekko.actor.ActorRef.forward" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.AskSupport.ask" -> Seq(ClassKind.Ignore, ClassKind.Message, ClassKind.Ignore), + "org.apache.pekko.pattern.AskSupport.askWithStatus" -> Seq(ClassKind.Ignore, ClassKind.Message, ClassKind.Ignore), + "org.apache.pekko.pattern.AskableActorRef.ask" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.AskableActorRef.askWithStatus" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.AskableActorRef.$qmark" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.AskableActorSelection.ask" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.AskableActorSelection.$qmark" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.ExplicitAskSupport.ask" -> Seq(ClassKind.Ignore, ClassKind.Message, ClassKind.Ignore)) private val concreteHigherOrderFunctionsToKinds: Map[String, Seq[ClassKind]] = Map( - "akka.pattern.ExplicitlyAskableActorRef.ask" -> Seq(ClassKind.Message), - "akka.pattern.ExplicitlyAskableActorRef.$qmark" -> Seq(ClassKind.Message), - "akka.pattern.ExplicitlyAskableActorSelection.ask" -> Seq(ClassKind.Message), - "akka.pattern.ExplicitlyAskableActorSelection.$qmark" -> Seq(ClassKind.Message)) + "org.apache.pekko.pattern.ExplicitlyAskableActorRef.ask" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.ExplicitlyAskableActorRef.$qmark" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.ExplicitlyAskableActorSelection.ask" -> Seq(ClassKind.Message), + "org.apache.pekko.pattern.ExplicitlyAskableActorSelection.$qmark" -> Seq(ClassKind.Message)) private val symbolsToKinds: Map[String, Seq[ClassKind]] = genericsToKinds ++ genericMethodsToKinds ++ concreteMethodsToKinds ++ concreteUntypedMethodsToKinds ++ concreteHigherOrderFunctionsToKinds @@ -170,9 +170,9 @@ class SerializabilityCheckerCompilerPluginComponent(val pluginOptions: Serializa reporter.error( detectedPosition, s"""${typeWithClassType.typ - .toString()} is used as Akka ${typeWithClassType.classKind.name} but does not extend a trait annotated with $serializabilityTraitType. + .toString()} is used as Pekko ${typeWithClassType.classKind.name} but does not extend a trait annotated with $serializabilityTraitType. |Passing an object of a class that does NOT extend a trait annotated with $serializabilityTraitType as a ${typeWithClassType.classKind.name} - |may cause Akka to fall back to Java serialization during runtime. + |may cause Pekko to fall back to Java serialization during runtime. | |""".stripMargin) reporter.error( @@ -191,7 +191,7 @@ class SerializabilityCheckerCompilerPluginComponent(val pluginOptions: Serializa None else if (tp.typeSymbol.annotations.exists(_.atp.toString() == serializabilityTraitType)) Some(tp) - else if (akkaSerializabilityTraits.contains(tp.typeSymbol.fullName)) + else if (pekkoSerializabilityTraits.contains(tp.typeSymbol.fullName)) Some(tp) else if (pluginOptions.typesExplicitlyMarkedAsSerializable.contains(tp.typeSymbol.fullName)) Some(tp) diff --git a/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/SerializabilityCheckerOptions.scala b/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/SerializabilityCheckerOptions.scala similarity index 96% rename from serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/SerializabilityCheckerOptions.scala rename to serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/SerializabilityCheckerOptions.scala index 4a7126f8..27714d80 100644 --- a/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/ash/SerializabilityCheckerOptions.scala +++ b/serializability-checker-compiler-plugin/src/main/scala/org/virtuslab/psh/SerializabilityCheckerOptions.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash +package org.virtuslab.psh /** * Scalac forces us to be stateful. PluginComponents must be created during constructor call and plugin receives options by a diff --git a/serializability-checker-compiler-plugin/src/test/resources/AkkaSerializabilityTraitsTest.scala b/serializability-checker-compiler-plugin/src/test/resources/AkkaSerializabilityTraitsTest.scala deleted file mode 100644 index bcb9d3c8..00000000 --- a/serializability-checker-compiler-plugin/src/test/resources/AkkaSerializabilityTraitsTest.scala +++ /dev/null @@ -1,10 +0,0 @@ -package org.random.project - -import akka.actor.typed.Behavior -import org.virtuslab.ash.annotation.SerializabilityTrait - -object AkkaSerializabilityTraitsTest { - def method(): Behavior[RuntimeException] = ??? - - def method2(): Behavior[Int] = ??? -} diff --git a/serializability-checker-compiler-plugin/src/test/resources/AkkaWhitelistTest.scala b/serializability-checker-compiler-plugin/src/test/resources/AkkaWhitelistTest.scala deleted file mode 100644 index 02599f94..00000000 --- a/serializability-checker-compiler-plugin/src/test/resources/AkkaWhitelistTest.scala +++ /dev/null @@ -1,14 +0,0 @@ -package org.random.project - -import akka.actor.typed.ActorSystem -import akka.persistence.query.Offset -import akka.projection.eventsourced.EventEnvelope -import akka.projection.eventsourced.scaladsl.EventSourcedProvider -import akka.projection.scaladsl.SourceProvider -import akka.persistence.typed.scaladsl.ReplyEffect -import akka.actor.typed.Behavior -import akka.NotUsed - -object AkkaWhitelistTest { - def test: EventEnvelope[NotUsed] = ??? -} diff --git a/serializability-checker-compiler-plugin/src/test/resources/AnyNothingTest.scala b/serializability-checker-compiler-plugin/src/test/resources/AnyNothingTest.scala index 1b11ab4f..a5eff366 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/AnyNothingTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/AnyNothingTest.scala @@ -1,7 +1,7 @@ package org.random.project -import akka.actor.typed.ActorSystem -import akka.actor.typed.Behavior +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.Behavior object AnyNothingTest { val one: ActorSystem[Any] = ??? diff --git a/serializability-checker-compiler-plugin/src/test/resources/AskClassicTest.scala b/serializability-checker-compiler-plugin/src/test/resources/AskClassicTest.scala index 9937a505..da3f0adb 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/AskClassicTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/AskClassicTest.scala @@ -1,8 +1,8 @@ package org.random.project -import akka.actor.ActorRef -import akka.pattern._ -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.pattern._ +import org.virtuslab.psh.annotation.SerializabilityTrait object AskClassicTest { final case class Msg() extends MySerializable diff --git a/serializability-checker-compiler-plugin/src/test/resources/AskHigherOrderClassicTest.scala b/serializability-checker-compiler-plugin/src/test/resources/AskHigherOrderClassicTest.scala index ba8a04fc..7372776c 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/AskHigherOrderClassicTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/AskHigherOrderClassicTest.scala @@ -1,8 +1,8 @@ package org.random.project -import akka.actor.ActorRef -import akka.pattern.ExplicitAskSupport -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.pattern.ExplicitAskSupport +import org.virtuslab.psh.annotation.SerializabilityTrait object AskHigherOrderClassicTest extends ExplicitAskSupport { final case class Msg(ref: ActorRef) extends MySerializable diff --git a/serializability-checker-compiler-plugin/src/test/resources/AskRecipientRefTest.scala b/serializability-checker-compiler-plugin/src/test/resources/AskRecipientRefTest.scala index b4f38796..a6b97cd1 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/AskRecipientRefTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/AskRecipientRefTest.scala @@ -1,9 +1,9 @@ package org.random.project -import akka.actor.typed.scaladsl.Behaviors -import akka.actor.typed.{Behavior, RecipientRef} -import akka.util.Timeout -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.actor.typed.scaladsl.Behaviors +import org.apache.pekko.actor.typed.{Behavior, RecipientRef} +import org.apache.pekko.util.Timeout +import org.virtuslab.psh.annotation.SerializabilityTrait import scala.concurrent.duration.DurationInt import scala.util.{Failure, Success} diff --git a/serializability-checker-compiler-plugin/src/test/resources/AskSignClassicTest.scala b/serializability-checker-compiler-plugin/src/test/resources/AskSignClassicTest.scala index 25ebc713..5f7a1d16 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/AskSignClassicTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/AskSignClassicTest.scala @@ -1,9 +1,9 @@ package org.random.project -import akka.actor.ActorRef -import akka.pattern._ -import akka.util.Timeout -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.actor.ActorRef +import org.apache.pekko.pattern._ +import org.apache.pekko.util.Timeout +import org.virtuslab.psh.annotation.SerializabilityTrait object AskSignClassicTest { final case class Msg() extends MySerializable diff --git a/serializability-checker-compiler-plugin/src/test/resources/AskSignTest.scala b/serializability-checker-compiler-plugin/src/test/resources/AskSignTest.scala index d4fee8a0..b7c1d808 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/AskSignTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/AskSignTest.scala @@ -1,10 +1,10 @@ package org.random.project -import akka.actor.typed.scaladsl.Behaviors -import akka.actor.typed.{ActorRef, ActorSystem, Behavior} -import akka.util.Timeout -import akka.actor.typed.scaladsl.AskPattern._ -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.actor.typed.scaladsl.Behaviors +import org.apache.pekko.actor.typed.{ActorRef, ActorSystem, Behavior} +import org.apache.pekko.util.Timeout +import org.apache.pekko.actor.typed.scaladsl.AskPattern._ +import org.virtuslab.psh.annotation.SerializabilityTrait import scala.concurrent.duration.DurationInt import scala.util.{Failure, Success} diff --git a/serializability-checker-compiler-plugin/src/test/resources/AskTest.scala b/serializability-checker-compiler-plugin/src/test/resources/AskTest.scala index 736ba2b3..bf857a8e 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/AskTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/AskTest.scala @@ -1,9 +1,9 @@ package org.random.project -import akka.actor.typed.scaladsl.Behaviors -import akka.actor.typed.{ActorRef, Behavior} -import akka.util.Timeout -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.actor.typed.scaladsl.Behaviors +import org.apache.pekko.actor.typed.{ActorRef, Behavior} +import org.apache.pekko.util.Timeout +import org.virtuslab.psh.annotation.SerializabilityTrait import scala.concurrent.duration.DurationInt import scala.util.{Failure, Success} diff --git a/serializability-checker-compiler-plugin/src/test/resources/BehaviorTest.scala b/serializability-checker-compiler-plugin/src/test/resources/BehaviorTest.scala index 7b7049ed..90bb569e 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/BehaviorTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/BehaviorTest.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.actor.typed.Behavior +import org.apache.pekko.actor.typed.Behavior object BehaviorTest { sealed trait Command extends MySerializable diff --git a/serializability-checker-compiler-plugin/src/test/resources/EffectTest.scala b/serializability-checker-compiler-plugin/src/test/resources/EffectTest.scala index 47233c68..a1a86650 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/EffectTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/EffectTest.scala @@ -1,13 +1,13 @@ package org.random.project -import akka.actor.typed.ActorSystem -import akka.persistence.query.Offset -import akka.projection.eventsourced.EventEnvelope -import akka.projection.eventsourced.scaladsl.EventSourcedProvider -import akka.projection.scaladsl.SourceProvider -import akka.persistence.typed.scaladsl.Effect -import akka.actor.typed.Behavior -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.persistence.query.Offset +import org.apache.pekko.projection.eventsourced.EventEnvelope +import org.apache.pekko.projection.eventsourced.scaladsl.EventSourcedProvider +import org.apache.pekko.projection.scaladsl.SourceProvider +import org.apache.pekko.persistence.typed.scaladsl.Effect +import org.apache.pekko.actor.typed.Behavior +import org.virtuslab.psh.annotation.SerializabilityTrait object EffectTest { diff --git a/serializability-checker-compiler-plugin/src/test/resources/EventEnvelopeTest.scala b/serializability-checker-compiler-plugin/src/test/resources/EventEnvelopeTest.scala index a7b49493..5f4b575b 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/EventEnvelopeTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/EventEnvelopeTest.scala @@ -1,12 +1,12 @@ package org.random.project -import akka.actor.typed.ActorSystem -import akka.persistence.query.Offset -import akka.projection.eventsourced.EventEnvelope -import akka.projection.eventsourced.scaladsl.EventSourcedProvider -import akka.projection.scaladsl.SourceProvider -import akka.persistence.typed.scaladsl.ReplyEffect -import akka.actor.typed.Behavior +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.persistence.query.Offset +import org.apache.pekko.projection.eventsourced.EventEnvelope +import org.apache.pekko.projection.eventsourced.scaladsl.EventSourcedProvider +import org.apache.pekko.projection.scaladsl.SourceProvider +import org.apache.pekko.persistence.typed.scaladsl.ReplyEffect +import org.apache.pekko.actor.typed.Behavior object EventEnvelopeTest { trait Command extends MySerializable diff --git a/serializability-checker-compiler-plugin/src/test/resources/GenericsTest.scala b/serializability-checker-compiler-plugin/src/test/resources/GenericsTest.scala index ad832e99..993246a9 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/GenericsTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/GenericsTest.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.actor.typed.Behavior +import org.apache.pekko.actor.typed.Behavior class GenericsTest[A <: MySerializable] { def method(msg: A): Behavior[A] = ??? diff --git a/serializability-checker-compiler-plugin/src/test/resources/GenericsTest2.scala b/serializability-checker-compiler-plugin/src/test/resources/GenericsTest2.scala index 43a69f93..4f289b7a 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/GenericsTest2.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/GenericsTest2.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.actor.typed.{ActorRef, ActorSystem, Behavior} +import org.apache.pekko.actor.typed.{ActorRef, ActorSystem, Behavior} object GenericsTest2 { def init[T](system: ActorSystem[_], behavior: Behavior[T], name: String): ActorRef[T] = ??? diff --git a/serializability-checker-compiler-plugin/src/test/resources/GenericsTest3.scala b/serializability-checker-compiler-plugin/src/test/resources/GenericsTest3.scala index b84d6bf9..6b13d042 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/GenericsTest3.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/GenericsTest3.scala @@ -1,8 +1,8 @@ package org.random.project -import akka.actor.typed.ActorSystem -import akka.grpc.scaladsl.WebHandler -import akka.http.scaladsl.model.{HttpRequest, HttpResponse} +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.grpc.scaladsl.WebHandler +import org.apache.pekko.http.scaladsl.model.{HttpRequest, HttpResponse} import scala.concurrent.Future diff --git a/serializability-checker-compiler-plugin/src/test/resources/MySerializableAnnotated.scala b/serializability-checker-compiler-plugin/src/test/resources/MySerializableAnnotated.scala index 30a89d31..9b257edb 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/MySerializableAnnotated.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/MySerializableAnnotated.scala @@ -1,6 +1,6 @@ package org.random.project -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.virtuslab.psh.annotation.SerializabilityTrait @SerializabilityTrait trait MySerializable diff --git a/serializability-checker-compiler-plugin/src/test/resources/PekkoSerializabilityTraitsTest.scala b/serializability-checker-compiler-plugin/src/test/resources/PekkoSerializabilityTraitsTest.scala new file mode 100644 index 00000000..5d014a3f --- /dev/null +++ b/serializability-checker-compiler-plugin/src/test/resources/PekkoSerializabilityTraitsTest.scala @@ -0,0 +1,10 @@ +package org.random.project + +import org.apache.pekko.actor.typed.Behavior +import org.virtuslab.psh.annotation.SerializabilityTrait + +object PekkoSerializabilityTraitsTest { + def method(): Behavior[RuntimeException] = ??? + + def method2(): Behavior[Int] = ??? +} diff --git a/serializability-checker-compiler-plugin/src/test/resources/PekkoWhitelistTest.scala b/serializability-checker-compiler-plugin/src/test/resources/PekkoWhitelistTest.scala new file mode 100644 index 00000000..752801a3 --- /dev/null +++ b/serializability-checker-compiler-plugin/src/test/resources/PekkoWhitelistTest.scala @@ -0,0 +1,14 @@ +package org.random.project + +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.persistence.query.Offset +import org.apache.pekko.projection.eventsourced.EventEnvelope +import org.apache.pekko.projection.eventsourced.scaladsl.EventSourcedProvider +import org.apache.pekko.projection.scaladsl.SourceProvider +import org.apache.pekko.persistence.typed.scaladsl.ReplyEffect +import org.apache.pekko.actor.typed.Behavior +import org.apache.pekko.NotUsed + +object PekkoWhitelistTest { + def test: EventEnvelope[NotUsed] = ??? +} diff --git a/serializability-checker-compiler-plugin/src/test/resources/PipeTest.scala b/serializability-checker-compiler-plugin/src/test/resources/PipeTest.scala index 0f49fa06..14ed62dc 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/PipeTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/PipeTest.scala @@ -1,10 +1,10 @@ package org.random.project -import akka.actor.typed.Behavior -import akka.actor.typed.scaladsl.Behaviors -import akka.pattern.pipe -import akka.util.Timeout -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.actor.typed.Behavior +import org.apache.pekko.actor.typed.scaladsl.Behaviors +import org.apache.pekko.pattern.pipe +import org.apache.pekko.util.Timeout +import org.virtuslab.psh.annotation.SerializabilityTrait import scala.concurrent.duration.DurationInt import scala.concurrent.{ExecutionContext, Future} diff --git a/serializability-checker-compiler-plugin/src/test/resources/ReplyEffectTestEvent.scala b/serializability-checker-compiler-plugin/src/test/resources/ReplyEffectTestEvent.scala index f204e173..cf2ee93e 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/ReplyEffectTestEvent.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/ReplyEffectTestEvent.scala @@ -1,7 +1,7 @@ package org.random.project -import akka.persistence.typed.scaladsl.ReplyEffect -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.persistence.typed.scaladsl.ReplyEffect +import org.virtuslab.psh.annotation.SerializabilityTrait object ReplyEffectTestEvent { @SerializabilityTrait diff --git a/serializability-checker-compiler-plugin/src/test/resources/ReplyEffectTestEventAndState.scala b/serializability-checker-compiler-plugin/src/test/resources/ReplyEffectTestEventAndState.scala index 164377b2..580f58d5 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/ReplyEffectTestEventAndState.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/ReplyEffectTestEventAndState.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.persistence.typed.scaladsl.ReplyEffect +import org.apache.pekko.persistence.typed.scaladsl.ReplyEffect object ReplyEffectTestEventAndState { trait Event extends MySerializable diff --git a/serializability-checker-compiler-plugin/src/test/resources/ReplyEffectTestState.scala b/serializability-checker-compiler-plugin/src/test/resources/ReplyEffectTestState.scala index c22a3ba7..54ced2c2 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/ReplyEffectTestState.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/ReplyEffectTestState.scala @@ -1,7 +1,7 @@ package org.random.project -import akka.persistence.typed.scaladsl.ReplyEffect -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.persistence.typed.scaladsl.ReplyEffect +import org.virtuslab.psh.annotation.SerializabilityTrait object ReplyEffectTestState { @SerializabilityTrait diff --git a/serializability-checker-compiler-plugin/src/test/resources/TellClassicTest.scala b/serializability-checker-compiler-plugin/src/test/resources/TellClassicTest.scala index 854ca50b..5058488a 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/TellClassicTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/TellClassicTest.scala @@ -1,7 +1,7 @@ package org.random.project -import akka.actor.ActorRef -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.actor.ActorRef +import org.virtuslab.psh.annotation.SerializabilityTrait object TellClassicTest { final case class Msg() extends MySerializable diff --git a/serializability-checker-compiler-plugin/src/test/resources/TellEitherSeqSetTest.scala b/serializability-checker-compiler-plugin/src/test/resources/TellEitherSeqSetTest.scala index 8db9b870..3952b8d0 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/TellEitherSeqSetTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/TellEitherSeqSetTest.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.actor.ActorRef +import org.apache.pekko.actor.ActorRef object TellEitherSeqSetTest { diff --git a/serializability-checker-compiler-plugin/src/test/resources/TellEitherTest.scala b/serializability-checker-compiler-plugin/src/test/resources/TellEitherTest.scala index 2e075a40..b5c00d3d 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/TellEitherTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/TellEitherTest.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.actor.ActorRef +import org.apache.pekko.actor.ActorRef object TellEitherTest { diff --git a/serializability-checker-compiler-plugin/src/test/resources/TellSeqTest.scala b/serializability-checker-compiler-plugin/src/test/resources/TellSeqTest.scala index 06c2ed07..ab4a8492 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/TellSeqTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/TellSeqTest.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.actor.ActorRef +import org.apache.pekko.actor.ActorRef object TellSeqTest { diff --git a/serializability-checker-compiler-plugin/src/test/resources/TellSetTest.scala b/serializability-checker-compiler-plugin/src/test/resources/TellSetTest.scala index 5c09e4e8..e26af10a 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/TellSetTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/TellSetTest.scala @@ -1,6 +1,6 @@ package org.random.project -import akka.actor.ActorRef +import org.apache.pekko.actor.ActorRef object TellSetTest { diff --git a/serializability-checker-compiler-plugin/src/test/resources/TellSignClassicTest.scala b/serializability-checker-compiler-plugin/src/test/resources/TellSignClassicTest.scala index 341ef637..f59f51a9 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/TellSignClassicTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/TellSignClassicTest.scala @@ -1,7 +1,7 @@ package org.random.project -import akka.actor.ActorRef -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.actor.ActorRef +import org.virtuslab.psh.annotation.SerializabilityTrait object TellSignClassicTest { final case class Msg() extends MySerializable diff --git a/serializability-checker-compiler-plugin/src/test/resources/TellSignTest.scala b/serializability-checker-compiler-plugin/src/test/resources/TellSignTest.scala index ebd45762..bf2f00c4 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/TellSignTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/TellSignTest.scala @@ -1,8 +1,8 @@ package org.random.project -import akka.actor.typed.ActorRef -import akka.actor.typed.scaladsl.Behaviors -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.actor.typed.ActorRef +import org.apache.pekko.actor.typed.scaladsl.Behaviors +import org.virtuslab.psh.annotation.SerializabilityTrait object TellSignTest { @SerializabilityTrait diff --git a/serializability-checker-compiler-plugin/src/test/resources/TellTest.scala b/serializability-checker-compiler-plugin/src/test/resources/TellTest.scala index dd27ccc4..45db6bc5 100644 --- a/serializability-checker-compiler-plugin/src/test/resources/TellTest.scala +++ b/serializability-checker-compiler-plugin/src/test/resources/TellTest.scala @@ -1,8 +1,8 @@ package org.random.project -import akka.actor.typed.ActorRef -import akka.actor.typed.scaladsl.Behaviors -import org.virtuslab.ash.annotation.SerializabilityTrait +import org.apache.pekko.actor.typed.ActorRef +import org.apache.pekko.actor.typed.scaladsl.Behaviors +import org.virtuslab.psh.annotation.SerializabilityTrait object TellTest { @SerializabilityTrait diff --git a/serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/SerializabilityCheckerCompilerPluginComponentSpec.scala b/serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/SerializabilityCheckerCompilerPluginComponentSpec.scala similarity index 92% rename from serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/SerializabilityCheckerCompilerPluginComponentSpec.scala rename to serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/SerializabilityCheckerCompilerPluginComponentSpec.scala index f0d5bbab..39189d39 100644 --- a/serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/SerializabilityCheckerCompilerPluginComponentSpec.scala +++ b/serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/SerializabilityCheckerCompilerPluginComponentSpec.scala @@ -1,11 +1,11 @@ -package org.virtuslab.ash +package org.virtuslab.psh import better.files.File import org.scalatest.matchers.should import org.scalatest.wordspec.AnyWordSpecLike -import org.virtuslab.ash.SerializabilityCheckerCompilerPlugin.Flags._ -import org.virtuslab.ash.compiler.SerializabilityCheckerCompiler +import org.virtuslab.psh.SerializabilityCheckerCompilerPlugin.Flags._ +import org.virtuslab.psh.compiler.SerializabilityCheckerCompiler class SerializabilityCheckerCompilerPluginComponentSpec extends AnyWordSpecLike with should.Matchers { private def getResourceAsString(name: String) = @@ -157,8 +157,8 @@ class SerializabilityCheckerCompilerPluginComponentSpec extends AnyWordSpecLike pluginFlags = List(excludePersistentEvents, excludePersistentStates)) } - "whitelist all Akka types from checks" in { - expectNoSerializabilityErrors("AkkaWhitelistTest.scala", pluginFlags = List()) + "whitelist all Pekko types from checks" in { + expectNoSerializabilityErrors("PekkoWhitelistTest.scala", pluginFlags = List()) } "be able to detect serializer trait in generics" in { @@ -178,8 +178,8 @@ class SerializabilityCheckerCompilerPluginComponentSpec extends AnyWordSpecLike pluginFlags = List(disableGenericMethods, disableMethods, disableMethodsUntyped, disableHigherOrderFunctions)) } - "respect Akka serializers" in { - val code = getResourceAsString("AkkaSerializabilityTraitsTest.scala") + "respect Pekko serializers" in { + val code = getResourceAsString("PekkoSerializabilityTraitsTest.scala") SerializabilityCheckerCompiler.compileCode(List(mySerializableNotAnnotated, code)) should be("") } @@ -190,17 +190,17 @@ class SerializabilityCheckerCompilerPluginComponentSpec extends AnyWordSpecLike "fail on usage of Either as a message" in { val code = getResourceAsString("TellEitherTest.scala") - SerializabilityCheckerCompiler.compileCode(List(code)) should include("Right[Nothing,String] is used as Akka message") + SerializabilityCheckerCompiler.compileCode(List(code)) should include("Right[Nothing,String] is used as Pekko message") } "fail on usage of Seq as a message" in { val code = getResourceAsString("TellSeqTest.scala") - SerializabilityCheckerCompiler.compileCode(List(code)) should include("Seq[String] is used as Akka message") + SerializabilityCheckerCompiler.compileCode(List(code)) should include("Seq[String] is used as Pekko message") } "fail on usage of Set as a message" in { val code = getResourceAsString("TellSetTest.scala") - SerializabilityCheckerCompiler.compileCode(List(code)) should include("Set[String] is used as Akka message") + SerializabilityCheckerCompiler.compileCode(List(code)) should include("Set[String] is used as Pekko message") } "not fail on usage of Either as a message when Either is explicitly marked as serializable" in { @@ -215,9 +215,9 @@ class SerializabilityCheckerCompilerPluginComponentSpec extends AnyWordSpecLike val output = SerializabilityCheckerCompiler.compileCode( List(code), List(typesExplicitlyMarkedAsSerializable + "scala.util.Either,scala.collection.immutable.Set")) - output should include("Seq[String] is used as Akka message") - (output should not).include("Right[Nothing,String] is used as Akka message") - (output should not).include("Set[String] is used as Akka message") + output should include("Seq[String] is used as Pekko message") + (output should not).include("Right[Nothing,String] is used as Pekko message") + (output should not).include("Set[String] is used as Pekko message") } } } diff --git a/serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/compiler/SerializabilityCheckerCompiler.scala b/serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/compiler/SerializabilityCheckerCompiler.scala similarity index 95% rename from serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/compiler/SerializabilityCheckerCompiler.scala rename to serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/compiler/SerializabilityCheckerCompiler.scala index 07938786..e58bc0db 100644 --- a/serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/compiler/SerializabilityCheckerCompiler.scala +++ b/serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/compiler/SerializabilityCheckerCompiler.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.compiler +package org.virtuslab.psh.compiler import java.io.BufferedReader import java.io.PrintWriter @@ -15,7 +15,7 @@ import scala.tools.nsc.io.VirtualDirectory import scala.tools.nsc.reporters.ConsoleReporter import scala.tools.nsc.util.ClassPath -import org.virtuslab.ash.SerializabilityCheckerCompilerPlugin +import org.virtuslab.psh.SerializabilityCheckerCompilerPlugin object SerializabilityCheckerCompiler { def compileCode(code: List[String], args: List[String] = List.empty): String = { diff --git a/serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/compiler/SerializabilityCheckerCompilerSpec.scala b/serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/compiler/SerializabilityCheckerCompilerSpec.scala similarity index 94% rename from serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/compiler/SerializabilityCheckerCompilerSpec.scala rename to serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/compiler/SerializabilityCheckerCompilerSpec.scala index 83d135e1..7e5990d8 100644 --- a/serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/ash/compiler/SerializabilityCheckerCompilerSpec.scala +++ b/serializability-checker-compiler-plugin/src/test/scala/org/virtuslab/psh/compiler/SerializabilityCheckerCompilerSpec.scala @@ -1,4 +1,4 @@ -package org.virtuslab.ash.compiler +package org.virtuslab.psh.compiler import org.scalatest.flatspec.AnyFlatSpecLike import org.scalatest.matchers.should.Matchers