Compile akka-serialization-jackson with Scala 3 (#30408)
Tests compile but one test fails - possibly because of the mixed Jackson versions. Took inspiration from #30361 Refs #30243
This commit is contained in:
parent
ac70b1db38
commit
fc1a375f51
6 changed files with 17 additions and 9 deletions
|
|
@ -38,7 +38,7 @@ jobs:
|
||||||
- stage: scala3
|
- stage: scala3
|
||||||
name: scala3
|
name: scala3
|
||||||
# separate job since only a few modules compile with Scala 3 yet
|
# separate job since only a few modules compile with Scala 3 yet
|
||||||
script: jabba install adopt@1.11-0 && jabba use adopt@1.11-0 && sbt -Dakka.build.scalaVersion=3.0 "akka-actor-tests/test:compile" akka-actor-testkit-typed/compile akka-actor-typed/compile akka-discovery/compile akka-pki/test:compile akka-protobuf/test:compile akka-protobuf-v3/test:compile akka-slf4j/test:compile akka-stream/compile akka-stream-tests-tck/test akka-coordination/test
|
script: jabba install adopt@1.11-0 && jabba use adopt@1.11-0 && sbt -Dakka.build.scalaVersion=3.0 "akka-actor-tests/test:compile" akka-actor-testkit-typed/compile akka-actor-typed/compile akka-discovery/compile akka-pki/test:compile akka-protobuf/test:compile akka-protobuf-v3/test:compile akka-slf4j/test:compile akka-stream/compile akka-stream-tests-tck/test akka-coordination/test akka-serialization-jackson/test:compile
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- name: whitesource
|
- name: whitesource
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ import akka.util.OptionVal
|
||||||
// TODO issue #27107: it should be possible to implement ByteBufferSerializer as well, using Jackson's
|
// TODO issue #27107: it should be possible to implement ByteBufferSerializer as well, using Jackson's
|
||||||
// ByteBufferBackedOutputStream/ByteBufferBackedInputStream
|
// ByteBufferBackedOutputStream/ByteBufferBackedInputStream
|
||||||
|
|
||||||
private val log = Logging.withMarker(system, getClass)
|
private val log = Logging.withMarker(system, classOf[JacksonSerializer])
|
||||||
private val conf = JacksonObjectMapperProvider.configForBinding(bindingName, system.settings.config)
|
private val conf = JacksonObjectMapperProvider.configForBinding(bindingName, system.settings.config)
|
||||||
private val isDebugEnabled = conf.getBoolean("verbose-debug-logging") && log.isDebugEnabled
|
private val isDebugEnabled = conf.getBoolean("verbose-debug-logging") && log.isDebugEnabled
|
||||||
private final val BufferSize = 1024 * 4
|
private final val BufferSize = 1024 * 4
|
||||||
|
|
|
||||||
|
|
@ -151,8 +151,8 @@ object ScalaTestMessages {
|
||||||
}
|
}
|
||||||
|
|
||||||
final case class WithAkkaSerializer(
|
final case class WithAkkaSerializer(
|
||||||
@JsonDeserialize(using = classOf[AkkaSerializationDeserializer])
|
@JsonDeserialize(`using` = classOf[AkkaSerializationDeserializer])
|
||||||
@JsonSerialize(using = classOf[AkkaSerializationSerializer])
|
@JsonSerialize(`using` = classOf[AkkaSerializationSerializer])
|
||||||
akkaSerializer: HasAkkaSerializer)
|
akkaSerializer: HasAkkaSerializer)
|
||||||
extends TestMessage
|
extends TestMessage
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ object CustomAdtSerializer {
|
||||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer
|
import com.fasterxml.jackson.databind.deser.std.StdDeserializer
|
||||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer
|
import com.fasterxml.jackson.databind.ser.std.StdSerializer
|
||||||
|
|
||||||
@JsonSerialize(using = classOf[DirectionJsonSerializer])
|
@JsonSerialize(`using` = classOf[DirectionJsonSerializer])
|
||||||
@JsonDeserialize(using = classOf[DirectionJsonDeserializer])
|
@JsonDeserialize(`using` = classOf[DirectionJsonDeserializer])
|
||||||
sealed trait Direction
|
sealed trait Direction
|
||||||
|
|
||||||
object Direction {
|
object Direction {
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ object SerializationDocSpec {
|
||||||
final case class Lion(name: String) extends Animal
|
final case class Lion(name: String) extends Animal
|
||||||
final case class Elephant(name: String, age: Int) extends Animal
|
final case class Elephant(name: String, age: Int) extends Animal
|
||||||
|
|
||||||
@JsonDeserialize(using = classOf[UnicornDeserializer])
|
@JsonDeserialize(`using` = classOf[UnicornDeserializer])
|
||||||
sealed trait Unicorn extends Animal
|
sealed trait Unicorn extends Animal
|
||||||
@JsonTypeName("unicorn")
|
@JsonTypeName("unicorn")
|
||||||
case object Unicorn extends Unicorn
|
case object Unicorn extends Unicorn
|
||||||
|
|
|
||||||
|
|
@ -293,14 +293,22 @@ object Dependencies {
|
||||||
jacksonCore,
|
jacksonCore,
|
||||||
jacksonAnnotations,
|
jacksonAnnotations,
|
||||||
jacksonDatabind,
|
jacksonDatabind,
|
||||||
jacksonScala,
|
|
||||||
jacksonJdk8,
|
jacksonJdk8,
|
||||||
jacksonJsr310,
|
jacksonJsr310,
|
||||||
jacksonParameterNames,
|
jacksonParameterNames,
|
||||||
jacksonCbor,
|
jacksonCbor,
|
||||||
lz4Java,
|
lz4Java,
|
||||||
Test.junit,
|
Test.junit,
|
||||||
Test.scalatest)
|
Test.scalatest) ++
|
||||||
|
(if (getScalaVersion() == scala3Version)
|
||||||
|
// jackson-module-scala is only available for Scala 3 from 2.13.0 onwards.
|
||||||
|
// since we don't depend on it ourselves, but provide it as a transitive
|
||||||
|
// dependency for convenience, we can leave it out for Scala 3 for now,
|
||||||
|
// and depend on 2.13.0-rc1 for our tests. Eventually we should consider
|
||||||
|
// whether to update all jackson artifacts for Scala 3.
|
||||||
|
Seq("com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.13.0-rc1" % "test")
|
||||||
|
else
|
||||||
|
Seq(jacksonScala))
|
||||||
|
|
||||||
val osgi = l ++= Seq(
|
val osgi = l ++= Seq(
|
||||||
osgiCore,
|
osgiCore,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue