Skip to content

Commit 78f1a78

Browse files
committed
prepare release v0.1.1
1 parent fb3a786 commit 78f1a78

File tree

10 files changed

+76
-41
lines changed

10 files changed

+76
-41
lines changed

build.sbt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ThisBuild / organization := "app.softnetwork"
1717

1818
name := "softclient4es"
1919

20-
ThisBuild / version := "0.1.0"
20+
ThisBuild / version := "0.1.1"
2121

2222
ThisBuild / scalaVersion := scala213
2323

@@ -36,6 +36,13 @@ lazy val moduleSettings = Seq(
3636
case Some((2, 13)) => scalacCompilerOptions
3737
case _ => Seq.empty
3838
}
39+
},
40+
dependencyOverrides ++= {
41+
CrossVersion.partialVersion(scalaVersion.value) match {
42+
case Some((2, 12)) => Seq("com.github.kxbmap" %% "configs" % Versions.kxbmap_scala2_12)
43+
case Some((2, 13)) => Seq("com.github.kxbmap" %% "configs" % Versions.kxbmap)
44+
case _ => Seq.empty
45+
}
3946
}
4047
)
4148

core/build.sbt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
import SoftClient4es._
1+
import SoftClient4es.*
22

33
organization := "app.softnetwork.elastic"
44

55
name := "softclient4es-core"
66

77
val configDependencies = Seq(
8-
"com.typesafe" % "config" % Versions.typesafeConfig,
9-
"com.github.kxbmap" %% "configs" % Versions.kxbmap
8+
"com.typesafe" % "config" % Versions.typesafeConfig
109
)
1110

1211
val json4s = Seq(
1312
"org.json4s" %% "json4s-jackson" % Versions.json4s,
14-
"org.json4s" %% "json4s-ext" % Versions.json4s
15-
).map(_.excludeAll(jacksonExclusions: _*))
13+
"org.json4s" %% "json4s-ext" % Versions.json4s
14+
).map(_.excludeAll(jacksonExclusions *))
1615

