pekko/project/Dependencies.scala

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

427 lines
15 KiB
Scala
Raw Normal View History

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* license agreements; and to You under the Apache License, version 2.0:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* This file is part of the Apache Pekko project, derived from Akka.
*/
/*
2022-02-04 12:36:44 +01:00
* Copyright (C) 2016-2022 Lightbend Inc. <https://www.lightbend.com>
*/
package org.apache.pekko
import sbt._
2015-05-21 21:07:37 +02:00
import Keys._
import scala.language.implicitConversions
object Dependencies {
import DependencyHelpers._
2016-04-13 17:33:32 +02:00
lazy val java8CompatVersion = settingKey[String]("The version of scala-java8-compat to use.")
.withRank(KeyRanks.Invisible) // avoid 'unused key' warning
2021-03-30 23:29:37 +02:00
val junitVersion = "4.13.2"
val slf4jVersion = "1.7.36"
// check agrona version when updating this
val aeronVersion = "1.38.1"
// needs to be inline with the aeron version, check
// https://github.com/real-logic/aeron/blob/1.x.y/build.gradle
val agronaVersion = "1.15.1"
val nettyVersion = "3.10.6.Final"
val protobufJavaVersion = "3.16.1"
val logbackVersion = "1.2.11"
2023-05-10 11:03:46 +01:00
val jacksonCoreVersion = "2.14.3"
val jacksonDatabindVersion = jacksonCoreVersion
val scala212Version = "2.12.18"
val scala213Version = "2.13.11"
// To get the fix for https://github.com/lampepfl/dotty/issues/13106
// and restored static forwarders
val scala3Version = "3.3.0"
val allScalaVersions = Seq(scala213Version, scala212Version, scala3Version)
val reactiveStreamsVersion = "1.0.4"
val sslConfigVersion = Def.setting {
if (scalaVersion.value.startsWith("3.")) {
"0.6.1"
} else {
"0.4.3"
}
}
val scalaTestVersion = Def.setting {
if (scalaVersion.value.startsWith("3.")) {
"3.2.9"
} else {
"3.1.4"
}
}
val scalaTestScalaCheckVersion = Def.setting {
if (scalaVersion.value.startsWith("3.")) {
"1-15"
} else {
"1-14"
}
}
2020-11-16 12:31:05 +01:00
val scalaCheckVersion = "1.15.1"
val Versions =
Seq(crossScalaVersions := allScalaVersions, scalaVersion := allScalaVersions.head,
java8CompatVersion := "1.0.2")
object Compile {
// Compile
2023-04-21 16:20:42 +02:00
val config = "com.typesafe" % "config" % "1.4.2"
val netty = "io.netty" % "netty" % nettyVersion
2023-04-21 16:20:42 +02:00
val scalaReflect = ScalaVersionDependentModuleID.versioned("org.scala-lang" % "scala-reflect" % _)
2023-04-21 16:20:42 +02:00
val slf4jApi = "org.slf4j" % "slf4j-api" % slf4jVersion
// mirrored in OSGi sample https://github.com/akka/akka-samples/tree/2.6/akka-sample-osgi-dining-hakkers
2023-04-21 16:20:42 +02:00
val osgiCore = "org.osgi" % "org.osgi.core" % "6.0.0"
val osgiCompendium = "org.osgi" % "org.osgi.compendium" % "5.0.0"
2023-04-21 16:20:42 +02:00
val sigar = "org.fusesource" % "sigar" % "1.6.4"
2023-04-21 16:20:42 +02:00
val jctools = "org.jctools" % "jctools-core" % "3.3.0"
// reactive streams
2023-04-21 16:20:42 +02:00
val reactiveStreams = "org.reactivestreams" % "reactive-streams" % reactiveStreamsVersion
// ssl-config
val sslConfigCore = Def.setting {
2023-04-21 16:20:42 +02:00
"com.typesafe" %% "ssl-config-core" % sslConfigVersion.value
}
2017-02-23 14:17:13 +00:00
2023-04-21 16:20:42 +02:00
val lmdb = "org.lmdbjava" % "lmdbjava" % "0.7.0"
2017-02-23 14:17:13 +00:00
2023-04-21 16:20:42 +02:00
val junit = "junit" % "junit" % junitVersion
// For Java 8 Conversions
val java8Compat = Def.setting {
"org.scala-lang.modules" %% "scala-java8-compat" % java8CompatVersion.value
2023-04-21 16:20:42 +02:00
}
2017-02-23 14:17:13 +00:00
2023-04-21 16:20:42 +02:00
val aeronDriver = "io.aeron" % "aeron-driver" % aeronVersion
val aeronClient = "io.aeron" % "aeron-client" % aeronVersion
// Added explicitly for when artery tcp is used
2023-04-21 16:20:42 +02:00
val agrona = "org.agrona" % "agrona" % agronaVersion
2023-04-21 16:20:42 +02:00
val asnOne = ("com.hierynomus" % "asn-one" % "0.5.0").exclude("org.slf4j", "slf4j-api")
val jacksonCore = Def.setting {
"com.fasterxml.jackson.core" % "jackson-core" % jacksonCoreVersion
} // ApacheV2
val jacksonAnnotations = Def.setting {
"com.fasterxml.jackson.core" % "jackson-annotations" % jacksonCoreVersion
} // ApacheV2
val jacksonDatabind = Def.setting {
"com.fasterxml.jackson.core" % "jackson-databind" % jacksonDatabindVersion
} // ApacheV2
val jacksonJdk8 = Def.setting {
"com.fasterxml.jackson.datatype" % "jackson-datatype-jdk8" % jacksonCoreVersion
} // ApacheV2
val jacksonJsr310 = Def.setting {
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % jacksonCoreVersion
} // ApacheV2
val jacksonScala = Def.setting {
"com.fasterxml.jackson.module" %% "jackson-module-scala" % jacksonCoreVersion
} // ApacheV2
val jacksonParameterNames = Def.setting {
"com.fasterxml.jackson.module" % "jackson-module-parameter-names" % jacksonCoreVersion
} // ApacheV2
val jacksonCbor = Def.setting {
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-cbor" % jacksonCoreVersion
} // ApacheV2
2023-04-21 16:20:42 +02:00
val lz4Java = "org.lz4" % "lz4-java" % "1.8.0"
2023-04-21 16:20:42 +02:00
val logback = "ch.qos.logback" % "logback-classic" % logbackVersion
Complete logging with SLF4J in Typed, #26537 * TestAppender interaction with LoggingEventFilter * TestAppender plays the same role as classic TestEventList * replace Sl4jLoggingEvent.java * include MDC in testkit.LoggingEvent to allow for custom filter testing MDC * fix tests * fix log events in BehaviorSetKit, using SubstituteLogger * MDC in EventSourcedBehavior * using raw MDC to set the persistenceId and persistencePhase fields * avoid access to MDC ThreadLocal if log isn't used * Automatically enable eventStream Slf4jLogger for Typed (PR #27583) * amend the ActorSystem config on startup when config akka.use-slf4j=on and akka-slf4j in classpath * akka.use-slf4j is defined in akka-actor-typed reference.conf * also enable the Slf4jLoggingFilter automatically * remove config in tests * Include actor path as akkaSource in MDC (PR #27587) * move logger init to ActorContextImpl since not specific to untyped (ActorContextAdapter) * careful to not access MDC ThreadLocal if logging isn't used (per message) * MDC is cleared (if used) from aroundReceive in ActorAdapter after processing each message * also changed MDC for EventSourcedBehavior to rely on context.log and the outer MDC.clear() * just removing the MDC values is not enough because the empty Map remains in the ThreadLocal * Optimization of MDC interceptor (PR #27610) * Extension methods to Logger as workaround for overload and varargs problem (PR #27605) * "ambiguous reference to overloaded definition" for 2 arg method * varargs not supported for primitive types * providing extension methods info2 and infoN (and friends) via implicit class LoggerOps as more convenient workaround for these problems * New API for Typed LoggingEventFilter (PR #27611) * builder style * will make it easier to add more conditions * all conditions are AND:ed together which makes it easier to define custom filters * simplifies the implementation as a bonus * javadsl * use new api in all tests * leeway setting * verify that occurrences = 0 works * use javadsl in two tests * change interceptLogger, and some other feedback * Testing utility to silence logging until failure (PR #27588) * Logback appender that captures all log events and can flush them later to other appenders * LogCapturing mixin for ScalaTest that flush the captured logging events when a test fails. Also clears the captured events after all tests. * Configuration in logback-test.xml * log capturing for JUnit tests too, using TestRule * Silence initial setup logging from Logback * make LogCapturing public * use LogCapturing in all tests * aside from multi-jvm, and a few extending AkkaSpec, so far * a few doc tests needed debug level * mention in migration guide * rename setLoggerClass to setLoggerName * check for logback dependency to give nicer error message * fix filterKeys, deprecated in 2.13
2019-08-24 08:46:39 +02:00
object Docs {
2021-12-23 18:28:30 +05:30
val sprayJson = "io.spray" %% "spray-json" % "1.3.6" % Test
2022-08-23 11:34:28 +02:00
val gson = "com.google.code.gson" % "gson" % "2.9.1" % Test
}
2021-12-23 18:28:30 +05:30
object TestDependencies {
2023-04-21 16:20:42 +02:00
val commonsMath = "org.apache.commons" % "commons-math" % "2.2" % Test
val commonsIo = "commons-io" % "commons-io" % "2.11.0" % Test
val commonsCodec = "commons-codec" % "commons-codec" % "1.15" % Test
val junit = "junit" % "junit" % junitVersion % "test"
val logback = Compile.logback % Test
2021-12-23 18:28:30 +05:30
val scalatest = Def.setting { "org.scalatest" %% "scalatest" % scalaTestVersion.value % Test } // ApacheV2
// The 'scalaTestPlus' projects are independently versioned,
// but the version of each module starts with the scalatest
// version it was intended to work with
val scalatestJUnit = Def.setting {
2021-12-23 18:28:30 +05:30
"org.scalatestplus" %% "junit-4-13" % (scalaTestVersion.value + ".0") % Test
2023-04-21 16:20:42 +02:00
}
val scalatestTestNG = Def.setting {
2021-12-23 18:28:30 +05:30
"org.scalatestplus" %% "testng-6-7" % (scalaTestVersion.value + ".0") % Test
2023-04-21 16:20:42 +02:00
}
val scalatestScalaCheck = Def.setting {
2021-12-23 18:28:30 +05:30
"org.scalatestplus" %% s"scalacheck-${scalaTestScalaCheckVersion.value}" % (scalaTestVersion.value + ".0") % Test
2023-04-21 16:20:42 +02:00
}
val scalatestMockito = Def.setting {
2021-12-23 18:28:30 +05:30
"org.scalatestplus" %% "mockito-3-4" % (scalaTestVersion.value + ".0") % Test
2023-04-21 16:20:42 +02:00
}
2023-04-21 16:20:42 +02:00
val pojosr = "com.googlecode.pojosr" % "de.kalpatec.pojosr.framework" % "0.2.1" % Test
val tinybundles = "org.ops4j.pax.tinybundles" % "tinybundles" % "3.0.0" % Test
val log4j = "log4j" % "log4j" % "1.2.17" % Test
=act,tes Initial draft of internal MetricsKit Note: This is NOT aimed to provide an micro-benchmarking solution. The goal is to provide data for broad trend analysis. For techniques that fight the inliner and other specialised techniques, refer to JMH. + custom console and graphite reporters - had to be custom because it's not possible to add custom metric types to the existing reporters + initial hdr.Histogram histogram() provider, see http://latencyutils.github.io/LatencyUtils/ + Not using timers provided by Metrics, instead use the above histogram + Added average Actor size measurement + Measuring the "blocking time" when an actor is created, before we fire of the async part of this process; Measures in loop and will fluctuate a lot. Times are in `us` -- System.nanoTime should provide good enough resolution. + Measuring total actor creation time by using `KnownOpsInTimespanTimer`, which given a known number of ops, in a large amount of time, roughtly estimates time per one operation. // Yes, we are aware of the possibility of GC pauses and other horrors + All classes are `private[akka]`, we should not encourage people to use this yet + Counters use Java 8's `LongAdder`, which is metric's private; The new trend in Java land will be copy paste-ing this class ;) + Metrics are logged to Graphite, so we can long-term analyse these + Reporters are configurable using typesafe-config ! I'm not very happy about how I work around Metrics not being too open for adding additional custom metrics. Seems like a hack at places. I will consider removing the Metrics dependency all together. numbers Example output: ``` -- KnownOpsInTimespanTimer------------------------------------------- actor-creation.total.creating-100000-actors.Props|new-EmptyArgsActor|…||-same ops = 100000 time = 1.969 s ops/s = 50782.22 avg = 19.69 μs -- AveragingGauge--------------------------------------------------- actor-creation.Props|new-EmptyArgsActor|…||-same.avg-mem-per-actor avg = 439.67 ```
2014-04-29 10:50:36 +02:00
// in-memory filesystem for file related tests
2023-04-21 16:20:42 +02:00
val jimfs = "com.google.jimfs" % "jimfs" % "1.1" % Test
2018-10-16 15:35:55 +02:00
// docker utils
2023-04-21 16:20:42 +02:00
val dockerClient = "com.spotify" % "docker-client" % "8.16.0" % Test
2018-10-16 15:35:55 +02:00
=act,tes Initial draft of internal MetricsKit Note: This is NOT aimed to provide an micro-benchmarking solution. The goal is to provide data for broad trend analysis. For techniques that fight the inliner and other specialised techniques, refer to JMH. + custom console and graphite reporters - had to be custom because it's not possible to add custom metric types to the existing reporters + initial hdr.Histogram histogram() provider, see http://latencyutils.github.io/LatencyUtils/ + Not using timers provided by Metrics, instead use the above histogram + Added average Actor size measurement + Measuring the "blocking time" when an actor is created, before we fire of the async part of this process; Measures in loop and will fluctuate a lot. Times are in `us` -- System.nanoTime should provide good enough resolution. + Measuring total actor creation time by using `KnownOpsInTimespanTimer`, which given a known number of ops, in a large amount of time, roughtly estimates time per one operation. // Yes, we are aware of the possibility of GC pauses and other horrors + All classes are `private[akka]`, we should not encourage people to use this yet + Counters use Java 8's `LongAdder`, which is metric's private; The new trend in Java land will be copy paste-ing this class ;) + Metrics are logged to Graphite, so we can long-term analyse these + Reporters are configurable using typesafe-config ! I'm not very happy about how I work around Metrics not being too open for adding additional custom metrics. Seems like a hack at places. I will consider removing the Metrics dependency all together. numbers Example output: ``` -- KnownOpsInTimespanTimer------------------------------------------- actor-creation.total.creating-100000-actors.Props|new-EmptyArgsActor|…||-same ops = 100000 time = 1.969 s ops/s = 50782.22 avg = 19.69 μs -- AveragingGauge--------------------------------------------------- actor-creation.Props|new-EmptyArgsActor|…||-same.avg-mem-per-actor avg = 439.67 ```
2014-04-29 10:50:36 +02:00
// metrics, measurements, perf testing
2023-04-21 16:20:42 +02:00
val metrics = "io.dropwizard.metrics" % "metrics-core" % "4.2.10" % Test
val metricsJvm = "io.dropwizard.metrics" % "metrics-jvm" % "4.2.10" % Test
val latencyUtils = "org.latencyutils" % "LatencyUtils" % "2.0.3" % Test
val hdrHistogram = "org.hdrhistogram" % "HdrHistogram" % "2.1.12" % Test
2017-10-06 10:30:28 +02:00
val metricsAll = Seq(metrics, metricsJvm, latencyUtils, hdrHistogram)
// sigar logging
2023-04-21 16:20:42 +02:00
val slf4jJul = "org.slf4j" % "jul-to-slf4j" % slf4jVersion % Test
val slf4jLog4j = "org.slf4j" % "log4j-over-slf4j" % slf4jVersion % Test
// reactive streams tck
val reactiveStreamsTck = ("org.reactivestreams" % "reactive-streams-tck" % reactiveStreamsVersion % Test)
2023-04-21 16:20:42 +02:00
.exclude("org.testng", "testng")
2021-12-23 18:28:30 +05:30
val protobufRuntime = "com.google.protobuf" % "protobuf-java" % protobufJavaVersion % Test
// YCSB (Yahoo Cloud Serving Benchmark https://ycsb.site)
2023-04-21 16:20:42 +02:00
val ycsb = "site.ycsb" % "core" % "0.17.0" % Test
}
object Provided {
// TODO remove from "test" config
2023-04-21 16:20:42 +02:00
val sigarLoader = "io.kamon" % "sigar-loader" % "1.6.6-rev002" % "optional;provided;test"
val activation = "com.sun.activation" % "javax.activation" % "1.2.0" % "provided;test"
2023-04-21 16:20:42 +02:00
val levelDB = "org.iq80.leveldb" % "leveldb" % "0.12" % "optional;provided"
val levelDBmultiJVM = "org.iq80.leveldb" % "leveldb" % "0.12" % "optional;provided;multi-jvm;test"
val levelDBNative = "org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8" % "optional;provided"
val junit = Compile.junit % "optional;provided;test"
2023-04-21 16:20:42 +02:00
val scalatest = Def.setting { "org.scalatest" %% "scalatest" % scalaTestVersion.value % "optional;provided;test" }
2023-04-21 16:20:42 +02:00
val logback = Compile.logback % "optional;provided;test"
Complete logging with SLF4J in Typed, #26537 * TestAppender interaction with LoggingEventFilter * TestAppender plays the same role as classic TestEventList * replace Sl4jLoggingEvent.java * include MDC in testkit.LoggingEvent to allow for custom filter testing MDC * fix tests * fix log events in BehaviorSetKit, using SubstituteLogger * MDC in EventSourcedBehavior * using raw MDC to set the persistenceId and persistencePhase fields * avoid access to MDC ThreadLocal if log isn't used * Automatically enable eventStream Slf4jLogger for Typed (PR #27583) * amend the ActorSystem config on startup when config akka.use-slf4j=on and akka-slf4j in classpath * akka.use-slf4j is defined in akka-actor-typed reference.conf * also enable the Slf4jLoggingFilter automatically * remove config in tests * Include actor path as akkaSource in MDC (PR #27587) * move logger init to ActorContextImpl since not specific to untyped (ActorContextAdapter) * careful to not access MDC ThreadLocal if logging isn't used (per message) * MDC is cleared (if used) from aroundReceive in ActorAdapter after processing each message * also changed MDC for EventSourcedBehavior to rely on context.log and the outer MDC.clear() * just removing the MDC values is not enough because the empty Map remains in the ThreadLocal * Optimization of MDC interceptor (PR #27610) * Extension methods to Logger as workaround for overload and varargs problem (PR #27605) * "ambiguous reference to overloaded definition" for 2 arg method * varargs not supported for primitive types * providing extension methods info2 and infoN (and friends) via implicit class LoggerOps as more convenient workaround for these problems * New API for Typed LoggingEventFilter (PR #27611) * builder style * will make it easier to add more conditions * all conditions are AND:ed together which makes it easier to define custom filters * simplifies the implementation as a bonus * javadsl * use new api in all tests * leeway setting * verify that occurrences = 0 works * use javadsl in two tests * change interceptLogger, and some other feedback * Testing utility to silence logging until failure (PR #27588) * Logback appender that captures all log events and can flush them later to other appenders * LogCapturing mixin for ScalaTest that flush the captured logging events when a test fails. Also clears the captured events after all tests. * Configuration in logback-test.xml * log capturing for JUnit tests too, using TestRule * Silence initial setup logging from Logback * make LogCapturing public * use LogCapturing in all tests * aside from multi-jvm, and a few extending AkkaSpec, so far * a few doc tests needed debug level * mention in migration guide * rename setLoggerClass to setLoggerName * check for logback dependency to give nicer error message * fix filterKeys, deprecated in 2.13
2019-08-24 08:46:39 +02:00
val protobufRuntime = "com.google.protobuf" % "protobuf-java" % protobufJavaVersion % "optional;provided"
}
}
import Compile._
// TODO check if `l ++=` everywhere expensive?
2015-05-21 21:07:37 +02:00
val l = libraryDependencies
val actor = l ++= (CrossVersion.partialVersion(scalaVersion.value) match {
// java8-compat is only used in a couple of places for 2.13,
// it is probably possible to remove the dependency if needed.
case Some((2, n)) if n == 12 =>
List("org.scala-lang.modules" %% "scala-java8-compat" % java8CompatVersion.value) // Scala License
case _ => List.empty
}) ++ Seq(config)
val actorTyped = l ++= Seq(slf4jApi)
2021-12-23 18:28:30 +05:30
val discovery = l ++= Seq(TestDependencies.junit, TestDependencies.scalatest.value)
2021-12-23 18:28:30 +05:30
val coordination = l ++= Seq(TestDependencies.junit, TestDependencies.scalatest.value)
2021-12-23 18:28:30 +05:30
val testkit = l ++= Seq(TestDependencies.junit, TestDependencies.scalatest.value) ++ TestDependencies.metricsAll
2018-10-16 15:35:55 +02:00
val actorTests = l ++= Seq(
2021-12-23 18:28:30 +05:30
TestDependencies.junit,
TestDependencies.scalatest.value,
TestDependencies.scalatestJUnit.value,
TestDependencies.scalatestScalaCheck.value,
TestDependencies.commonsCodec,
TestDependencies.commonsMath,
TestDependencies.jimfs,
TestDependencies.dockerClient,
Provided.activation // dockerClient needs javax.activation.DataSource in JDK 11+
)
val actorTestkitTyped = l ++= Seq(
Provided.logback,
Provided.junit,
Provided.scalatest.value,
2021-12-23 18:28:30 +05:30
TestDependencies.scalatestJUnit.value)
val pki = l ++=
Seq(
asnOne,
// pull up slf4j version from the one provided transitively in asnOne to fix unidoc
Compile.slf4jApi,
2021-12-23 18:28:30 +05:30
TestDependencies.scalatest.value)
val remoteDependencies = Seq(netty, aeronDriver, aeronClient)
val remoteOptionalDependencies = remoteDependencies.map(_ % "optional")
2021-12-23 18:28:30 +05:30
val remote = l ++= Seq(
agrona,
TestDependencies.junit,
TestDependencies.scalatest.value,
TestDependencies.jimfs,
TestDependencies.protobufRuntime) ++ remoteOptionalDependencies
2021-12-23 18:28:30 +05:30
val remoteTests = l ++= Seq(TestDependencies.junit, TestDependencies.scalatest.value) ++ remoteDependencies
val multiNodeTestkit = l ++= Seq(netty)
2021-12-23 18:28:30 +05:30
val cluster = l ++= Seq(TestDependencies.junit, TestDependencies.scalatest.value)
2021-12-23 18:28:30 +05:30
val clusterTools = l ++= Seq(TestDependencies.junit, TestDependencies.scalatest.value)
val clusterSharding = l ++= Seq(
Provided.levelDBmultiJVM,
Provided.levelDBNative,
2021-12-23 18:28:30 +05:30
TestDependencies.junit,
TestDependencies.scalatest.value,
TestDependencies.commonsIo,
TestDependencies.ycsb)
val clusterMetrics = l ++= Seq(
Provided.sigarLoader,
2021-12-23 18:28:30 +05:30
TestDependencies.slf4jJul,
TestDependencies.slf4jLog4j,
TestDependencies.logback,
TestDependencies.scalatestMockito.value)
2021-12-23 18:28:30 +05:30
val distributedData = l ++= Seq(lmdb, TestDependencies.junit, TestDependencies.scalatest.value)
2021-12-23 18:28:30 +05:30
val slf4j = l ++= Seq(slf4jApi, TestDependencies.logback)
val persistence = l ++= Seq(
Provided.levelDB,
Provided.levelDBNative,
2021-12-23 18:28:30 +05:30
TestDependencies.scalatest.value,
TestDependencies.scalatestJUnit.value,
TestDependencies.junit,
TestDependencies.commonsIo,
TestDependencies.commonsCodec)
val persistenceQuery = l ++= Seq(
2021-12-23 18:28:30 +05:30
TestDependencies.scalatest.value,
TestDependencies.junit,
TestDependencies.commonsIo,
Provided.levelDB,
Provided.levelDBNative)
val persistenceTck = l ++= Seq(
2021-12-23 18:28:30 +05:30
TestDependencies.scalatest.value.withConfigurations(Some("compile")),
TestDependencies.junit.withConfigurations(Some("compile")),
Provided.levelDB,
Provided.levelDBNative)
2021-12-23 18:28:30 +05:30
val persistenceTestKit = l ++= Seq(TestDependencies.scalatest.value, TestDependencies.logback)
2021-12-23 18:28:30 +05:30
val persistenceTypedTests = l ++= Seq(TestDependencies.scalatest.value, TestDependencies.logback)
2021-12-23 18:28:30 +05:30
val persistenceShared = l ++= Seq(Provided.levelDB, Provided.levelDBNative, TestDependencies.logback)
val jackson = l ++= Seq(
jacksonCore.value,
jacksonAnnotations.value,
jacksonDatabind.value,
jacksonJdk8.value,
jacksonJsr310.value,
jacksonParameterNames.value,
jacksonCbor.value,
jacksonScala.value,
lz4Java,
2021-12-23 18:28:30 +05:30
TestDependencies.junit,
TestDependencies.scalatest.value)
val osgi = l ++= Seq(
osgiCore,
osgiCompendium,
2021-12-23 18:28:30 +05:30
TestDependencies.logback,
TestDependencies.commonsIo,
TestDependencies.pojosr,
TestDependencies.tinybundles,
TestDependencies.scalatest.value,
TestDependencies.junit)
val docs = l ++= Seq(
TestDependencies.scalatest.value,
TestDependencies.junit,
Docs.sprayJson,
Docs.gson,
Provided.levelDB)
val benchJmh = l ++= Seq(logback, Provided.levelDB, Provided.levelDBNative, Compile.jctools)
// pekko stream
lazy val stream = l ++= Seq[sbt.ModuleID](reactiveStreams, sslConfigCore.value, TestDependencies.scalatest.value)
2021-12-23 18:28:30 +05:30
lazy val streamTestkit = l ++= Seq(
TestDependencies.scalatest.value,
TestDependencies.scalatestScalaCheck.value,
TestDependencies.junit)
lazy val streamTests = l ++= Seq(
2021-12-23 18:28:30 +05:30
TestDependencies.scalatest.value,
TestDependencies.scalatestScalaCheck.value,
TestDependencies.junit,
TestDependencies.commonsIo,
TestDependencies.jimfs)
lazy val streamTestsTck = l ++= Seq(
2021-12-23 18:28:30 +05:30
TestDependencies.scalatest.value,
TestDependencies.scalatestTestNG.value,
TestDependencies.scalatestScalaCheck.value,
TestDependencies.junit,
TestDependencies.reactiveStreamsTck)
}
object DependencyHelpers {
case class ScalaVersionDependentModuleID(modules: String => Seq[ModuleID]) {
def %(config: String): ScalaVersionDependentModuleID =
ScalaVersionDependentModuleID(version => modules(version).map(_ % config))
}
object ScalaVersionDependentModuleID {
implicit def liftConstantModule(mod: ModuleID): ScalaVersionDependentModuleID = versioned(_ => mod)
def versioned(f: String => ModuleID): ScalaVersionDependentModuleID = ScalaVersionDependentModuleID(v => Seq(f(v)))
def fromPF(f: PartialFunction[String, ModuleID]): ScalaVersionDependentModuleID =
ScalaVersionDependentModuleID(version => if (f.isDefinedAt(version)) Seq(f(version)) else Nil)
}
/**
* Use this as a dependency setting if the dependencies contain both static and Scala-version
* dependent entries.
*/
def versionDependentDeps(modules: ScalaVersionDependentModuleID*): Def.Setting[Seq[ModuleID]] =
libraryDependencies ++= modules.flatMap(m => m.modules(scalaVersion.value))
val ScalaVersion = """\d\.\d+\.\d+(?:-(?:M|RC)\d+)?""".r
val nominalScalaVersion: String => String = {
// matches:
// 2.12.0-M1
// 2.12.0-RC1
// 2.12.0
case version @ ScalaVersion() => version
// transforms 2.12.0-custom-version to 2.12.0
case version => version.takeWhile(_ != '-')
}
}