Skip to content

Commit 3f5b8b8

Browse files
authored
feat: add supports for Scala cross versioning [2.12, 2.13] (#211)
1 parent 6d39cb8 commit 3f5b8b8

12 files changed

Lines changed: 493 additions & 251 deletions

File tree

.circleci/config.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ commands:
4242
- restore_cache:
4343
name: Restoring Maven Cache
4444
keys:
45-
- &cache-key maven-cache_v3-<< parameters.maven-image >>-{{ checksum "pom.xml" }}-{{ checksum "client-core/pom.xml" }}-{{ checksum "client/pom.xml" }}-{{ checksum "client-kotlin/pom.xml" }}-{{ checksum "client-legacy/pom.xml" }}-{{ checksum "client-reactive/pom.xml" }}-{{ checksum "client-scala/pom.xml" }}-{{ checksum "client-test/pom.xml" }}-{{ checksum "spring/pom.xml" }}-{{ checksum "flux-dsl/pom.xml" }}
45+
- &cache-key maven-cache_v3-<< parameters.maven-image >>-{{ checksum "pom.xml" }}-{{ checksum "client-core/pom.xml" }}-{{ checksum "client/pom.xml" }}-{{ checksum "client-kotlin/pom.xml" }}-{{ checksum "client-legacy/pom.xml" }}-{{ checksum "client-reactive/pom.xml" }}-{{ checksum "client-scala/cross/2.12/pom.xml" }}-{{ checksum "client-scala/cross/2.13/pom.xml" }}-{{ checksum "client-test/pom.xml" }}-{{ checksum "spring/pom.xml" }}-{{ checksum "flux-dsl/pom.xml" }}
4646
- maven-cache_v3-<< parameters.maven-image >>-
4747
- run:
4848
name: "Running tests"
@@ -70,8 +70,10 @@ commands:
7070
cp -r client-reactive/target/*/TEST-*.xml test-results/client-reactive || true
7171
mkdir test-results/client-kotlin
7272
cp -r client-kotlin/target/*/TEST-*.xml test-results/client-kotlin || true
73-
mkdir test-results/client-scala
74-
cp -r client-scala/target/*/TEST-*.xml test-results/client-scala || true
73+
mkdir test-results/client-scala_2.12
74+
cp -r client-scala/cross/2.12/target/*/TEST-*.xml test-results/client-scala_2.12 || true
75+
mkdir test-results/client-scala_2.13
76+
cp -r client-scala/cross/2.13/target/*/TEST-*.xml test-results/client-scala_2.13 || true
7577
mkdir test-results/spring
7678
cp -r spring/target/*/TEST-*.xml test-results/spring || true
7779
mkdir test-results/flux-dsl
@@ -89,7 +91,8 @@ commands:
8991
cp -r client-legacy/target/*.jar artifacts/
9092
cp -r client-reactive/target/*.jar artifacts/
9193
cp -r client-kotlin/target/*.jar artifacts/
92-
cp -r client-scala/target/*.jar artifacts/
94+
cp -r client-scala/cross/2.12/target/*.jar artifacts/
95+
cp -r client-scala/cross/2.13/target/*.jar artifacts/
9396
cp -r spring/target/*.jar artifacts/
9497
cp -r flux-dsl/target/*.jar artifacts/
9598
- store_artifacts:
@@ -156,7 +159,7 @@ jobs:
156159
- restore_cache:
157160
name: Restoring Maven Cache
158161
keys:
159-
- &cache-key-deploy maven-cache-deploy_v2-{{ checksum "pom.xml" }}-{{ checksum "client-core/pom.xml" }}-{{ checksum "client/pom.xml" }}-{{ checksum "client-kotlin/pom.xml" }}-{{ checksum "client-legacy/pom.xml" }}-{{ checksum "client-reactive/pom.xml" }}-{{ checksum "client-scala/pom.xml" }}-{{ checksum "client-test/pom.xml" }}-{{ checksum "spring/pom.xml" }}-{{ checksum "flux-dsl/pom.xml" }}
162+
- &cache-key-deploy maven-cache-deploy_v2-{{ checksum "pom.xml" }}-{{ checksum "client-core/pom.xml" }}-{{ checksum "client/pom.xml" }}-{{ checksum "client-kotlin/pom.xml" }}-{{ checksum "client-legacy/pom.xml" }}-{{ checksum "client-reactive/pom.xml" }}-{{ checksum "client-scala/cross/2.12/pom.xml" }}-{{ checksum "client-scala/cross/2.13/pom.xml" }}-{{ checksum "client-test/pom.xml" }}-{{ checksum "spring/pom.xml" }}-{{ checksum "flux-dsl/pom.xml" }}
160163
- maven-cache-deploy_v2-
161164
- run:
162165
name: Deploying Snapshot

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
## 2.2.0 [unreleased]
22

3+
### Breaking Changes
4+
5+
This release introduces a support to cross-built Scala Client against Scala `2.12` and `2.13`.
6+
You have to replace your dependency from: `influxdb-client-scala` to:
7+
- `influxdb-client-scala_2.12` or
8+
- `influxdb-client-scala_2.13`
9+
10+
### Features
11+
1. [#211](https://github.com/influxdata/influxdb-client-java/pull/211): Add supports for Scala cross versioning [`2.12`, `2.13`]
12+
313
## 2.1.0 [2021-04-01]
414

515
### Bug Fixes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The Java, Reactive, Kotlin and Scala clients are implemented for the InfluxDB 2.
4949
| **[java](./client)** | The reference Java client that allows query, write and InfluxDB 2.0 management. | [javadoc](https://influxdata.github.io/influxdb-client-java/influxdb-client-java/apidocs/index.html), [readme](./client#influxdb-client-java/)| 2.0 |
5050
| **[reactive](./client-reactive)** | The reference RxJava client for the InfluxDB 2.0 that allows query and write in a reactive way.| [javadoc](https://influxdata.github.io/influxdb-client-java/influxdb-client-java/apidocs/index.html), [readme](./client#influxdb-client-java/) |2.0 |
5151
| **[kotlin](./client-kotlin)** | The reference Kotlin client that allows query and write for the InfluxDB 2.0 by [Kotlin Channel coroutines](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.channels/-channel/index.html). | [KDoc](https://influxdata.github.io/influxdb-client-java/influxdb-client-kotlin/dokka/influxdb-client-kotlin/com.influxdb.client.kotlin/index.html), [readme](./client-kotlin#influxdb-client-kotlin/) | 2.0|
52-
| **[scala](./client-scala)** | The reference Scala client that allows query and write for the InfluxDB 2.0 by [Akka Streams](https://doc.akka.io/docs/akka/2.6/stream/). | [Scaladoc](https://influxdata.github.io/influxdb-client-java/influxdb-client-scala/scaladocs/org/influxdata/client/scala/index.html), [readme](./client-scala#influxdb-client-scala/) | 2.0 |
52+
| **[scala](./client-scala)** | The reference Scala client that allows query and write for the InfluxDB 2.0 by [Akka Streams](https://doc.akka.io/docs/akka/2.6/stream/). | [Scaladoc](https://influxdata.github.io/influxdb-client-java/client-scala/cross/influxdb-client-scala_2.13/scaladocs/com/influxdb/client/scala/index.html), [readme](./client-scala#influxdb-client-scala/) | 2.0 |
5353

5454
There is also possibility to use the Flux language over the InfluxDB 1.7+ provided by:
5555

client-scala/README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![KDoc](https://img.shields.io/badge/Scaladoc-link-brightgreen.svg)](https://influxdata.github.io/influxdb-client-java/influxdb-client-scala/scaladocs/org/influxdata/client/scala/index.html)
44

55
The reference Scala client that allows query and write for the InfluxDB 2.0 by [Akka Streams](https://doc.akka.io/docs/akka/2.6/stream/).
6+
The client is cross-built against Scala `2.12` and `2.13`.
67

78
## Features
89

@@ -236,19 +237,39 @@ object InfluxDB2ScalaExampleDSL {
236237

237238
## Version
238239

240+
### Scala 2.12
241+
242+
The latest version for Maven dependency:
243+
```xml
244+
<dependency>
245+
<groupId>com.influxdb</groupId>
246+
<artifactId>influxdb-client-scala_2.12</artifactId>
247+
<version>2.1.0</version>
248+
</dependency>
249+
```
250+
251+
Or when using with Gradle:
252+
```groovy
253+
dependencies {
254+
compile "com.influxdb:influxdb-client-scala_2.12:2.1.0"
255+
}
256+
```
257+
258+
### Scala 2.13
259+
239260
The latest version for Maven dependency:
240261
```xml
241262
<dependency>
242263
<groupId>com.influxdb</groupId>
243-
<artifactId>influxdb-client-scala</artifactId>
264+
<artifactId>influxdb-client-scala_2.13</artifactId>
244265
<version>2.1.0</version>
245266
</dependency>
246267
```
247268

248269
Or when using with Gradle:
249270
```groovy
250271
dependencies {
251-
compile "com.influxdb:influxdb-client-scala:2.1.0"
272+
compile "com.influxdb:influxdb-client-scala_2.13:2.1.0"
252273
}
253274
```
254275

client-scala/cross/2.12/pom.xml

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
The MIT License
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.
23+
24+
-->
25+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
26+
<parent>
27+
<artifactId>influxdb-client</artifactId>
28+
<groupId>com.influxdb</groupId>
29+
<version>2.2.0-SNAPSHOT</version>
30+
</parent>
31+
<modelVersion>4.0.0</modelVersion>
32+
33+
<artifactId>influxdb-client-scala_2.12</artifactId>
34+
<packaging>jar</packaging>
35+
36+
<name>The Scala InfluxDB 2.0 Client [Scala 2.12]</name>
37+
<description>
38+
The reference Scala client that allows query and write for the InfluxDB 2.0 by Akka Streams.
39+
</description>
40+
41+
<url>https://github.com/influxdata/influxdb-client-java/tree/master/client-scala</url>
42+
43+
<licenses>
44+
<license>
45+
<name>The MIT License (MIT)</name>
46+
<url>https://raw.githubusercontent.com/influxdata/influxdb-client-java/master/LICENSE</url>
47+
<distribution>repo</distribution>
48+
</license>
49+
</licenses>
50+
51+
<developers>
52+
<developer>
53+
<name>Jakub Bednar</name>
54+
<email>[email protected]</email>
55+
<organization>Bonitoo</organization>
56+
<organizationUrl>https://www.bonitoo.io</organizationUrl>
57+
</developer>
58+
<developer>
59+
<name>Robert Hajek</name>
60+
<email>[email protected]</email>
61+
<organization>Bonitoo</organization>
62+
<organizationUrl>https://www.bonitoo.io</organizationUrl>
63+
</developer>
64+
</developers>
65+
66+
<scm>
67+
<connection>scm:git:[email protected]:influxdata/influxdb-client-java.git</connection>
68+
<developerConnection>scm:git:[email protected]:influxdata/influxdb-client-java.git</developerConnection>
69+
<url>http://github.com/influxdata/influxdb-client-java/tree/master</url>
70+
<tag>HEAD</tag>
71+
</scm>
72+
73+
<properties>
74+
<scala.version>2.12.13</scala.version>
75+
<akka.version>2.6.6</akka.version>
76+
</properties>
77+
78+
<build>
79+
<sourceDirectory>src/main/scala</sourceDirectory>
80+
<testSourceDirectory>src/test/scala</testSourceDirectory>
81+
82+
<plugins>
83+
84+
<plugin>
85+
<groupId>net.alchim31.maven</groupId>
86+
<artifactId>scala-maven-plugin</artifactId>
87+
<version>${plugin.scala.version}</version>
88+
<executions>
89+
<execution>
90+
<goals>
91+
<goal>compile</goal>
92+
<goal>testCompile</goal>
93+
</goals>
94+
</execution>
95+
<execution>
96+
<id>attach-javadocs</id>
97+
<goals>
98+
<goal>doc-jar</goal>
99+
</goals>
100+
</execution>
101+
</executions>
102+
</plugin>
103+
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-surefire-plugin</artifactId>
107+
<version>${plugin.surefire.version}</version>
108+
<configuration>
109+
<skipTests>true</skipTests>
110+
</configuration>
111+
</plugin>
112+
113+
<plugin>
114+
<groupId>org.scalatest</groupId>
115+
<artifactId>scalatest-maven-plugin</artifactId>
116+
<version>2.0.0</version>
117+
<configuration>
118+
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
119+
<junitxml>.</junitxml>
120+
</configuration>
121+
<executions>
122+
<execution>
123+
<id>test</id>
124+
<goals>
125+
<goal>test</goal>
126+
</goals>
127+
</execution>
128+
</executions>
129+
</plugin>
130+
131+
<plugin>
132+
<groupId>com.mycila</groupId>
133+
<artifactId>license-maven-plugin</artifactId>
134+
<configuration>
135+
<header>../../../scripts/license_header.txt</header>
136+
</configuration>
137+
</plugin>
138+
139+
<plugin>
140+
<groupId>org.codehaus.mojo</groupId>
141+
<artifactId>versions-maven-plugin</artifactId>
142+
<configuration>
143+
<rulesUri>file://${project.basedir}/../../../scripts/maven-version-rules.xml</rulesUri>
144+
</configuration>
145+
</plugin>
146+
147+
</plugins>
148+
</build>
149+
150+
<dependencies>
151+
152+
<dependency>
153+
<groupId>com.influxdb</groupId>
154+
<artifactId>influxdb-client-java</artifactId>
155+
</dependency>
156+
157+
<dependency>
158+
<groupId>org.scala-lang</groupId>
159+
<artifactId>scala-library</artifactId>
160+
<version>${scala.version}</version>
161+
</dependency>
162+
163+
<dependency>
164+
<groupId>org.scala-lang.modules</groupId>
165+
<artifactId>scala-collection-compat_2.12</artifactId>
166+
<version>2.4.2</version>
167+
</dependency>
168+
169+
<dependency>
170+
<groupId>com.typesafe.akka</groupId>
171+
<artifactId>akka-stream_2.12</artifactId>
172+
<version>${akka.version}</version>
173+
</dependency>
174+
175+
<dependency>
176+
<groupId>com.typesafe.akka</groupId>
177+
<artifactId>akka-testkit_2.12</artifactId>
178+
<version>${akka.version}</version>
179+
<scope>test</scope>
180+
</dependency>
181+
182+
<dependency>
183+
<groupId>com.typesafe.akka</groupId>
184+
<artifactId>akka-stream-testkit_2.12</artifactId>
185+
<version>${akka.version}</version>
186+
<scope>test</scope>
187+
</dependency>
188+
189+
<dependency>
190+
<groupId>com.influxdb</groupId>
191+
<artifactId>influxdb-client-test</artifactId>
192+
<scope>test</scope>
193+
</dependency>
194+
195+
<dependency>
196+
<groupId>org.scalatest</groupId>
197+
<artifactId>scalatest_2.12</artifactId>
198+
<version>3.2.0</version>
199+
<scope>test</scope>
200+
</dependency>
201+
202+
</dependencies>
203+
204+
</project>

client-scala/cross/2.12/src

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../src

0 commit comments

Comments
 (0)