Skip to content

Commit

Permalink
Merge pull request #15 from findify/release-0.5.0
Browse files Browse the repository at this point in the history
Fix build on 2.12
  • Loading branch information
shuttie authored May 2, 2022
2 parents 5ff84ab + 12bb0a1 commit 2c4e962
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 20 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
java: [8, 11]
java: [11, 17]
scala: [2.12.15, 2.13.8]
platform: [ubuntu-20.04]
steps:
- uses: actions/checkout@v2
Expand All @@ -37,4 +38,5 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-
- name: Run tests
run: sbt test
run: sbt "++ ${{ matrix.scala }} test"

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ more Scala-specific TypeSerializer & TypeInformation derivation support.
* has no silent fallback to Kryo: it will just fail the compilation in a case when serializer cannot be made
* reuses all the low-level serialization code from Flink for basic Java and Scala types
* supports Scala 2.12 & 2.13.
* built for Flink 1.15, which supports arbitrary Scala versions.
* built for scala-free Flink 1.15, which supports arbitrary Scala versions.

Issues:
* as this project relies on macro to derive TypeSerializer instances, if you're using IntelliJ 2020.*, it may
highlight your code with red, hinting that it cannot find corresponding implicits. And this is fine, the code
compiles OK. 2021 is fine with serializers derived with this library.
compiles OK. 2022.1 is fine with serializers derived with this library.

## Usage

`flink-adt` is released to Maven-central. For SBT, add this snippet to `build.sbt`:
```scala
libraryDependencies += "io.findify" %% "flink-adt" % "0.4.5"
libraryDependencies += "io.findify" %% "flink-adt" % "0.5.0"
```

To use this library, swap `import org.apache.flink.api.scala._` with `import io.findify.flinkadt.api._` and enjoy.
Expand Down Expand Up @@ -70,7 +70,7 @@ may have issues while migrating state snapshots from TraversableSerializer to Fl

The MIT License (MIT)

Copyright (c) 2021 Findify AB
Copyright (c) 2022 Findify AB

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
8 changes: 3 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "flink-adt"

version := "0.4.5"
version := "0.5.0"

lazy val `scala 2.12` = "2.12.15"
lazy val `scala 2.13` = "2.13.8"
Expand All @@ -19,11 +19,11 @@ publishTo := sonatypePublishToBundle.value
lazy val flinkVersion = "1.15.0"

libraryDependencies ++= Seq(
"com.softwaremill.magnolia1_2" %% "magnolia" % "1.1.2",
"org.apache.flink" % "flink-java" % flinkVersion % "provided",
"org.apache.flink" % "flink-test-utils" % flinkVersion % "test",
"org.scalatest" %% "scalatest" % "3.2.11" % "test",
"org.scalatest" %% "scalatest" % "3.2.12" % "test",
"org.typelevel" %% "cats-core" % "2.7.0" % "test",
"com.softwaremill.magnolia1_2" %% "magnolia" % "1.1.2",
"org.scala-lang" % "scala-reflect" % scalaVersion.value
)

Expand All @@ -36,5 +36,3 @@ scmInfo := Some(
developers := List(
Developer(id = "romangrebennikov", name = "Roman Grebennikov", email = "[email protected]", url = url("https://dfdx.me/"))
)

publishLocalConfiguration / publishMavenStyle := true
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.6.1
sbt.version = 1.6.2
12 changes: 5 additions & 7 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.2")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.12")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.findify.flinkadt.api

import magnolia1.Magnolia
import org.apache.flink.api.common.typeinfo.TypeInformation
import scala.language.experimental.macros

trait LowPrioImplicits {
implicit def deriveTypeInformation[T]: TypeInformation[T] = macro Magnolia.gen[T]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ object ScalaCaseClassSerializer {
val classMirror = rootMirror.reflectClass(classSymbol)
val constructorMethodMirror = classMirror.reflectConstructor(primaryConstructorSymbol)

arr: Array[AnyRef] => {
(arr: Array[AnyRef]) => {
constructorMethodMirror.apply(arr: _*).asInstanceOf[T]
}
}
Expand Down

0 comments on commit 2c4e962

Please sign in to comment.