Skip to content
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

Update dependencies, add Scala Native support for circe integration, add jsoniter-scala integration #7

Merged
merged 23 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c2383d7
Update dependencies, add Scala Native support for circe integration, …
plokhotnyuk Sep 19, 2022
bffae25
Update tlBaseVersion to 0.3.0
plokhotnyuk Sep 19, 2022
dc72ec8
Update build.sbt
ybasket Sep 19, 2022
2a7f700
Update result of `sbt githubWorkflowGenerate`
plokhotnyuk Sep 19, 2022
6e1ef9f
Fix compilation errors with Scala 3
plokhotnyuk Sep 19, 2022
df255c4
Disable expected warnings
plokhotnyuk Sep 19, 2022
191f268
Clean up comments
plokhotnyuk Sep 19, 2022
d0870f8
A workaround to build Java 8 bytecode using Java 11
plokhotnyuk Sep 19, 2022
876e75c
Run githubWorkflowGenerate to reflect JDK versions
ybasket Sep 19, 2022
5e5b9f7
Code and tests clean up
plokhotnyuk Sep 20, 2022
8c7f18f
Add missing check for required fields
plokhotnyuk Sep 20, 2022
fb68d35
Fix formatting
plokhotnyuk Sep 20, 2022
9be4612
Update docs
plokhotnyuk Sep 20, 2022
2d1e068
Clean up build
plokhotnyuk Sep 20, 2022
62919b4
Add missing checking for `}` when parsing `Geometry` types
plokhotnyuk Sep 20, 2022
2149dba
Update Scala 2.13.x to 2.13.9
plokhotnyuk Sep 20, 2022
df773a9
Add missing tests for serialization and fix codecs to pass them
plokhotnyuk Sep 21, 2022
1d684ee
Fix formatting
plokhotnyuk Sep 21, 2022
300655b
Fix compilation error with Scala 2.12.x
plokhotnyuk Sep 28, 2022
677d772
Fix Scala 3 compiler warnings
plokhotnyuk Sep 28, 2022
9463a02
Bump the base version and turn on binary compatibility checks
plokhotnyuk Sep 28, 2022
2a32e33
Fix Scala version in workflows
ybasket Sep 30, 2022
a3998ed
Downgrade to Scala 2.13.8
ybasket Sep 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.16, 2.13.8, 3.1.3]
java: [temurin@8]
scala: [2.12.17, 2.13.8, 3.2.0]
java: [temurin@11]
project: [rootJS, rootJVM, rootNative]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -38,21 +38,21 @@ jobs:
with:
fetch-depth: 0

- name: Download Java (temurin@8)
id: download-java-temurin-8
if: matrix.java == 'temurin@8'
- name: Download Java (temurin@11)
id: download-java-temurin-11
if: matrix.java == 'temurin@11'
uses: typelevel/download-java@v1
with:
distribution: temurin
java-version: 8
java-version: 11

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
distribution: jdkfile
java-version: 8
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}
java-version: 11
jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v2
Expand All @@ -70,7 +70,7 @@ jobs:
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' 'project /' githubWorkflowCheck

- name: Check headers and formatting
if: matrix.java == 'temurin@8'
if: matrix.java == 'temurin@11'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck

- name: scalaJSLink
Expand All @@ -85,20 +85,20 @@ jobs:
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test

- name: Check binary compatibility
if: matrix.java == 'temurin@8'
if: matrix.java == 'temurin@11'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' mimaReportBinaryIssues

- name: Generate API documentation
if: matrix.java == 'temurin@8'
if: matrix.java == 'temurin@11'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' doc

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: mkdir -p circe/.jvm/target target polyline/js/target .js/target core/.native/target core/.js/target circe/.js/target core/.jvm/target .jvm/target .native/target polyline/jvm/target polyline/native/target project/target
run: mkdir -p jsoniter-scala/.native/target circe/.jvm/target target polyline/js/target .js/target core/.native/target core/.js/target circe/.js/target core/.jvm/target .jvm/target .native/target polyline/jvm/target circe/.native/target jsoniter-scala/.jvm/target polyline/native/target jsoniter-scala/.js/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: tar cf targets.tar circe/.jvm/target target polyline/js/target .js/target core/.native/target core/.js/target circe/.js/target core/.jvm/target .jvm/target .native/target polyline/jvm/target polyline/native/target project/target
run: tar cf targets.tar jsoniter-scala/.native/target circe/.jvm/target target polyline/js/target .js/target core/.native/target core/.js/target circe/.js/target core/.jvm/target .jvm/target .native/target polyline/jvm/target circe/.native/target jsoniter-scala/.jvm/target polyline/native/target jsoniter-scala/.js/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
Expand All @@ -115,29 +115,29 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.13.8]
java: [temurin@8]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Download Java (temurin@8)
id: download-java-temurin-8
if: matrix.java == 'temurin@8'
- name: Download Java (temurin@11)
id: download-java-temurin-11
if: matrix.java == 'temurin@11'
uses: typelevel/download-java@v1
with:
distribution: temurin
java-version: 8
java-version: 11

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
distribution: jdkfile
java-version: 8
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}
java-version: 11
jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }}

- name: Cache sbt
uses: actions/cache@v2
Expand All @@ -151,32 +151,32 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (2.12.16, rootJS)
- name: Download target directories (2.12.17, rootJS)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootJS
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJS

