Skip to content

Commit

Permalink
feat: add supports for Scala cross versioning [2.12, 2.13] (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar authored Apr 1, 2021
1 parent 6d39cb8 commit 3f5b8b8
Show file tree
Hide file tree
Showing 12 changed files with 493 additions and 251 deletions.
13 changes: 8 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ commands:
- restore_cache:
name: Restoring Maven Cache
keys:
- &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" }}
- &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" }}
- maven-cache_v3-<< parameters.maven-image >>-
- run:
name: "Running tests"
Expand Down Expand Up @@ -70,8 +70,10 @@ commands:
cp -r client-reactive/target/*/TEST-*.xml test-results/client-reactive || true
mkdir test-results/client-kotlin
cp -r client-kotlin/target/*/TEST-*.xml test-results/client-kotlin || true
mkdir test-results/client-scala
cp -r client-scala/target/*/TEST-*.xml test-results/client-scala || true
mkdir test-results/client-scala_2.12
cp -r client-scala/cross/2.12/target/*/TEST-*.xml test-results/client-scala_2.12 || true
mkdir test-results/client-scala_2.13
cp -r client-scala/cross/2.13/target/*/TEST-*.xml test-results/client-scala_2.13 || true
mkdir test-results/spring
cp -r spring/target/*/TEST-*.xml test-results/spring || true
mkdir test-results/flux-dsl
Expand All @@ -89,7 +91,8 @@ commands:
cp -r client-legacy/target/*.jar artifacts/
cp -r client-reactive/target/*.jar artifacts/
cp -r client-kotlin/target/*.jar artifacts/
cp -r client-scala/target/*.jar artifacts/
cp -r client-scala/cross/2.12/target/*.jar artifacts/
cp -r client-scala/cross/2.13/target/*.jar artifacts/
cp -r spring/target/*.jar artifacts/
cp -r flux-dsl/target/*.jar artifacts/
- store_artifacts:
Expand Down Expand Up @@ -156,7 +159,7 @@ jobs:
- restore_cache:
name: Restoring Maven Cache
keys:
- &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" }}
- &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" }}
- maven-cache-deploy_v2-
- run:
name: Deploying Snapshot
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## 2.2.0 [unreleased]

### Breaking Changes

This release introduces a support to cross-built Scala Client against Scala `2.12` and `2.13`.
You have to replace your dependency from: `influxdb-client-scala` to:
- `influxdb-client-scala_2.12` or
- `influxdb-client-scala_2.13`

### Features
1. [#211](https://github.com/influxdata/influxdb-client-java/pull/211): Add supports for Scala cross versioning [`2.12`, `2.13`]

## 2.1.0 [2021-04-01]

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The Java, Reactive, Kotlin and Scala clients are implemented for the InfluxDB 2.
| **[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 |
| **[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 |
| **[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|
| **[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 |
| **[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 |

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

Expand Down
25 changes: 23 additions & 2 deletions client-scala/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![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)

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/).
The client is cross-built against Scala `2.12` and `2.13`.

## Features

Expand Down Expand Up @@ -236,19 +237,39 @@ object InfluxDB2ScalaExampleDSL {

## Version

### Scala 2.12

The latest version for Maven dependency:
```xml
<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-scala_2.12</artifactId>
<version>2.1.0</version>
</dependency>
```

Or when using with Gradle:
```groovy
dependencies {
compile "com.influxdb:influxdb-client-scala_2.12:2.1.0"
}
```

### Scala 2.13

The latest version for Maven dependency:
```xml
<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-scala</artifactId>
<artifactId>influxdb-client-scala_2.13</artifactId>
<version>2.1.0</version>
</dependency>
```

Or when using with Gradle:
```groovy
dependencies {
compile "com.influxdb:influxdb-client-scala:2.1.0"
compile "com.influxdb:influxdb-client-scala_2.13:2.1.0"
}
```

Expand Down
204 changes: 204 additions & 0 deletions client-scala/cross/2.12/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
The MIT License
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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<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">
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>2.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>influxdb-client-scala_2.12</artifactId>
<packaging>jar</packaging>

<name>The Scala InfluxDB 2.0 Client [Scala 2.12]</name>
<description>
The reference Scala client that allows query and write for the InfluxDB 2.0 by Akka Streams.
</description>

<url>https://github.com/influxdata/influxdb-client-java/tree/master/client-scala</url>

<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>https://raw.githubusercontent.com/influxdata/influxdb-client-java/master/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>

<developers>
<developer>
<name>Jakub Bednar</name>
<email>jakub.bednar@bonitoo.io</email>
<organization>Bonitoo</organization>
<organizationUrl>https://www.bonitoo.io</organizationUrl>
</developer>
<developer>
<name>Robert Hajek</name>
<email>robert.hajek@bonitoo.io</email>
<organization>Bonitoo</organization>
<organizationUrl>https://www.bonitoo.io</organizationUrl>
</developer>
</developers>

<scm>
<connection>scm:git:git@github.com:influxdata/influxdb-client-java.git</connection>
<developerConnection>scm:git:git@github.com:influxdata/influxdb-client-java.git</developerConnection>
<url>http://github.com/influxdata/influxdb-client-java/tree/master</url>
<tag>HEAD</tag>
</scm>

<properties>
<scala.version>2.12.13</scala.version>
<akka.version>2.6.6</akka.version>
</properties>

<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>

<plugins>

<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>${plugin.scala.version}</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>doc-jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${plugin.surefire.version}</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>

<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>2.0.0</version>
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
</configuration>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
<header>../../../scripts/license_header.txt</header>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<configuration>
<rulesUri>file://${project.basedir}/../../../scripts/maven-version-rules.xml</rulesUri>
</configuration>
</plugin>

</plugins>
</build>

<dependencies>

<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-java</artifactId>
</dependency>

<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>

<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-collection-compat_2.12</artifactId>
<version>2.4.2</version>
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream_2.12</artifactId>
<version>${akka.version}</version>
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_2.12</artifactId>
<version>${akka.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream-testkit_2.12</artifactId>
<version>${akka.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.12</artifactId>
<version>3.2.0</version>
<scope>test</scope>
</dependency>

</dependencies>

</project>
1 change: 1 addition & 0 deletions client-scala/cross/2.12/src
Loading

0 comments on commit 3f5b8b8

Please sign in to comment.