Skip to content

Commit 1592087

Browse files
authored
Merge pull request #7 from plokhotnyuk/main
Update dependencies, add Scala Native support for circe integration, add jsoniter-scala integration
2 parents 71f93a6 + a3998ed commit 1592087

File tree

9 files changed

+490
-183
lines changed

9 files changed

+490
-183
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
strategy:
2929
matrix:
3030
os: [ubuntu-latest]
31-
scala: [2.12.16, 2.13.8, 3.1.3]
32-
java: [temurin@8]
31+
scala: [2.12.17, 2.13.8, 3.2.0]
32+
java: [temurin@11]
3333
project: [rootJS, rootJVM, rootNative]
3434
runs-on: ${{ matrix.os }}
3535
steps:
@@ -38,21 +38,21 @@ jobs:
3838
with:
3939
fetch-depth: 0
4040

41-
- name: Download Java (temurin@8)
42-
id: download-java-temurin-8
43-
if: matrix.java == 'temurin@8'
41+
- name: Download Java (temurin@11)
42+
id: download-java-temurin-11
43+
if: matrix.java == 'temurin@11'
4444
uses: typelevel/download-java@v1
4545
with:
4646
distribution: temurin
47-
java-version: 8
47+
java-version: 11
4848

49-
- name: Setup Java (temurin@8)
50-
if: matrix.java == 'temurin@8'
49+
- name: Setup Java (temurin@11)
50+
if: matrix.java == 'temurin@11'
5151
uses: actions/setup-java@v2
5252
with:
5353
distribution: jdkfile
54-
java-version: 8
55-
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}
54+
java-version: 11
55+
jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }}
5656

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

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

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

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

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

9595
- name: Make target directories
9696
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
97-
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
97+
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
9898

9999
- name: Compress target directories
100100
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
101-
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
101+
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
102102

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

126-
- name: Download Java (temurin@8)
127-
id: download-java-temurin-8
128-
if: matrix.java == 'temurin@8'
126+
- name: Download Java (temurin@11)
127+
id: download-java-temurin-11
128+
if: matrix.java == 'temurin@11'
129129
uses: typelevel/download-java@v1
130130
with:
131131
distribution: temurin
132-
java-version: 8
132+
java-version: 11
133133

134-
- name: Setup Java (temurin@8)
135-
if: matrix.java == 'temurin@8'
134+
- name: Setup Java (temurin@11)
135+
if: matrix.java == 'temurin@11'
136136
uses: actions/setup-java@v2
137137
with:
138138
distribution: jdkfile
139-
java-version: 8
140-
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}
139+
java-version: 11
140+
jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }}
141141

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

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

159-
- name: Inflate target directories (2.12.16, rootJS)
159+
- name: Inflate target directories (2.12.17, rootJS)
160160
run: |
161161
tar xf targets.tar
162162
rm targets.tar
163163
164-
- name: Download target directories (2.12.16, rootJVM)
164+
- name: Download target directories (2.12.17, rootJVM)
165165
uses: actions/download-artifact@v2
166166
with:
167-
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootJVM
167+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootJVM
168168

169-
- name: Inflate target directories (2.12.16, rootJVM)
169+
- name: Inflate target directories (2.12.17, rootJVM)
170170
run: |
171171
tar xf targets.tar
172172
rm targets.tar
173173
174-
- name: Download target directories (2.12.16, rootNative)
174+
- name: Download target directories (2.12.17, rootNative)
175175
uses: actions/download-artifact@v2
176176
with:
177-
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootNative
177+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.17-rootNative
178178

179-
- name: Inflate target directories (2.12.16, rootNative)
179+
- name: Inflate target directories (2.12.17, rootNative)
180180
run: |
181181
tar xf targets.tar
182182
rm targets.tar
@@ -211,32 +211,32 @@ jobs:
211211
tar xf targets.tar
212212
rm targets.tar
213213
214-
- name: Download target directories (3.1.3, rootJS)
214+
- name: Download target directories (3.2.0, rootJS)
215215
uses: actions/download-artifact@v2
216216
with:
217-
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootJS
217+
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.0-rootJS
218218