1716
libraryDependencies ++= configDependencies ++
18-
json4s :+ "com.google.code.gson" % "gson" % Versions.gson :+
19-
("app.softnetwork.persistence" %% "persistence-core" % Versions.genericPersistence excludeAll(jacksonExclusions: _*))
17+
json4s :+ "com.google.code.gson" % "gson" % Versions.gson :+
18+
("app.softnetwork.persistence" %% "persistence-core" % Versions.genericPersistence excludeAll (jacksonExclusions *))
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package app.softnetwork.elastic.client
2+
3+
import com.typesafe.config.{Config, ConfigFactory}
4+
import com.typesafe.scalalogging.StrictLogging
5+
import configs.Configs
6+
7+
case class ElasticConfig(
8+
credentials: ElasticCredentials = ElasticCredentials(),
9+
multithreaded: Boolean = true,
10+
discoveryEnabled: Boolean = false
11+
)
12+
13+
object ElasticConfig extends StrictLogging {
14+
def apply(config: Config): ElasticConfig = {
15+
Configs[ElasticConfig]
16+
.get(config.withFallback(ConfigFactory.load("softnetwork-elastic.conf")), "elastic")
17+
.toEither match {
18+
case Left(configError) =>
19+
logger.error(s"Something went wrong with the provided arguments $configError")
20+
throw configError.configException
21+
case Right(r) => r
22+
}
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package app.softnetwork.elastic.client
2+
3+
import com.typesafe.config.{Config, ConfigFactory}
4+
import com.typesafe.scalalogging.StrictLogging
5+
import configs.ConfigReader
6+
7+
case class ElasticConfig(
8+
credentials: ElasticCredentials = ElasticCredentials(),
9+
multithreaded: Boolean = true,
10+
discoveryEnabled: Boolean = false
11+
)
12+
13+
object ElasticConfig extends StrictLogging {
14+
def apply(config: Config): ElasticConfig = {
15+
ConfigReader[ElasticConfig]
16+
.read(config.withFallback(ConfigFactory.load("softnetwork-elastic.conf")), "elastic")
17+
.toEither match {
18+
case Left(configError) =>
19+
logger.error(s"Something went wrong with the provided arguments $configError")
20+
throw configError.configException
21+
case Right(r) => r
22+
}
23+
}
24+
}

core/src/main/scala/app/softnetwork/elastic/client/MappingComparator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package app.softnetwork.elastic.client
33
import com.google.gson._
44
import com.typesafe.scalalogging.StrictLogging
55

6-
import scala.jdk.CollectionConverters._
6+
import scala.collection.JavaConverters._
77
import scala.util.{Failure, Success, Try}
88

99
object MappingComparator extends StrictLogging {

core/src/main/scala/app/softnetwork/elastic/client/package.scala

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import akka.stream.stage.{GraphStage, GraphStageLogic}
55
import app.softnetwork.elastic.client.BulkAction.BulkAction
66
import app.softnetwork.serialization._
77
import com.google.gson.{Gson, JsonElement, JsonObject}
8-
import com.typesafe.config.{Config, ConfigFactory}
9-
import com.typesafe.scalalogging.StrictLogging
10-
import configs.ConfigReader
118
import org.json4s.Formats
129
import org.slf4j.Logger
1310

@@ -16,6 +13,8 @@ import scala.collection.mutable
1613
import scala.language.reflectiveCalls
1714
import scala.util.{Failure, Success, Try}
1815

16+
import scala.collection.JavaConverters._
17+
1918
/** Created by smanciot on 30/06/2018.
2019
*/
2120
package object client {
@@ -26,25 +25,6 @@ package object client {
2625
password: String = ""
2726
)
2827

29-
case class ElasticConfig(
30-
credentials: ElasticCredentials = ElasticCredentials(),
31-
multithreaded: Boolean = true,
32-
discoveryEnabled: Boolean = false
33-
)
34-
35-
object ElasticConfig extends StrictLogging {
36-
def apply(config: Config): ElasticConfig = {
37-
ConfigReader[ElasticConfig]
38-
.read(config.withFallback(ConfigFactory.load("softnetwork-elastic.conf")), "elastic")
39-
.toEither match {
40-
case Left(configError) =>
41-
logger.error(s"Something went wrong with the provided arguments $configError")
42-
throw configError.configException
43-
case Right(r) => r
44-
}
45-
}
46-
}
47-
4828
object BulkAction extends Enumeration {
4929
type BulkAction = Value
5030
val INDEX: client.BulkAction.Value = Value(0, "INDEX")
@@ -118,7 +98,6 @@ package object client {
11898
def docAsUpsert(doc: String): String = s"""{"doc":$doc,"doc_as_upsert":true}"""
11999

120100
implicit class InnerHits(searchResult: JsonObject) {
121-
import scala.jdk.CollectionConverters._
122101
def ~>[M, I](
123102
innerField: String
124103
)(implicit formats: Formats, m: Manifest[M], i: Manifest[I]): List[(M, List[I])] = {

es6/sql-bridge/src/test/scala/app/softnetwork/elastic/sql/SQLQuerySpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import com.google.gson.{JsonArray, JsonObject, JsonParser, JsonPrimitive}
66
import org.scalatest.flatspec.AnyFlatSpec
77
import org.scalatest.matchers.should.Matchers
88

9-
import scala.jdk.CollectionConverters.IteratorHasAsScala
9+
import scala.collection.JavaConverters._
1010

1111
/** Created by smanciot on 13/04/17.
1212
*/

project/SoftClient4es.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ trait SoftClient4es {
8686
Seq(
8787
"com.sksamuel.elastic4s" %% "elastic4s-testkit" % Versions.elastic64s exclude ("org.elasticsearch", "elasticsearch") exclude ("org.slf4j", "slf4j-api"),
8888
"com.sksamuel.elastic4s" %% "elastic4s-embedded" % Versions.elastic64s exclude ("org.elasticsearch", "elasticsearch"),
89-
"pl.allegro.tech" % "embedded-elasticsearch" % "2.10.0" excludeAll (jacksonExclusions: _*)
89+
"pl.allegro.tech" % "embedded-elasticsearch" % "2.10.0" excludeAll (jacksonExclusions *)
9090
)
9191
case 7 =>
9292
Seq(
@@ -108,8 +108,8 @@ trait SoftClient4es {
108108
elasticSearchMajorVersion(esVersion) match {
109109
case 6 | 7 | 8 | 9 =>
110110
Seq(
111-
"org.elasticsearch" % "elasticsearch" % esVersion exclude ("org.apache.logging.log4j", "log4j-api") exclude ("org.slf4j", "slf4j-api") excludeAll (jacksonExclusions: _*)
112-
).map(_.excludeAll(jacksonExclusions: _*))
111+
"org.elasticsearch" % "elasticsearch" % esVersion exclude ("org.apache.logging.log4j", "log4j-api") exclude ("org.slf4j", "slf4j-api") excludeAll (jacksonExclusions *)
112+
).map(_.excludeAll(jacksonExclusions *))
113113
case _ => Seq.empty
114114
}
115115
}
@@ -120,7 +120,7 @@ trait SoftClient4es {
120120
case 6 | 7 | 8 | 9 =>
121121
Seq(
122122
"org.elasticsearch.client" % "elasticsearch-rest-client" % esVersion
123-
).map(_.excludeAll(jacksonExclusions: _*))
123+
).map(_.excludeAll(jacksonExclusions *))
124124
case _ => Seq.empty
125125
})
126126
}
@@ -131,7 +131,7 @@ trait SoftClient4es {
131131
case 8 | 9 =>
132132
Seq(
133133
"co.elastic.clients" % "elasticsearch-java" % esVersion exclude ("org.elasticsearch", "elasticsearch")
134-
).map(_.excludeAll(jacksonExclusions: _*))
134+
).map(_.excludeAll(jacksonExclusions *))
135135
case _ => Seq.empty
136136
})
137137
}
@@ -142,7 +142,7 @@ trait SoftClient4es {
142142
case 6 | 7 =>
143143
Seq(
144144
"org.elasticsearch.client" % "elasticsearch-rest-high-level-client" % esVersion exclude ("org.elasticsearch", "elasticsearch")
145-
).map(_.excludeAll(jacksonExclusions: _*))
145+
).map(_.excludeAll(jacksonExclusions *))
146146
case _ => Seq.empty
147147
})
148148
}
@@ -153,7 +153,7 @@ trait SoftClient4es {
153153
case 6 =>
154154
Seq(
155155
"io.searchbox" % "jest" % Versions.jest
156-
).map(_.excludeAll(httpComponentsExclusions ++ Seq(guavaExclusion): _*))
156+
).map(_.excludeAll((httpComponentsExclusions ++ Seq(guavaExclusion)) *))
157157
case _ => Seq.empty
158158
})
159159
}

project/Versions.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ object Versions {
66

77
val typesafeConfig = "1.4.2"
88

9+
val kxbmap_scala2_12 = "0.4.4"
10+
911
val kxbmap = "0.6.1"
1012

1113
val jackson = "2.19.0" // 2.13.3 -> 2.19.0

sql/bridge/src/test/scala/app/softnetwork/elastic/sql/SQLQuerySpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import com.google.gson.{JsonArray, JsonObject, JsonParser, JsonPrimitive}
66
import org.scalatest.flatspec.AnyFlatSpec
77
import org.scalatest.matchers.should.Matchers
88

9-
import scala.jdk.CollectionConverters.IteratorHasAsScala
9+
import scala.collection.JavaConverters._
1010

1111
/** Created by smanciot on 13/04/17.
1212
*/

0 commit comments

Comments
 (0)