-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile most modules with Scala Native #384
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
28aadf3
Compile most modules with Scala Native
ybasket d45eaf7
Add remaining modules for Scala Native
ybasket 8d9cc23
Bump some dependencies to make build happy
ybasket 9f8c0b5
Try without crossProject
ybasket ed12a2b
Fix 2.12 Scala version
ybasket d2111f9
Work around fatal jawn exceptions
ybasket 12e472e
Remove usage of INothing
ybasket 7f33631
Fix some compiler warnings
ybasket a3b7734
Update POM info
ybasket cd4968e
Re-add collection compat imports for 2.12
ybasket eaebe6b
Add Scala 3 support for Play! Json
ybasket b830d53
empty commit to trigger CI
ybasket b6072ee
Allow manual CI run
ybasket a7d4aae
Merge branch 'series/1.5.x' into scala-native
ybasket File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
scala: [2.12.16, 2.13.8, 3.1.3] | ||
scala: [2.12.17, 2.13.8, 3.2.0] | ||
java: [[email protected]] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
val scala212 = "2.12.16" | ||
val scala212 = "2.12.17" | ||
val scala213 = "2.13.8" | ||
val scala3 = "3.1.3" | ||
val fs2Version = "3.2.12" | ||
val circeVersion = "0.14.2" | ||
val circeExtrasVersion = "0.14.1" | ||
val playVersion = "2.9.2" | ||
val scala3 = "3.2.0" | ||
val fs2Version = "3.3.0" | ||
val circeVersion = "0.14.3" | ||
val circeExtrasVersion = "0.14.2" | ||
val playVersion = "2.10.0-RC6" | ||
val shapeless2Version = "2.3.9" | ||
val shapeless3Version = "3.1.0" | ||
val shapeless3Version = "3.2.0" | ||
val scalaJavaTimeVersion = "2.4.0" | ||
val diffsonVersion = "4.1.1" | ||
val diffsonVersion = "4.3.0" | ||
val literallyVersion = "1.1.0" | ||
val weaverVersion = "0.8.0" | ||
|
||
val copyrightYears = "2019-2022" | ||
|
||
ThisBuild / resolvers ++= Resolver.sonatypeOssRepos("snapshots") | ||
|
||
val commonSettings = List( | ||
scalaVersion := scala213, | ||
crossScalaVersions := Seq(scala213, scala212, scala3), | ||
|
@@ -64,11 +67,11 @@ val commonSettings = List( | |
"io.circe" %%% "circe-jawn" % circeVersion % "test", | ||
"io.circe" %%% "circe-generic" % circeVersion % "test", | ||
"co.fs2" %%% "fs2-io" % fs2Version % "test", | ||
"com.disneystreaming" %%% "weaver-cats" % "0.7.15" % "test", | ||
"com.disneystreaming" %%% "weaver-cats-core" % "0.7.15" % "test", | ||
"com.disneystreaming" %%% "weaver-core" % "0.7.15" % "test", | ||
"com.disneystreaming" %%% "weaver-framework" % "0.7.15" % "test", | ||
"com.eed3si9n.expecty" %%% "expecty" % "0.15.4" % "test", | ||
"com.disneystreaming" %%% "weaver-cats" % weaverVersion % "test", | ||
"com.disneystreaming" %%% "weaver-cats-core" % weaverVersion % "test", | ||
"com.disneystreaming" %%% "weaver-core" % weaverVersion % "test", | ||
"com.disneystreaming" %%% "weaver-framework" % weaverVersion % "test", | ||
"com.eed3si9n.expecty" %%% "expecty" % "0.16.0" % "test", | ||
"org.portable-scala" %%% "portable-scala-reflect" % "1.1.2" cross CrossVersion.for3Use2_13 | ||
) ++ PartialFunction | ||
.condOpt(CrossVersion.partialVersion(scalaVersion.value)) { case Some((2, _)) => | ||
|
@@ -92,12 +95,16 @@ val publishSettings = List( | |
Developer(id = "satabin", | ||
name = "Lucas Satabin", | ||
email = "[email protected]", | ||
url = url("https://github.com/satabin")) | ||
url = url("https://github.com/satabin")), | ||
Developer(id = "ybasket", | ||
name = "Yannick Heiber", | ||
email = "[email protected]", | ||
url = url("https://github.com/ybasket")) | ||
), | ||
pomExtra := ( | ||
<ciManagement> | ||
<system>travis</system> | ||
<url>https://travis-ci.org/#!/satabin/fs2-data</url> | ||
<system>GitHub Actions</system> | ||
<url>https://github.com/satabin/fs2-data/actions</url> | ||
</ciManagement> | ||
<issueManagement> | ||
<system>github</system> | ||
|
@@ -115,18 +122,31 @@ val root = (project in file(".")) | |
publish / skip := true, | ||
ScalaUnidoc / unidoc / unidocProjectFilter := inAnyProject -- inProjects( | ||
cbor.js, | ||
cbor.native, | ||
cborJson.js, | ||
cborJson.native, | ||
csv.js, | ||
csv.native, | ||
csvGeneric.js, | ||
csvGeneric.native, | ||
json.js, | ||
json.native, | ||
jsonCirce.js, | ||
jsonCirce.native, | ||
jsonDiffson.js, | ||
jsonDiffson.native, | ||
jsonPlay.js, | ||
jsonInterpolators.js, | ||
jsonInterpolators.native, | ||
text.js, | ||
text.native, | ||
xml.js, | ||
xml.native, | ||
scalaXml.js, | ||
finiteState.js | ||
scalaXml.native, | ||
finiteState.js, | ||
finiteState.native, | ||
benchmarks.jvm | ||
), | ||
ScalaUnidoc / siteSubdirName := "api", | ||
addMappingsToSiteDir(ScalaUnidoc / packageDoc / mappings, ScalaUnidoc / siteSubdirName), | ||
|
@@ -137,31 +157,45 @@ val root = (project in file(".")) | |
.aggregate( | ||
text.jvm, | ||
text.js, | ||
text.native, | ||
csv.jvm, | ||
csv.js, | ||
csv.native, | ||
csvGeneric.jvm, | ||
csvGeneric.js, | ||
csvGeneric.native, | ||
json.jvm, | ||
json.js, | ||
json.native, | ||
jsonCirce.jvm, | ||
jsonCirce.js, | ||
jsonCirce.native, | ||
jsonDiffson.jvm, | ||
jsonDiffson.js, | ||
jsonDiffson.native, | ||
jsonInterpolators.jvm, | ||
jsonInterpolators.js, | ||
jsonInterpolators.native, | ||
jsonPlay.jvm, | ||
jsonPlay.js, | ||
xml.jvm, | ||
xml.js, | ||
xml.native, | ||
scalaXml.jvm, | ||
scalaXml.js, | ||
scalaXml.native, | ||
cbor.jvm, | ||
cbor.js, | ||
cbor.native, | ||
cborJson.jvm, | ||
cborJson.js, | ||
cborJson.native, | ||
finiteState.jvm, | ||
finiteState.js | ||
finiteState.js, | ||
finiteState.native | ||
) | ||
|
||
lazy val text = crossProject(JVMPlatform, JSPlatform) | ||
lazy val text = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.crossType(CrossType.Full) | ||
.in(file("text")) | ||
.settings(commonSettings) | ||
|
@@ -171,7 +205,7 @@ lazy val text = crossProject(JVMPlatform, JSPlatform) | |
description := "Utilities for textual data format" | ||
) | ||
|
||
lazy val csv = crossProject(JVMPlatform, JSPlatform) | ||
lazy val csv = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.crossType(CrossType.Full) | ||
.in(file("csv")) | ||
.settings(commonSettings) | ||
|
@@ -186,7 +220,7 @@ lazy val csv = crossProject(JVMPlatform, JSPlatform) | |
) | ||
.dependsOn(text) | ||
|
||
lazy val csvGeneric = crossProject(JVMPlatform, JSPlatform) | ||
lazy val csvGeneric = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.crossType(CrossType.Full) | ||
.in(file("csv/generic")) | ||
.settings(commonSettings) | ||
|
@@ -227,7 +261,7 @@ lazy val csvGeneric = crossProject(JVMPlatform, JSPlatform) | |
.jsSettings(libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % scalaJavaTimeVersion % Test) | ||
.dependsOn(csv) | ||
|
||
lazy val json = crossProject(JVMPlatform, JSPlatform) | ||
lazy val json = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.crossType(CrossType.Pure) | ||
.in(file("json")) | ||
.settings(commonSettings) | ||
|
@@ -245,7 +279,7 @@ lazy val json = crossProject(JVMPlatform, JSPlatform) | |
) | ||
.dependsOn(text, finiteState) | ||
|
||
lazy val jsonCirce = crossProject(JVMPlatform, JSPlatform) | ||
lazy val jsonCirce = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.crossType(CrossType.Pure) | ||
.in(file("json/circe")) | ||
.settings(commonSettings) | ||
|
@@ -269,22 +303,21 @@ lazy val jsonCirce = crossProject(JVMPlatform, JSPlatform) | |
.dependsOn(json % "compile->compile;test->test", jsonDiffson % "test->test") | ||
|
||
lazy val jsonPlay = crossProject(JVMPlatform, JSPlatform) | ||
.crossType(CrossType.Full) | ||
.crossType(CrossType.Pure) | ||
.in(file("json/play")) | ||
.settings(commonSettings) | ||
.settings(publishSettings) | ||
.settings( | ||
name := "fs2-data-json-play", | ||
description := "Streaming JSON library with support for Play! JSON ASTs", | ||
crossScalaVersions := Seq(scala212, scala213), | ||
libraryDependencies ++= List( | ||
"com.typesafe.play" %%% "play-json" % playVersion, | ||
"org.gnieh" %%% "diffson-play-json" % diffsonVersion % "test" | ||
) | ||
) | ||
.dependsOn(json % "compile->compile;test->test", jsonDiffson % "test->test") | ||
|
||
lazy val jsonDiffson = crossProject(JVMPlatform, JSPlatform) | ||
lazy val jsonDiffson = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.crossType(CrossType.Pure) | ||
.in(file("json/diffson")) | ||
.settings(commonSettings) | ||
|
@@ -298,7 +331,7 @@ lazy val jsonDiffson = crossProject(JVMPlatform, JSPlatform) | |
) | ||
.dependsOn(json % "compile->compile;test->test") | ||
|
||
lazy val jsonInterpolators = crossProject(JVMPlatform, JSPlatform) | ||
lazy val jsonInterpolators = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.crossType(CrossType.Pure) | ||
.in(file("json/interpolators")) | ||
.settings(commonSettings) | ||
|
@@ -316,7 +349,7 @@ lazy val jsonInterpolators = crossProject(JVMPlatform, JSPlatform) | |
) | ||
.dependsOn(json % "compile->compile;test->test") | ||
|
||
lazy val xml = crossProject(JVMPlatform, JSPlatform) | ||
lazy val xml = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.crossType(CrossType.Pure) | ||
.in(file("xml")) | ||
.settings(commonSettings) | ||
|
@@ -337,7 +370,7 @@ lazy val xml = crossProject(JVMPlatform, JSPlatform) | |
) | ||
.dependsOn(text, finiteState) | ||
|
||
lazy val scalaXml = crossProject(JVMPlatform, JSPlatform) | ||
lazy val scalaXml = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.crossType(CrossType.Pure) | ||
.in(file("xml/scala-xml")) | ||
.settings(commonSettings) | ||
|
@@ -352,7 +385,7 @@ lazy val scalaXml = crossProject(JVMPlatform, JSPlatform) | |
) | ||
.dependsOn(xml % "compile->compile;test->test") | ||
|
||
lazy val cbor = crossProject(JVMPlatform, JSPlatform) | ||
lazy val cbor = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.crossType(CrossType.Full) | ||
.in(file("cbor")) | ||
.settings(commonSettings) | ||
|
@@ -371,7 +404,7 @@ lazy val cbor = crossProject(JVMPlatform, JSPlatform) | |
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule)) | ||
) | ||
|
||
lazy val finiteState = crossProject(JVMPlatform, JSPlatform) | ||
lazy val finiteState = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.crossType(CrossType.Full) | ||
.in(file("finite-state")) | ||
.settings(commonSettings) | ||
|
@@ -381,7 +414,7 @@ lazy val finiteState = crossProject(JVMPlatform, JSPlatform) | |
description := "Streaming finite state machines" | ||
) | ||
|
||
lazy val cborJson = crossProject(JVMPlatform, JSPlatform) | ||
lazy val cborJson = crossProject(JVMPlatform, JSPlatform, NativePlatform) | ||
.crossType(CrossType.Full) | ||
.in(file("cbor-json")) | ||
.settings(commonSettings) | ||
|
@@ -405,7 +438,7 @@ lazy val documentation = project | |
mdocIn := file("documentation/docs"), | ||
mdocOut := file("site/content/documentation"), | ||
libraryDependencies ++= List( | ||
"com.beachape" %% "enumeratum" % "1.5.15", | ||
"com.beachape" %% "enumeratum" % "1.7.0", | ||
"org.gnieh" %% "diffson-circe" % diffsonVersion, | ||
"io.circe" %% "circe-generic-extras" % circeExtrasVersion, | ||
"co.fs2" %% "fs2-io" % fs2Version | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,9 @@ package fs2.data.csv | |
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes to fix compiler warnings from 3.2.0. |
||
trait LiteralCellDecoders { | ||
|
||
private[this] abstract class LiteralCellDecoder[A, L <: A](decodeA: CellDecoder[A], L: ValueOf[L]) | ||
extends CellDecoder[L] { | ||
protected[this] def check(a: A): Boolean | ||
protected[this] def message: String | ||
private abstract class LiteralCellDecoder[A, L <: A](decodeA: CellDecoder[A], L: ValueOf[L]) extends CellDecoder[L] { | ||
protected[csv] def check(a: A): Boolean | ||
protected[csv] def message: String | ||
|
||
final def apply(s: String): DecoderResult[L] = decodeA(s) match { | ||
case r @ Right(value) if check(value) => r.asInstanceOf[DecoderResult[L]] | ||
|
@@ -31,56 +30,56 @@ trait LiteralCellDecoders { | |
|
||
implicit final def literalStringDecoder[L <: String](implicit L: ValueOf[L]): CellDecoder[L] = | ||
new LiteralCellDecoder[String, L](CellDecoder.stringDecoder, L) { | ||
protected[this] final def check(a: String): Boolean = a == L.value | ||
protected[this] final def message: String = s"""String("${L.value}")""" | ||
protected[csv] final def check(a: String): Boolean = a == L.value | ||
protected[csv] final def message: String = s"""String("${L.value}")""" | ||
} | ||
|
||
implicit final def literalCharDecoder[L <: Char](implicit L: ValueOf[L]): CellDecoder[L] = | ||
new LiteralCellDecoder[Char, L](CellDecoder.charDecoder, L) { | ||
protected[this] final def check(a: Char): Boolean = a == L.value | ||
protected[this] final def message: String = s"""Char("${L.value}")""" | ||
protected[csv] final def check(a: Char): Boolean = a == L.value | ||
protected[csv] final def message: String = s"""Char("${L.value}")""" | ||
} | ||
|
||
implicit final def literalByteDecoder[L <: Byte](implicit L: ValueOf[L]): CellDecoder[L] = | ||
new LiteralCellDecoder[Byte, L](CellDecoder.byteDecoder, L) { | ||
protected[this] final def check(a: Byte): Boolean = a == L.value | ||
protected[this] final def message: String = s"""Byte("${L.value}")""" | ||
protected[csv] final def check(a: Byte): Boolean = a == L.value | ||
protected[csv] final def message: String = s"""Byte("${L.value}")""" | ||
} | ||
|
||
implicit final def literalShortDecoder[L <: Short](implicit L: ValueOf[L]): CellDecoder[L] = | ||
new LiteralCellDecoder[Short, L](CellDecoder.shortDecoder, L) { | ||
protected[this] final def check(a: Short): Boolean = a == L.value | ||
protected[this] final def message: String = s"""Short("${L.value}")""" | ||
protected[csv] final def check(a: Short): Boolean = a == L.value | ||
protected[csv] final def message: String = s"""Short("${L.value}")""" | ||
} | ||
|
||
implicit final def literalIntDecoder[L <: Int](implicit L: ValueOf[L]): CellDecoder[L] = | ||
new LiteralCellDecoder[Int, L](CellDecoder.intDecoder, L) { | ||
protected[this] final def check(a: Int): Boolean = a == L.value | ||
protected[this] final def message: String = s"""Int("${L.value}")""" | ||
protected[csv] final def check(a: Int): Boolean = a == L.value | ||
protected[csv] final def message: String = s"""Int("${L.value}")""" | ||
} | ||
|
||
implicit final def literalLongDecoder[L <: Long](implicit L: ValueOf[L]): CellDecoder[L] = | ||
new LiteralCellDecoder[Long, L](CellDecoder.longDecoder, L) { | ||
protected[this] final def check(a: Long): Boolean = a == L.value | ||
protected[this] final def message: String = s"""Long("${L.value}")""" | ||
protected[csv] final def check(a: Long): Boolean = a == L.value | ||
protected[csv] final def message: String = s"""Long("${L.value}")""" | ||
} | ||
|
||
implicit final def literalFloatDecoder[L <: Float](implicit L: ValueOf[L]): CellDecoder[L] = | ||
new LiteralCellDecoder[Float, L](CellDecoder.floatDecoder, L) { | ||
protected[this] final def check(a: Float): Boolean = java.lang.Float.compare(L.value, a) == 0 | ||
protected[this] final def message: String = s"""Float("${L.value}")""" | ||
protected[csv] final def check(a: Float): Boolean = java.lang.Float.compare(L.value, a) == 0 | ||
protected[csv] final def message: String = s"""Float("${L.value}")""" | ||
} | ||
|
||
implicit final def literalDoubleDecoder[L <: Double](implicit L: ValueOf[L]): CellDecoder[L] = | ||
new LiteralCellDecoder[Double, L](CellDecoder.doubleDecoder, L) { | ||
protected[this] final def check(a: Double): Boolean = java.lang.Double.compare(L.value, a) == 0 | ||
protected[this] final def message: String = s"""Double("${L.value}")""" | ||
protected[csv] final def check(a: Double): Boolean = java.lang.Double.compare(L.value, a) == 0 | ||
protected[csv] final def message: String = s"""Double("${L.value}")""" | ||
} | ||
|
||
implicit final def literalBooleanDecoder[L <: Boolean](implicit L: ValueOf[L]): CellDecoder[L] = | ||
new LiteralCellDecoder[Boolean, L](CellDecoder.booleanDecoder, L) { | ||
protected[this] final def check(a: Boolean): Boolean = a == L.value | ||
protected[this] final def message: String = s"""Boolean("${L.value}")""" | ||
protected[csv] final def check(a: Boolean): Boolean = a == L.value | ||
protected[csv] final def message: String = s"""Boolean("${L.value}")""" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact they were missing didn't seem to bother anyone, the only published version was 1.3.0: https://mvnrepository.com/artifact/org.gnieh/fs2-data-json-play
Trying to fix this now within this PR by releasing full Diffson support.
I'm in favour of dropping support in v2, that library seems rather dead and the code we maintain is so small that it could easily be inlined in users' projects.