219-
- name: Inflate target directories (3.1.3, rootJS)
219+
- name: Inflate target directories (3.2.0, rootJS)
220220
run: |
221221
tar xf targets.tar
222222
rm targets.tar
223223
224-
- name: Download target directories (3.1.3, rootJVM)
224+
- name: Download target directories (3.2.0, rootJVM)
225225
uses: actions/download-artifact@v2
226226
with:
227-
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootJVM
227+
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.0-rootJVM
228228

229-
- name: Inflate target directories (3.1.3, rootJVM)
229+
- name: Inflate target directories (3.2.0, rootJVM)
230230
run: |
231231
tar xf targets.tar
232232
rm targets.tar
233233
234-
- name: Download target directories (3.1.3, rootNative)
234+
- name: Download target directories (3.2.0, rootNative)
235235
uses: actions/download-artifact@v2
236236
with:
237-
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.3-rootNative
237+
name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.0-rootNative
238238

239-
- name: Inflate target directories (3.1.3, rootNative)
239+
- name: Inflate target directories (3.2.0, rootNative)
240240
run: |
241241
tar xf targets.tar
242242
rm targets.tar

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
[![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)
44
[![Continuous Integration](https://github.com/gnieh/geo-scala/actions/workflows/ci.yml/badge.svg)](https://github.com/gnieh/geo-scala/actions/workflows/ci.yml)
55

6-
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.
6+
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.
77

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

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

4344
[rfc-7946]: https://tools.ietf.org/html/rfc7946
4445
[circe]: https://circe.github.io/circe
46+
[jsoniter-scala]: https://github.com/plokhotnyuk/jsoniter-scala
4547
[polyline]: https://developers.google.com/maps/documentation/utilities/polylineutility

build.sbt

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
val scala212 = "2.12.16"
1+
val scala212 = "2.12.17"
22
val scala213 = "2.13.8"
3-
val scala3 = "3.1.3"
3+
val scala3 = "3.2.0"
44

5-
ThisBuild / tlBaseVersion := "0.2"
5+
ThisBuild / tlBaseVersion := "0.4"
66

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

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

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

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

3332
lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
@@ -39,16 +38,33 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
3938
)
4039
)
4140

42-
val circeVersion = "0.14.2"
43-
lazy val circe = crossProject(JVMPlatform, JSPlatform)
41+
val circeVersion = "0.14.3"
42+
lazy val circe = crossProject(JVMPlatform, JSPlatform, NativePlatform)
4443
.crossType(CrossType.Pure)
4544
.in(file("circe"))
4645
.dependsOn(core)
4746
.settings(
4847
commonSettings ++ Seq(
4948
name := "geo-scala-circe",
50-
libraryDependencies += "io.circe" %%% "circe-core" % circeVersion,
51-
libraryDependencies += "io.circe" %%% "circe-parser" % circeVersion % Test
49+
libraryDependencies ++= Seq(
50+
"io.circe" %%% "circe-core" % circeVersion,
51+
"io.circe" %%% "circe-parser" % circeVersion % Test
52+
)
53+
)
54+
)
55+
56+
val jsoniterScalaVersion = "2.17.4"
57+
lazy val jsoniterScala = crossProject(JVMPlatform, JSPlatform, NativePlatform)
58+
.crossType(CrossType.Pure)
59+
.in(file("jsoniter-scala"))
60+
.dependsOn(core)
61+
.settings(
62+
commonSettings ++ Seq(
63+
name := "geo-scala-jsoniter-scala",
64+
libraryDependencies ++= Seq(
65+
"com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-core" % jsoniterScalaVersion,
66+
"com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-macros" % jsoniterScalaVersion % Provided
67+
)
5268
)
5369
)
5470

0 commit comments

Comments
 (0)