- name: Inflate target directories (2.12.16, rootJS)
- name: Inflate target directories (2.12.17, rootJS)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.12.16, rootJVM)
- name: Download target directories (2.12.17, rootJVM)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootJVM
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJVM

- name: Inflate target directories (2.12.16, rootJVM)
- name: Inflate target directories (2.12.17, rootJVM)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (2.12.16, rootNative)
- name: Download target directories (2.12.17, rootNative)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootNative
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootNative

- name: Inflate target directories (2.12.16, rootNative)
- name: Inflate target directories (2.12.17, rootNative)
run: |
tar xf targets.tar
rm targets.tar
Expand Down Expand Up @@ -211,32 +211,32 @@ jobs:
tar xf targets.tar
rm targets.tar

- name: Download target directories (3.1.3, rootJS)
- name: Download target directories (3.2.0, rootJS)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootJS
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.0-rootJS

- name: Inflate target directories (3.1.3, rootJS)
- name: Inflate target directories (3.2.0, rootJS)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (3.1.3, rootJVM)
- name: Download target directories (3.2.0, rootJVM)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootJVM
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.0-rootJVM

- name: Inflate target directories (3.1.3, rootJVM)
- name: Inflate target directories (3.2.0, rootJVM)
run: |
tar xf targets.tar
rm targets.tar

- name: Download target directories (3.1.3, rootNative)
- name: Download target directories (3.2.0, rootNative)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootNative
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.0-rootNative

- name: Inflate target directories (3.1.3, rootNative)
- name: Inflate target directories (3.2.0, rootNative)
run: |
tar xf targets.tar
rm targets.tar
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.gnieh/geo-scala-core_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.gnieh/geo-scala-core_2.13)
[![Continuous Integration](https://github.com/gnieh/geo-scala/actions/workflows/ci.yml/badge.svg)](https://github.com/gnieh/geo-scala/actions/workflows/ci.yml)

A core AST and utilities for GeoJSON ([RFC 7946][rfc-7946]) and more. Builds for Scala 3, 2.13 and 2.12 on JVM, JS and partially Scala Native.
A core AST and utilities for GeoJSON ([RFC 7946][rfc-7946]) and more. Builds for Scala 3, 2.13, and 2.12 on JVM, JS, and Scala Native.

The project is divided in several submodules:
- `core` contains the data model for geographical entities;
- `circe` contains a set of [circe][circe] encoders and decoders for GeoJSON data model;
- `jsoniter-scala` contains a set of [jsoniter-scala][jsoniter-scala] codecs for GeoJSON data model;
- `polyline` contains utilities to convert GeoJSON line strings to and from [polylines][polyline].

## Quickstart
Expand Down Expand Up @@ -42,4 +43,5 @@ Unless required by applicable law or agreed to in writing, software distributed

[rfc-7946]: https://tools.ietf.org/html/rfc7946
[circe]: https://circe.github.io/circe
[jsoniter-scala]: https://github.com/plokhotnyuk/jsoniter-scala
[polyline]: https://developers.google.com/maps/documentation/utilities/polylineutility
42 changes: 29 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
val scala212 = "2.12.16"
val scala212 = "2.12.17"
val scala213 = "2.13.8"
val scala3 = "3.1.3"
val scala3 = "3.2.0"

ThisBuild / tlBaseVersion := "0.2"
ThisBuild / tlBaseVersion := "0.4"

ThisBuild / organization := "org.gnieh"
ThisBuild / organizationName := "GHM Mobile Development GmbH"
Expand All @@ -16,18 +16,17 @@ ThisBuild / tlSonatypeUseLegacyHost := true

ThisBuild / crossScalaVersions := Seq(scala212, scala213, scala3)
ThisBuild / scalaVersion := scala213 // the default Scala
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11"))
ThisBuild / tlJdkRelease := Some(8)

lazy val root = tlCrossRootProject.aggregate(core, circe, polyline).settings(name := "geo-scala")
lazy val root = tlCrossRootProject.aggregate(core, circe, jsoniterScala, polyline).settings(name := "geo-scala")

lazy val commonSettings = Seq(
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % "3.2.12" % Test,
"org.scalatest" %%% "scalatest" % "3.2.13" % Test,
"org.scalatestplus" %%% "scalacheck-1-16" % "3.2.13.0" % Test,
"org.scalacheck" %%% "scalacheck" % "1.16.0" % Test
),
// disable MiMa until we have proper version released on gnieh / all platforms
// once removed, the tlBaseVersion has to adjusted as well
mimaPreviousArtifacts := Set.empty
)
)

lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
Expand All @@ -39,16 +38,33 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
)
)

val circeVersion = "0.14.2"
lazy val circe = crossProject(JVMPlatform, JSPlatform)
val circeVersion = "0.14.3"
lazy val circe = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("circe"))
.dependsOn(core)
.settings(
commonSettings ++ Seq(
name := "geo-scala-circe",
libraryDependencies += "io.circe" %%% "circe-core" % circeVersion,
libraryDependencies += "io.circe" %%% "circe-parser" % circeVersion % Test
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion % Test
)
)
)

val jsoniterScalaVersion = "2.17.4"
lazy val jsoniterScala = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("jsoniter-scala"))
.dependsOn(core)
.settings(
commonSettings ++ Seq(
name := "geo-scala-jsoniter-scala",
libraryDependencies ++= Seq(
"com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-core" % jsoniterScalaVersion,
"com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-macros" % jsoniterScalaVersion % Provided
)
)
)

Expand Down
Loading